A wide and yet in-depth instruction of functional programming. Making the paradigm shift from imperative to more functional programming has significantly improved my development skills. At first, it used to hurt my brain to try to think functionally, but refactoring my side projects, writing more functional code at work and reading this book have helped.
Some of the core benefits of functional programming are:
- It encourages you to decompose tasks into simple functions, which are more clear and easier to reason about.
- Data is processed using fluent chains.
- You decrease the complexity of event-driven code by enabling reactive paradigms
- Your code is easier to test as a pure function with no side effects have predictable inputs and outputs.
- You can write code that doesn't change state and significantly reduce bugs or decrease the complexity in tracking them down.
The book is divided into three parts, Think functionally, which explains the motivation and purpose behind functional programming, with contrasting examples with object oriented programming and more imperative coding practices to help you transition into thinking more functionally. Part 2, Get functional which explores core functional methods and implementations around variation data structures and real-world coding scenarios as well as functional design patterns. Part 3, Enhancing your functional skills, dives into more advanced concepts around error handling, asynchronous code, memoization, recursion and tail call optimizations as well as exploring some creative programming which uses observables to subscribe to asynchronous events and do function actions along this observable stream of data.