Before we dive into this chapter, let's discuss a bit about programming paradigms.
Bluntly put, programming paradigms are different ways to express what a program should do. Paradigms have a very important influence over many aspects of the code you write, regarding maintainability, readability, performance, and so on.
The classic paradigms are the imperative/procedural ones that focus purely on the logical sequence of operations to perform and organize the code in groups of procedures that modify the state. The C programming language is a great example of a procedural/imperative programming language.
Another hugely popular programming paradigm in the industry nowadays is the functional programming (FP) one, which is declarative and focuses on the desired outcomes. With FP, you declare a series of functions to apply in order to reach the results...