Procedural Programming and Object Oriented Programming diffrences

Difference between Procedural Programming and Object Oriented Programming



Difference between Procedural Programming and Object Oriented Programming

 

 

 

 

 

No
Procedural Programming
Object oriented Programming
1
It is a Top-Down approach.
It is a Bottom-Up approach.
2
PP basically consists of writing a list of instructions for the computer to follow, and organizing these instructions into groups known as functions.
OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects.
3
This paradigm is:
                           “Decide which procedures you want; use the best algorithms you can find”.
This paradigm is:
                           “Decide which classes and objects are needed; provide a full set of operations for each class”.
4
Languages support this paradigm by providing facilities for passing arguments to function and returning values from functions.
Languages support this paradigm by creating objects and send the messages to them to use or manipulate the attributes.
5
Importance given to algorithms rather than data.
Importance given to data rather than algorithms.
6
Data move openly around the system from function to function.
Data cannot move openly around the system as the concept of data hiding is involved.
7
E.g. C, COBOL, FORTRAN.
E.g. C++, JAVA.
8
Relationship of data and functions is:



  
Global Data
 
Function-2


Local Data
 
Function-1


Local Data
 
       












                                                 
Organization of data and functions in OOP:
    Object A                          Object B
Data
 
Functions
 
Functions
 
Functions
 
Data
 
Data
 
 






     Communication          
                                Object C
9
The primary focus is on functions.
The primary focus is on objects.
10
It is suitable for creating medium size projects.
It is suitable for creating large size projects.
11
It does not model real world problems very well.
It can model real world problems.
12
The complexity of the programs is very high.
The complexity of the programs is less.




Labels: