What is functional programming?
In Chapter 5, the focus was on object-oriented programming. In this chapter, it will be on functional programming. We will also investigate other concepts to understand and be able to use the related concepts.
Functional programming is a programming paradigm that treats computation as the evaluation of functions. It avoids changes in state and mutable data. The programming that we normally use is different. It is known as imperative programming, and it does just the opposite; its emphasis is on changes in the state of the program.
Something that we must always remember when we are trying to understand functional programming is that this programming paradigm focuses on “what” we are doing. If we use the opposite approach, which would be the imperative one, we would then be focused on “how” we are doing it.
Probably one of the key details of functional programming that stands out to programmers is that traditional...