Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

1, Object; - is something which has its own identity and can be easily compared to a real world

object like a car or a laptop. An object contains a state and some behaviour. The state of an
object is the properties of the object at a particular time, and behaviour is the functions it will
perform. The behaviour of an object is usually described using methods, and these methods will
be part of the object itself. So you don't have to refer anywhere else for object's functionality,
whereas in function based traditional approach you need to remember all the methods and
their location. For instance, in java, the state of an object is the set of values of an object's
variables at any particular time and the behaviour is implemented as methods.

2, Class Objects are grouped into a class. A class can be defined as a group of objects with the
same structure and behaviour. Class can be considered as the blueprint or definition or a
template for an object and describes the properties and behaviour of that object, but without
any actual existence. An object is a particular instance of a class which has actual existence and
there can be many objects (or instances) for a class. In the case of a car or laptop, there will be
a blueprint or design created first and then the actual car or laptop will be built based on that.
We do not actually buy these blueprints but the actual objects.

2, Procedural Programming: can be defined as a programming model which is derived from


structured programming, based upon the concept of calling procedure. Procedures, also known
as routines, subroutines or functions, simply consist of a series of computational steps to be
carried out. During a program’s execution, any given procedure might be called at any point,
including by other procedures or itself.

Languages used in Procedural Programming: FORTRAN, ALGOL, COBOL, BASIC, Pascal and C.

Object Oriented Programming: can be defined as a programming model which is based upon
the concept of objects. Objects contain data in the form of attributes and code in the form of
methods. In object oriented programming, computer programs are designed using the concept
of objects that interact with real world. Object oriented programming languages are various but
the most popular ones are class-based, meaning that objects are instances of classes, which
also determine their types.

Languages used in Object Oriented Programming: Java, C++, C#, Python, PHP, JavaScript, Ruby,
Perl, Objective-C, Dart, Swift, Scala.
Procedural Oriented Object Oriented
Programming Programming

In object oriented
In procedural programming, programming, program is
program is divided into divided into small parts
small parts called functions. called objects.

Object oriented
programming
Procedural programming follows bottom up
follows top down approach. approach.

Object oriented
programming have access
There is no access specifier specifiers like private,
in procedural programming. public, protected etc.

Adding new data and Adding new data and


function is not easy. function is easy.

Procedural programming Object oriented


does not have any proper programming provides
way for hiding data so it data hiding so it is more
is less secure. secure.

Overloading is possible in
In procedural programming, object oriented
overloading is not possible. programming.

In procedural programming, In object oriented


function is more important programming, data is more
Procedural Oriented Object Oriented
Programming Programming

than data. important than function.

Object oriented
Procedural programming is programming is based
based on unreal world. on real world.

Examples: C, FORTRAN, Examples: C++, Java,


Pascal, Basic etc. Python, C# etc
Difference between Procedural Programming and Object Oriented Programming

Procedural

Oriented

Programming

Object Oriented

Programming

In procedural

programming,

program is

divided into small

parts called

functions .

In object oriented

programming,

program is

divided into small

parts called

objects .

Procedural

programming

follows top down


approach .

Object oriented

programming

follows bottom

up approach .

There is no

access specifier

in procedural

programming.

Object oriented

programming

have access

specifiers like

private, public,

protected etc.

Adding new data

and function is

not easy.

Adding new data

and function is

easy.

Procedural

programming

does not have


any proper way

for hiding data so

it is less secure.

Object oriented

programming

provides data

hiding so it is

more secure.

In procedural

programming,

overloading is not

possible.

Overloading is

possible in object

oriented

programming.

In procedural

programming,

function is more

important than

data.

In object oriented

programming,

data is more
important than

function.

Procedural

programming is

based on unreal

world .

Object oriented

programming is

based on real

world .

Examples: C,

FORTRAN,

Pascal, Basic

etc.

Examples: C++,

Java, Python, C#

etc.

You might also like