8 ms·
I've been doing FP in JavaScript fulltime for a few years now. I find it much easier than the OOP approach. My advice to the author is: choose ImmutableJS, Ram
by zumu 9y ago
I've been doing FP in JavaScript fulltime for a few years now. I find it much easier than the OOP approach.
My advice to the author is: choose ImmutableJS, Ramda, OR lodash. Don't choose all three.
I think that is his anti-pattern.
> I could be more productive if I didn’t have to wonder things like ... “Should I mutate this variable?”
If you're doing FP the answer is likely 'No.'
- nidu 9y agoAgree with this one. Reading article i though "Why don't you just drop ImmutableJS in favor of pure js collections with lodash/fp?". I felt the same when were using ImmutableJS. Two collection libraries across the app is very inconvenient. One could build entire infrastructure with ImmutableJS and restrict native collections to only system boundaries, but in js you usually befriend a lot of libs which makes it complex.
- k__ 9y agoOr? Ramda doesn't even have the same functionality as Lodash.
- dagw 9y agoThere is however enough overlap that using both ends up being a mess.
- zumu 9y agoExcuse the overstatement -- there are sane ways to use the libraries in the same project. The point was the 3 libraries all prescribe a certain model of structuring and operating on data. One cannot reasonably expect to use all 3 without some cognitive overhead.
- k__ 9y agoI see. I was just reminded of last week, when I needed a utils lib. I read many good things about Ramda, but then I wanted to debounce a function and it failed me, haha.