Ramda vs Lodash

- 1 min

Javascript is almost certainly the most popular functional programming language in the world. However, in case you’re still using ECMA5 it is practically impossible to accomplish well crafted functional code without an utilities library.

Most people I know would adopt Underscore or Lodash in that case. However, after reading the Mostly Adequate Guide to Functional Programming and watching the “Hey Underscore, You’re Doing It Wrong!” talk by Brian Lonsdorf, I decided to give Ramda a try in my last project.

The main advantages of Ramda, in my opinion, are the following:

The example bellow shows these Ramda capabilities in a direct comparison with the Lodash version.

Conclusion

In the context of ECMA5 Javascript, I feel like Ramda leads to more declarative code with less implicit side-effects. The fact you less frequently need to explicit mention your data and you don’t need to declare anonymous functions everywhere definitely reduces the amount of noise in your code and makes it fairly cheaper to maintain.

Vinicius Gomes

Vinicius Gomes

Software Developer

comments powered by Disqus
rss facebook twitter github youtube mail spotify instagram linkedin google pinterest medium