Hacker News new | comments | show | ask | jobs | submit login

It also conflicts with gettext libraries. The name '_' should be considered reserved for that purpose.



Not to be a jerk, but why? What if gettext isn't important to your current application? (I don't know a lot about gettext; I went and read the blurb.)


In pretty much any language which has a gettext implementation, "_" is the name used for the function/method/whatever which marks a string for translation. This is just as true in JavaScript (at least two JS gettext implementations that I know of use "_"). It's one of the few truly cross-language naming conventions I know of.

But libraries which expect to be able to use "_" for something other than gettext break this convention, and not only run the risk of screwing interoperability but also cause confusion for the (large number of) developers who are accustomed to "_" having a particular meaning.


True, but as long as _ is defined as a non-primitive type (namely an object or function) it can be used for both gettext (or underscore.js) and this currying function. All that's required for the currying is that comparison with anything other than itself is false.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: