When you are new to programming, programming paradigms are not of much importance. But with each new concept you learn and start creating complex programs and software, it becomes important to understand which programming paradigm is best suited for your project.
A paradigm is a set of concepts and practices that constitutes a way of viewing reality for the community in our case the C++ developers or programmers.
The origin of the C++ programing language comes from the C programming language. C provides the basis for the C++ procedural programming paradigm.
Procedural programming involves using variables and functions to create reusable procedures that constitute a full program.
Procedural Programming may be the first programming paradigm that a new developer will learn. The procedural fundamentally directly instructs a device on how to finish a task in logical steps. This paradigm uses a top-down approach and treats data and functions as two different entities. Procedural Programming divides the program into procedures, which are also known as functions, containing a series of steps to be carried out.
- The coding is easy and simple.
- The codes have the ability to be reused in several parts of the program.
- The programming paradigm consumes less memory on the computer.
- It is easier for tracking the flow of the codes in the program written in the procedural programming paradigm.
- Focus is on functions rather than data.
- In large programs, it is difficult to identify the scope of global data.
- The use of global data is prone to errors and it could be an obstacle in case of maintenance and enhancements.
- The modification of global data requires the modification of those functions using it.
- Maintaining and updating program code is difficult because of global data.
- The procedural programming does not model the real-world problem very well since functions are action-oriented and do not really correspond to the elements of the problem.