4 ms·
> lodash vs for loop One of these things is not like the other! Lodash is a library if JS idioms that can't be neatly expressed in simple constructs like for
by jhardy54 6y ago
> lodash vs for loop
One of these things is not like the other!
Lodash is a library if JS idioms that can't be neatly expressed in simple constructs like for loops. JS as a language is often difficult to work with because it lacks these idioms, and using Lodash really can't be compared to "for loops".
Happy to answer any questions if you have them.
- jart 6y agoIf you're the author of lodash I'd say it's had an impressive impact. However your choice of words betrays you. How can you define neatness without taking culture and aesthetics into consideration. Lodash doesn't make possible any things that weren't possible before. It just provides a succinct notation for common use-cases with for loops. Which use-cases are common depends on your programming culture. Which library looks most fashionable at solving them isn't that much different from reading Vogue. Even comparing it to for loops is in itself biased, because there are other cultures that are able to do looping without looping at all, like how John McCarthy favored recursive functions. Then the Common Lisp crew invented their own preferred predecessor to lodash called the LOOP macro. I'd bet Urbit does something even crazier.
- 411111111111111 6y ago> * Lodash doesn't make possible any things that weren't possible before.* That applies to literally all libraries. If it's written in the same language, it cannot do anything that you couldn't also do without it.
- jart 6y agoYou're darn right that it applies to all frameworks. However let's not forget about system libraries, which do in fact limit what's possible with your universal turing machine. That has more to do with politics than culture.
- jhardy54 6y agoI'm not the author of Lodash. You should take a look at the API, you'll quickly notice that it's not a for loop library: https://lodash.com/docs/#cloneDeep https://lodash.com/docs/#cloneDeep Some of these functions have been added to JavaScript and are no longer compelling, but many of these still fill voids in the language. Sure, you could write each of these yourself, but Lodash has more eyeballs (better docs, fewer bugs, better performance, etc).