What is the imperative programming paradigm

Imperative programming: an overview of the oldest programming paradigm

The imperative programming (from the Latin imperare = command) is the oldest programming paradigm. According to this paradigm, a program consists of a clearly defined sequence of instructions to a computer.

The source code of imperative languages ​​strings together commands that determine what the computer has to do and when to achieve a desired result. Values ​​used in variables are changed during the runtime of the program. To control the commands will be Control structures such as loops or branches integrated into the code.

The imperative programming languages ​​are very specific and work closely with the system. The code is easy to understand on the one hand, and on the other many lines of source code needed to describe what can be achieved in declarative programming languages ​​with a fraction of the commands.

The most famous imperative programming languages:

  • Fortran
  • Java
  • Pascal
  • C.
  • C #
  • C ++
  • Assembler
  • python
  • Ruby

The various imperative programming languages ​​can in turn be assigned to three further, subordinate programming styles: the structured, the procedural and the modular programming style.

The structured programming style extends the imperative basic principle to include concrete ones Control structures Sequences, selection (selection) and iteration (repetition). The reason for this is the containment or complete avoidance of jump instructions that make imperative code unnecessarily complicated.

The procedural approach divides the task that a program is supposed to take on into smaller subtasks that are individually described in the code. This creates programming blocks that can also be used in other programs. It goes one step further modular programming model, in which the individual program components are designed, developed and tested completely independently of one another. Only then do the individual modules combine to form the actual software.