C++
, Comparison of Procedural and Object Oriented Programming
Parameter Object Oriented Programming Procedural Programming
Definition Object-oriented Programming is a programming Procedural Programming is a
language that uses classes and objects to create programming language that follows a
models based on the real world environment. In step-by-step approach to break down a
OOPs, it makes it easy to maintain and modify task into a collection of variables and
existing code as new objects are created routines (or subroutines) through a
inheriting characteristics from existing ones. sequence of instructions. Each step is
carried out in order in a systematic
manner so that a computer can
understand what to do.
Approach In OOPs concept of objects and classes is In procedural programming, the main
introduced and hence the program is divided into program is divided into small parts
small chunks called objects which are instances of based on the functions and is treated as
classes. separate program for individual smaller
program.
Access In OOPs access modifiers are introduced namely as No such modifiers are introduced in
modifiers Private, Public, and Protected. procedural programming.
Security Due to abstraction in OOPs data hiding is possible Procedural programming is less secure
and hence it is more secure than POP. as compare to OOPs.
,Complexity OOPs due to modularity in its programs is There is no simple process to
less complex and hence new data objects add data in procedural
can be created easily from existing objects programming, at least not
making object-oriented programs easy to without revising the whole
modify program.
Conclusion
Program OOP divides a program into small parts and Procedural programming
division these parts are referred to as objects. divides a program into small
programs and each small
program is referred to as a
function.
Importance OOP gives importance to data rather than Procedural programming does
functions or procedures. not give importance to data.
In POP, functions along with
sequence of actions are
followed.
Inheritance OOP provides inheritance in three modes Procedural programming does
i.e. protected, private, and public not provide any inheritance.
Examples C++, C#, Java, Python, etc. are the examples C, BASIC, COBOL, Pascal, etc.
of OOP languages. are the examples POP
languages.
, List of OOPS languages and its features
• Object-oriented programming, or OOPs, is a
programming model which breaks down a problem
in terms of classes and objects.
• OOPs allows the creation of several instances of a
class called objects, hence facilitating code reuse.
• Some object-oriented programming languages
are C++, Java, Javascript,Python, etc.
• The four main pillars or features of object-oriented
programming include
• Abstraction,
• Polymorphism,
• Inheritance, and
• Encapsulation,
, Comparison of Procedural and Object Oriented Programming
Parameter Object Oriented Programming Procedural Programming
Definition Object-oriented Programming is a programming Procedural Programming is a
language that uses classes and objects to create programming language that follows a
models based on the real world environment. In step-by-step approach to break down a
OOPs, it makes it easy to maintain and modify task into a collection of variables and
existing code as new objects are created routines (or subroutines) through a
inheriting characteristics from existing ones. sequence of instructions. Each step is
carried out in order in a systematic
manner so that a computer can
understand what to do.
Approach In OOPs concept of objects and classes is In procedural programming, the main
introduced and hence the program is divided into program is divided into small parts
small chunks called objects which are instances of based on the functions and is treated as
classes. separate program for individual smaller
program.
Access In OOPs access modifiers are introduced namely as No such modifiers are introduced in
modifiers Private, Public, and Protected. procedural programming.
Security Due to abstraction in OOPs data hiding is possible Procedural programming is less secure
and hence it is more secure than POP. as compare to OOPs.
,Complexity OOPs due to modularity in its programs is There is no simple process to
less complex and hence new data objects add data in procedural
can be created easily from existing objects programming, at least not
making object-oriented programs easy to without revising the whole
modify program.
Conclusion
Program OOP divides a program into small parts and Procedural programming
division these parts are referred to as objects. divides a program into small
programs and each small
program is referred to as a
function.
Importance OOP gives importance to data rather than Procedural programming does
functions or procedures. not give importance to data.
In POP, functions along with
sequence of actions are
followed.
Inheritance OOP provides inheritance in three modes Procedural programming does
i.e. protected, private, and public not provide any inheritance.
Examples C++, C#, Java, Python, etc. are the examples C, BASIC, COBOL, Pascal, etc.
of OOP languages. are the examples POP
languages.
, List of OOPS languages and its features
• Object-oriented programming, or OOPs, is a
programming model which breaks down a problem
in terms of classes and objects.
• OOPs allows the creation of several instances of a
class called objects, hence facilitating code reuse.
• Some object-oriented programming languages
are C++, Java, Javascript,Python, etc.
• The four main pillars or features of object-oriented
programming include
• Abstraction,
• Polymorphism,
• Inheritance, and
• Encapsulation,