JavaScript in 2016: functional programming has come seriously and for a long time
- Transfer

With such frameworks as Backbone, it was customary to synchronize the data itself and the presentation of the data - for this it was necessary to manually subscribe to the necessary dom events. This method was error prone and forced to use too much sample code. Angular came and fixed it with automated two-way binding.
But now everything is moving in a different direction.
Together with React and its tools, such as Redux, an immutable approach makes writing code easier than using a traditional, mutable state. When using mutable state, the application cannot take advantage of modern tools, for example, live reloading. Therefore, I really want to leave everything immutable.
Libraries based on the functional programming paradigm (the same Redux) are easier to expand - because pure functions are more compatible. Such libraries usually have fewer lines of code, resulting in fewer bugs and reduced complexity. For fun, take a look at the Redux source code . It takes less than 15 minutes to view it - in fact, a bit of code.
Docking and reducing complexity means that the tools can achieve the highest quality. Things like live reloading and time-travel-debugging cannot be quickly and easily implemented for applications made in an imperative style. Although technically possible, the side effects of the functions will interfere.
Let's not forget that frameworks and libraries come and go. It is likely that React will not be the most popular technology in a year or two. But the whole point is that the functional paradigm that has gained distribution thanks to React and other functional libraries will remain. The toolkit is so good that there is no turning back. After you started using live reloading and time-travel-debugging, you definitely won’t want to go back. These things really increase productivity .
The future is in interactive software development. If you want to learn about interactive programming examples, check out the Bret Victors homepage . Pay attention to his report “Inventing on Principle”.
Functional code is usually less prone to bugs. True, frontend developers are going in this direction for another reason. Functional programming offers nothing fundamentally new. The reason is the toolkit, and the fact that you can reduce the number of bugs. Simpler code is a side (and nice) effect.
Conclusions
Even if React will not be a super-popular technology in the future, the philosophy of functional programming will remain.
If you are new to functional programming, I recommend looking at Haskell. “Learn You a Haskell for a Great Good” book is publicly available. Studying Haskell is worth it to gain a deep knowledge of programming, even if you are not going to use this language for any serious project. I also recommend looking at this article , which shows examples of where functional programming is used.
Thanks for attention. Follow us on Twitter if you are interested in such stories.
About the author
Hello! My name is Mark, I'm a software developer. I live in Germany. I love to play with new technologies. You can watch my Android app and find out more facts about me .
If you liked the post, subscribe to my email newsletter.