Programming languages come in different shapes and sizes: interpreted and compiled, with weak and strict typing, low-level and high-level, concise and expressive. There are many segments in which you can put the programming language, although not all of them are equally significant.
One of the most common ways to classify languages is to organize them into paradigms. The paradigm can be considered as a group of languages that have similar characteristics. At the moment, many paradigms are used: procedural, functional and object-oriented. Many of these terms are often incorrectly applied or confused. There is also some degree of overlap between different paradigms, which complicates the task.
For beginners who have not understood the topic, it will be quite difficult to understand all these paradigms. In this article, we will consider one of them - the paradigm of imperative programming.
What is imperative programming?
Imperative programming is a software development paradigm in which a program describes steps that change the state of a computer. This paradigm requires an understanding of the functions needed to solve the problem, not reliance on models capable of solving it. In imperative programming, special attention is paid to how the problem should be solved, which requires a detailed step-by-step guide. Since the written code performs functions instead of models, the programmer must encode each step. Programs written in this way are often compiled into binary executable files, which are more efficient, since all processor instructions themselves are imperative operators.
Purpose of imperative programming
The imperative style uses operators that change the state of the program. The state of the program is nothing more than the contents of memory at a certain point in time. In computer programming, the assignment operator sets or resets the value stored in the memory locations designated by the variable name. In most imperative programming languages, such as C, C++, Java, Kotlin, PHP, the assignment operator is a fundamental construction.
The Value of the Imperative Paradigm
Many programming languages are based on the paradigm of imperative style, and they are still used today. This is probably because the imperative approach is an original form of programming. And although there are alternative models, the imperative paradigm still has several practical advantages.
Languages are quite easy to learn, since the code can be read as step-by-step instructions. Therefore, programmers, as a rule, first begin to learn the imperative language.
In everyday operations, the most important factor is easy reading. Ultimately, different employees can maintain and optimize applications effortlessly, not just one particular person who wrote the code.
Imperative languages
All modern imperative languages go back to three imperative languages:
FORTRAN (The IBM Mathematical FORmula TRANslating system) - the first language in which there were no boundaries of machine code. It was developed in 1955 by John Backus and is still widely used for numerical applications.
ALGOL 60 is an algorithmic language developed in the 1650s by a joint European-American committee. The first block structured language that made the use of mathematically algorithms easier.
COBOL is a common business-oriented language. Was created to handle large data files.
A large number of modern imperative languages follow the style that originated in Algol 60. These languages include Ada and Pascal and can thus be described as Algol style languages. There is also a significant group of languages that can be described as C style languages, these include the object-oriented C++ language and Java.