4 ms·
I never understood the point of Ramda. It's like it's trying to replace the core functionality of JS with something that's completely orthogonal to what the lan
by enlyth 7y ago
I never understood the point of Ramda. It's like it's trying to replace the core functionality of JS with something that's completely orthogonal to what the language actually is, but it's just a bolted on library.
I've worked on codebases where people ignore all built-in JS functions (like Array.map/filter) and write Ramda spaghetti instead with multiple nested pipes and lens and what not to show off their FP purism.
Most of the time, you don't need any of this, it just makes the codebase unreadable, and hard for new people to join the project and be productive in a timely fashion.
- onion2k 7y agoMost of the time, you don't need any of this, it just makes the codebase unreadable, and hard for new people to join the project and be productive in a timely fashion. This is exactly how I felt when I inherited a big project that uses lodash/fp. Having spent ~6 months with the code now I prefer having a functional layer on top of JS. It does make sense.
- wdroz 7y agoMaybe to avoid questionable behaviors, like in the article posted 3 months ago "Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in JavaScript" [0] [0] - https://news.ycombinator.com/item?id=20242852 https://news.ycombinator.com/item?id=20242852
- Roboprog 7y agoThings like Ramda and jquery help avoid fighting against IE and other browser nuances, as well. Even when there seem to be native functions/ methods to do something. That’s where the monster lives.
- tashoecraft 7y agoI only reach for Ramda when the built in Js functions can not accomplish what I want to do, or it would be very messy/hard to reason about. Now that’s very subjective, but I hate when I see people using lodash/ramda map to just map over an array. There’s a lot you can do with the built in methods and they will probably be the superior option
- Roboprog 7y agoYou stick with your “polyfill”, I’ll stick with mine , so to speak. It’s nice to be able to make a function as concisely as something like: Const foo_finder = R.find( R.propEq( ‘prop’, ‘foo’ ) ) ... Const a_foo = foo_finder( a_list )
- enlyth 7y agoSee this is one of the things I personally hate, accessing or evaluating properties on objects using a string. We have code so use code which can be parsed, evaluated by the type checker, and so on. What if you mistype 'fop' instead of 'foo'?