Subdomains of Imperative Programming
There are different mutually exclusive domains of imperative programming i.e., procedural programming, structured programming, modular and OOP. However, it is also important to note that all of these programming paradigms are present as the subdomains of imperative programming to provide evolution and address some challenges but there are some differences as well from imperative programming. There are some differences between these paradigms.
First it needs to understand that imperative programming is an opposite paradigm to declarative programming. Therefore, its main comparison is with declarative programming. Please visit Imperative vs Declarative Programming for more details. Additionally, imperative programming follows the imperative style of performing complete functionality step-by-step. All of the subdomains of imperative programming are mutually exclusive and deals with the small blocks of code. These subordinates of imperative programming are as follows:
1. Structured Programming
Structured programming is an extension of imperative programming which uses the control structure through iteration and sequence for code organization by using block structures like for loop, do-while or while loop etc. However, structured programming provides more maintainability as well as readability of the program by avoiding GOTO statements.
2. Modular Programming
Modular Programming deals with block of codes named as modules which are re-used. These modules are compiled together to get the final result. Structured as well as modular programming deal with the division of code into smaller parts but structured programming performs this through control structures and modular programming through modules.
3. Procedural Programming
Procedural programming divides the entire task into the smaller functions. Code, which is structured and based on the functions, but not object-oriented is fall under the domain of procedural programming. In this programming paradigm, procedures defined by functions dominates over data and hence making it different from OOP.
4. Object-Oriented Programming
Object-Oriented Programming formalizes the functions into objects providing the improved reusability of code and encapsulation. OOP can be called as the structured programming in which code defines the procedure and objects defines the attributes. OOP acts as the subset of imperative programming with additional features of abstraction, encapsulation, inheritance and polymorphism.
What is Imperative Programming?
The computer programming paradigm defines the style of programming, approach to solve problem and method of computer systems towards providing solutions use programming. There is a classification of programming paradigms into two broad paradigms i.e., imperative and declarative. This article is based on the introduction to imperative programming, its key features, its advantages and disadvantages.