The systematic and organized principle of writing a program is called as programming paradigm. It contains Procedural programming approach, Structural programming approach and Modular programming approach.
In Procedural Programming, the problem is viewed in a sequence manner. It follows the concept of top-down approach. In procedural programming, we divide a problem into sub-problems recursively and then we write a procedure for each sub-problem. Procedures communicate with each other by parameters. In this approach, data is declared locally or globally. Pascal and C support this programming approach. For example, if you want to implement a stack, you divide the problem into smaller problems like how to push value in a stack, how to pop a value and how to find whether stack is full or empty. Then you write functions for Push, Pop, stack empty and stack full and call these functions using its parameters to implement a stack in a program. The stack size is declared in main program using a data structure (may be an array).
Advantages of Procedural Programming
Disadvantages of Procedural Programming
It is an approach for writing programs which when adopted, makes the logical-steps of the program simple and much more understandable. So that not only the writer of the program understands it but it is easy for other programmers to follow the logic.
Advantages of Structural Approach:
Disadvantage of Structural Approach:
In this approach, the program is divided into modules. Each module can contain procedures, functions, macros which are related to each other. A Modular can be designed coded and debugged separately with minimum amount of interaction.
C enables modular programming by providing provision for including files and separate compilation facilities.
C++ enables modular programming by providing the concept of classes and objects.
Advantages of Modular Approach:
Top down approaches emphasize planning and a complete understanding of the system. It is essential that no coding can begin until a sufficient level of detail has been reached in the design of at least some part of the system. The top-up approach is done by attaching the stubs in place of the module. However, this delay testing of the ultimate functional units of a system until significant design is complete.
Top up design was promoted in 1970's by IBM researchers Harlan Mills and Nucleus Wirth.
Top Down Top down design basically an approach follows the following steps:
Advantages of Top-down Approach:
Bottom up approach starts from the bottom level of operation and then a higher level until the stage is reached. In bottom approach the base elements are linked together to form larger subsystems, which are linked sometimes in many levels till a complete top-level system is formed.
Bottom Up In this approach one first visualizes a typical system design and decided by experience, intuition or some analysis that which parts of the design are most difficult and essential ones. In this approach each module is coded as soon as its design is fixed. This type of approach is mostly followed while developing the software for operating systems, where one has to first develop the software for handling primitive calls. Using these programs upper layers is developed and using these layers next higher-level software's are developed.
Advantages of Bottom-up Approach: