Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Why lodash instead of underscore? #28

Closed
adammlr opened this issue Aug 19, 2015 · 2 comments
Closed

Why lodash instead of underscore? #28

adammlr opened this issue Aug 19, 2015 · 2 comments

Comments

@adammlr
Copy link

adammlr commented Aug 19, 2015

Seems like you have a strong preference towards lodash in your projects, I've read a couple comparison articles, but was curious as to your reasoning.

@kentcdodds
Copy link
Owner

Underscore is super cool. But yes, I do prefer lodash. Here are a few of my reasons:

  • lodash follows semver, underscore does not. I cannot trust it.
  • lodash is faster (sorry, looks like benchmarks are down currently).
  • lodash has more functionality
  • @jdalton is one of my favorite devs ever (maybe he can chime in with some additional reasons).

It is notable that lodash and underscore are in the process of merging (🎉) into underdash (for the record, I'm not a fan of the name).

Hope that helps you understand the reasoning behind my preference.

@jdalton
Copy link

jdalton commented Aug 19, 2015

Thanks for the ping Kent!

Other reasons are:

  • Modular
    • lodash supports cherry-picking require('lodash/array/chunk') or require('lodash.chunk')
  • Embraces ES6
    • Support for es6 template delimiters
    • Support for Map or WeakMap backed _.memoize caches
    • Uses Set and WeakMap internally for performance gains
    • Has methods like _.includes, _.find, _.findIndex, _.spread, & _.restParam
    • Matches values based off SameValueZero
    • Detects array-like values based on the reverse of ToLength
    • Provides an es6 build.
  • Gives devs features by popular demand. So you get deep path looks ups, callback shorthands, deep cloning, and other features not available in Underscore.
  • ~100% code coverage
  • Customizable with lodash-cli
  • Supports a more FP style with lodash-fp

Lodash's v4 is a proof of concept of the Lodash+Underscore merge and should be out soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants