How I rediscovered my love for JavaScript after throwing 90% of it in the trash.
Joel Thoms
4.1K72

Hi Joel! Thanks for sharing and I could not agree more. I havent been code for not a very long time (4 years) and I have been studying FP in Javascript for the last 2. People saying that FP is more difficult to read, harder do say because of bias. I actually think the concepts in FP makes more sense. The think is that people have had OOP shoved down their throats for years, of course that anything that is different from it will seem weird. Furthermore, testing OOP styled code is usually really hard because often there is state shared / mutability etc, besides OOP very often leads to spaghetti (people tend to have those big blocks of procedural code that mixes together a lot of different stuff).

You don’t even need to go hardcore and use advanced concepts, if you only do simple stuff like you mentioned, ditching for loops, taking advantage of reducing functions and have consts assignments you will see a great improvement in code quality, IMHO.

Btw, someone asked about this use and React. You dont ever need to use this if you dont want to. I use recompose for building func components that need state for instance