Summary of the Programming Paradigms

Review what we have covered in this chapter.

We'll cover the following

Chapter summary

In this chapter, we looked at some of the most popular programming paradigms.

The first two that we looked at, structured and object-oriented programming, are the two paradigms that have dominated programming over the last 35–40 years.

In structured programming, the program state is modified using statements, and the flow of the program is controlled using loops and selections, such as if statements.

Object-oriented programming builds upon the ideas of structured programming, but the code is organized using concepts already known to us (humans), such as classifying things that have similar data and behavior. This is described in classes that act as blueprints for objects that represent real-world things, such as people or bank accounts.

Functional programming is the oldest of the paradigms we covered in this book but has gained popularity in the last decade. In functional programming, we don’t want to modify the state of the program and are using the concept of pure functions to achieve this. Writing programs using this paradigm can reduce errors in the code and make our applications more stable.

In logical programming, we define predicates that will define rules that we can use to answer logical questions. Compared to the other three paradigms, local programming is far less popular.

There are many other paradigms available, and they’re often rather specialized or used by a few obscure languages. Most programming languages are multi-paradigm in that they use concepts from more than one paradigm.

Get hands-on with 1200+ tech skills courses.