3 ms·
I totally agree. If you've only been exposed to OOP, and you don't have the bandwidth for learning an unrelated language, then start using a functional library
by cle 11y ago
I totally agree.
If you've only been exposed to OOP, and you don't have the bandwidth for learning an unrelated language, then start using a functional library like Underscore. Just use it everywhere, even if you think it's ridiculous. Don't use for-loops, use _.each. Try to think of every problem in terms of chaining map, reduce, zip, pluck, groupBy, etc. Do whatever you can to avoid side-effects.
Once you're comfortable with it, try reading "Functional JavaScript".
You'll quickly develop a taste for when OOP or functional is appropriate, but I think the best way to get to that point is to immerse yourself in functional programming first, which might mean writing some ridiculous functional stuff, but the long-term payoff will be worth it.