Differentiate between procedure oriented programming and object oriented programming briefly. Also mention the salient features of object oriented programming.


Q.) Differentiate between procedure oriented programming and object oriented programming briefly. Also mention the salient features of object oriented programming.

Subject: object oriented programming

Procedural Oriented Programming (POP)

  • Focuses on the process or sequence of steps to solve a problem.
  • Emphasizes on breaking the problem into smaller, manageable tasks or procedures.
  • Data and functions are treated separately.
  • Data is stored in global variables, which can be accessed by any function in the program.
  • Functions are independent units of code that perform specific tasks.
  • Program flow is controlled using control structures such as if-else, loops, and goto statements.

Object Oriented Programming (OOP)

  • Focuses on creating objects that represent real-world entities.
  • Emphasizes on bundling data and functions together into a single unit called an object.
  • Data and functions are encapsulated within objects.
  • Data is hidden from other parts of the program, making it more secure and easier to maintain.
  • Functions are methods that operate on the data of the object.
  • Program flow is controlled using object interactions and messages.

Salient Features of Object Oriented Programming

  • Encapsulation: Bundling data and methods together into a single unit.
  • Abstraction: Hiding the implementation details of an object from the user.
  • Modularity: Breaking down a program into smaller, independent units.
  • Inheritance: Creating new classes from existing classes.
  • Polymorphism: Ability for objects of different classes to respond to the same message in different ways.