Procedure Oriented programming versus Object oriented programming
Procedure Oriented programming versus Object oriented programming
Procedural Programming::-
- 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:-
- 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.
Differences between Procedural and 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.
- n 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.
Benefits of C / C++ over Other Programming Languages:-
Benefits of C:-
As a middle level language, C combines the features of both high level and low level languages. It can be used for low-level programming, such as scripting for drivers and kernels and it also supports functions of high level programming languages, such as scripting for software applications etc.
C is a structured programming language which allows a complex program to be broken into simpler programs called functions. It also allows free movement of data across these functions.
C language is case-sensitive.
C is highly portable and is used for scripting system applications which form a major part of Windows, UNIX and Linux operating system.
C is a general purpose programming language and can efficiently work on enterprise applications, games, graphics, and applications requiring calculations.
C language has a rich library which provides a number of built-in functions. It also offers dynamic memory allocation.
Benefits of C++
C++ is a highly portable language and is often the language of choice for multi-device, multi-platform app development.
C++ is an object-oriented programming language and includes classes, inheritance, polymorphism, data abstraction and encapsulation.
C++ has a rich function library.
C++ allows exception handling, and function overloading which are not possible in C.
C++ is a powerful, efficient and fast language. It finds a wide range of applications – from GUI applications to 3D graphics for games to real-time mathematical simulations.
Comments
Post a Comment