3 ms·
We hired a developer for a project and they introduced Ramda into the codebade (in addition to underscore which was already in use). The resulting code was a m
by cj 7y ago
We hired a developer for a project and they introduced Ramda into the codebade (in addition to underscore which was already in use).
The resulting code was a mix and match of Ramda and Underscore helpers.
Flipping between Ramda and Underscore documentation the decipher the dozens of helper / utility methods is quite infuriating.
Worse, the Ramda API was previously under heavy development with breaking changes on every upgrade. To stay up to date requires reading through pages and pages of migration guides describing how to migrate off of one deprecated utility method to another.
It definitely had short-term value to the person who wrote the original code with it, but that value quickly faded.
- adregan 7y agoI wouldn't recommend mixing those two libraries as they often do _very_ different things with the same name (eg. `chain` in ramda is `flatMap`) but also because ramda mostly flips the arguments of most functions. For example, `map` takes the function first and then the collection. That's handy because everything is curried so you can partially apply map: const double = R.map(x => x * 2); and can build up helper functions. Something similar in lodash would be: const double = (collection) => _.map(collection, x => x * 2); which there is nothing wrong with, it's just that the first is more ergonomic with `pipe` (and the potential future feature pipeline operator `|>`). That said, it took a while to adopt at work. It wasn't until we had a critical mass of people who enjoyed functional programming that it really took off. Before that time, we used a few methods lightly (utils like `pathOr` and `propOr` are so nice when you want to safely traverse an object without `o && o.foo && o.foo.bar`) and were very conscious that it might not be everyone's cup of tea.