- In the world of Computer Science, we can find programming languages to suit all tastes.
- Of course, the choice of one language or another does not depend on our taste, but on the context in which it is to be used.
- In computer science the situation is changing faster and faster every day and, as we’ve seen, many languages adapt to the new ways of doing things.
In the world of Computer Science, we can find programming languages to suit all tastes. Of course, the choice of one language or another does not depend on our taste, but on the context in which it is to be used. Implementing a facial recognition system is not the same as developing a RESTful API… However, there are not only different programming languages that we can choose depending on each situation, but also different programming paradigms. In this post we’ll take a brief look at what each of these paradigms consists of.
What is a programming paradigm?
A programming paradigm has been defined as a “technological proposal adopted by a community of programmers and developers whose central core is unquestionable in that it only attempts to solve one or several clearly delimited problems”. In plain language, we can define a programming paradigm as the way in which the computing tasks should be carried out to achieve the objectives. It may also be understood as a style of programming, although the previous definition would be more exact. There are many types of paradigms, and in the following sections we are going to see those that are more important today.
This is the paradigm that tends to be used the most. It is based on the sequential execution of orders that are interpreted by a compiler and carried out in order, in this way changing the state of the programme. Languages that use this type of paradigm are the programming languages C, Java and Python.
Whereas in the imperative paradigm, the instructions that should be executed to reach a solution are specified; in the declarative paradigm, instructions that describe the solution of the problem are used. They are internal mechanisms that try to solve the problem thanks to the sentences that the user has introduced. Some languages use this model of programming; the best known are Haskell, LISP and Prolog.
Object-oriented programming became popular in the early 1990s. In this paradigm, the programmes attempt to approach reality more by encapsulating concepts. In this way, each “entity” in the programme consists of an object with its own attributes and functions. Therefore, the programme works by interacting with objects that reach their own states. The most important languages that belong to this paradigm are JAVA, C++ and Ruby. However, like in the other paradigms, many languages have evolved so that they are also able to use the type of characteristics that this paradigm provides.
This post has tried to explain very superficially some of the most important programming paradigms today. But this does not mean they are the only ones. In computer science the situation is changing faster and faster every day and, as we’ve seen, many languages adapt to the new ways of doing things.