Why use FP?
Throughout the years, there have been many programming styles and fads. However, FP has proven quite resilient and is of great interest today. Why would you want to use FP? Rather, the first question to ask should be, what do you need? And only then, does FP get you that? We’ll answer these important questions in the following sections.
What we need
We can certainly agree that the following list of concerns is universal. Our code should have the following qualities:
- Modular: The functionality of your program should be divided into independent modules, each of which contains a part of the solution. Changes in a module or function shouldn’t affect the rest of the code.
- Understandable: A reader of your program should be able to discern its components, functions, and relationships without undue effort. This is closely linked with the maintainability of the code; your code will have to be maintained in the future, whether to be changed or to have...