4 ms·
Just as you wouldn't use multiple libraries that bound a CSS selector function to the $ variable, I don't think you'd use underscore and lodash in the same java
by random28345 11y ago
Just as you wouldn't use multiple libraries that bound a CSS selector function to the $ variable, I don't think you'd use underscore and lodash in the same javascript code. Similarly, highlandjs looks to supplant the underscore idioms with stream semantics, and you wouldn't mix both libraries in the same codebase.
- 91bananas 11y agoWhile I can grant that it does seem to solve a lot of the same problems as underscore and lodash, this is just asking for confusion and complication down the road. You shouldn't make a decision that makes things hard for people to deal with in the future if they choose to use your product. There is well established meaning now to $ and _ in js land, pick another identifier.
- maemilius 11y agoI'm not certain I understand how their use of _ is any different from Lo-dash or Underscore's use of the variable. Just because they're not first to the party doesn't mean they can't hop on the established semantics. Their use of _ actually made it easier for me to follow their examples.
- deif 11y agoI think that it's pretty reasonable for a similar library to use the same character if the syntax is similar. As an example, the Domtastic library copies the jQuery syntax literally, allowing an easy transition for new users. It also makes users aware that the library is likely to cover aspects of the other, so they should carefully consider if they really want to include the new one.
- random28345 11y agoI still think the collision with underscore and lodash is intentional and appropriate. It makes a statement saying, "this library is designed to supplant underscore. Do not use underscore and this library together".
- DiThi 11y ago> Do not use underscore and this library together Together in the same module. One can port one module at a time. It's what I do in my current job, each module can use a different set of technologies and we don't have to port everything at once.
- nailer 11y ago$ is used for doc.QS or doc.QSA pretty frequently these days
- msane 11y agoYeah that's basically what his point is. Except you misunderstood to interpret any suggestion that people use underscore and lodash together.