Skip to content

AbrarShaikh/OOPs_Cpp_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOPs vs POPs

  • objects are a primary source in OOP to implement what is to happen in the code (to model real-world problems).
  • Unlike procedural programming, where functions are written to perform operations on data, OOP involves creating objects that contain both data and functions.
  • in POPs: the program is organized around its code (what is happening/Algorithms) --> "code acting on data".
  • in POPs: the program is organized around Data (what is being affected) --> "data controlling access to code"
  • OOP allows decomposition problems into a number of entities (objects), then builds data and functions around it.
  • OOP emphasis on Data rather than procedure.
  • The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

Object

  • It is a basic unit of OOP and represents the real-life, run-time entities.
  • every object can be distinguished from one other.
  • An object has two characteristics: attributes and behaviour(action).
  • Attributes can be represented by variables and attributes by methods.
  • Objects are the instances of a class that are created to use the attributes and methods of a class.

Class

  • Collection of similar objects is called Class. It is a logical entity.
  • Class is a template, prototype, model or blueprint for creating the objects.
  • It describes the attributes and behaviour performed by its objects
  • It consists of data members and member functions, which can be accessed and used by creating an instance of that class.

Advantage of OOPs over POPs

  • OOPs makes development and maintenance easier where as in Procedure-oriented programming language it is not easy to manage if code grows as project size grows.
  • OOPs provide data hiding whereas in Procedure-oriented programming language a global data can be accessed from anywhere.
  • OOPs provide ability to simulate real-world event much more effectively. We can provide the solution of real word problem if we are using the Object-Oriented Programming language.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published