Procedural Oriented Programming (POP)
- In the procedure oriented approach, large programs are divided into smaller programs known as functions.
- In POP, a program is written as a sequence of procedures or function.
- In POP, each procedure (function) contains a series of instructions for performing a specific task.
- During the program execution each procedure (function) can be called by the other procedures.
- To call a procedure (function), we have to write function name only.
- While we concentrate onto the development of functions, we give very little attention to the data that are being used by various functions.
- In POP, the major emphasis is on procedure (function) and not on the data.
- In a multi-function program, many important data items are placed as global so that they may be accessed by all the functions. Each function may have its own local data.
- Global data are more vulnerable to an accidental change by a function. In a large program it is very difficult to identify what data is used by which function.
- Examples of procedural oriented programming language are COBOL, FORTRAN, PASCAL, C programming language etc.
Characteristics of procedure-oriented programming:-
- Large programs are divided into smaller programs known as functions.
- Most of the functions share global data.
- Data move openly around the system from function to function.
- Functions change the value of data at any time from any place. (Functions transform data from one form to another.)
- It uses top-down approach in program design.
Drawback:-
- In POP, global data can be accessed & changed by any procedure (function) so there is no data security. In case if we want to change type of data of global data, then we also need to resolve all functions that access the data. Due to this it may happened that some errors will occurs
- POP does not model real world problems because functions are action oriented.
Difference between OOP and POP:
OOP | POP |
---|---|
Object oriented. | Structure oriented. |
Program is divided into objects. | Program is divided into functions. |
Bottom-up approach. | Top-down approach. |
Inheritance property is used. | Inheritance is not allowed. |
It uses access specifier. | It doesn’t use access specifier. |
Encapsulation is used to hide the data. | No data hiding. |
Concept of virtual function. | No virtual function. |
Object functions are linked through message passing. | Parts of program are linked through parameter passing. |
Adding new data and functions is easy | Expanding new data and functions is not easy. |
The existing code can be reused. | No code reusability. |
use for solving big problems. | Not suitable for solving big problems. |
C++, Java. | C, Pascal. |
Contact Us