Key Differences Between OOP and POP
- POP is a procedure oriented programming whereas, OOP is an object oriented programming.
- The main focus of POP is on “how to get the task done” it follows the flow chart to get the task done. OOP’s main focus is on data security as only the objects of a class are allowed to access the attributes or function of a class.
- The functions are small units of the large programs that execute to get the main task done. In OOP attributes and functions of the class are divided among the objects.
- In POP, there is no specific accessing mode to access attributes or functions in the program whereas, in OOP there are three accessing modes “public”, “private”, “protected”, that are used as an accessing share to access attributes or functions.
- POP does not support the concept of Overloading/polymorphism. OOP supports Overloading/Polymorphism a which means using the same function name for performing different functions. We can overload functions, constructor, and operators in OOP.
- There is no concept of inheritance in POP whereas, OOP supports inheritance which allows using the attribute and functions of other class by inheriting it.
- POP is less secure as compared to OOP because in OOP the access specifier limits the access to attributes or functions which increase the security.
- In POP if some data is to be shared among all the functions in the program is declared globally outside all functions. In OOP the data member of the class can be accessed through the member functions of the class.
- In POP there is no concept of the friend function whereas, in OOP there is a concept of friend function which is not the member of the class but because it is friend member it can access the data member and member functions of the class.
- There is no concept of virtual classes in POP whereas, in OOP the virtual functions supports polymorphism.
sandeep kd manwal Answered question