3 ms·
I like functional languages. I don't like imperative languages trying to do functional programming. Especially Javascript. It's just pain to debug a `.filter()
by guitarlimeo 2y ago
I like functional languages.
I don't like imperative languages trying to do functional programming. Especially Javascript. It's just pain to debug a `.filter().map().reduce()` chain, you have to create a separate variable every time you want to insert a `console.log` there somewhere to figure it out.
Also I don't like functional programming eating away the performance. You can sure write 3 O(n) loops easily, but you can't see the instant wins to optimize it the same way you can with imperative programming. Maybe the third loop wanted to reuse something that could be found in the first loop? With imperative programming: Great, put it in a variable outside of the first loop, and fill it. With functional programming: Change all the types in the loops to fit this new variable, and remember to return it through all these functions.
EDIT:
Also as jordigh pointed out here https://news.ycombinator.com/item?id=41160794 https://news.ycombinator.com/item?id=41160794 I don't like how functional programming obfuscates performance a bit. With imperative languages what you code is what you get. Functional languages do so much more behind the scenes, that it's hard to figure it out some times.