Make your code easier to read with Functional Programming

Make your code easier to read with Functional Programming

6 years ago
Anonymous $oIHRkISgaL

https://medium.freecodecamp.org/make-your-code-easier-to-read-with-functional-programming-94fb8cc69f9d

Pure functions are easier to read and understand. All the function’s dependencies are in its definition and are therefore easier to see. Pure functions also tend to be small and do one thing. They don’t use this, a constant source of confusion.

Let’s look and compare the two styles: imperative and functional. In the functional style, I use the basic toolbox for list operations filter() and map() . Then I chain them together.