Object Oriented Programming

A definition of OOP without talking about cars or humans!

An object could be defined as a self contained program (The Unix Philosophy) At their core, programs are algorithms + data structures. Objects should communicate with each other in a defined way to create complex operations.

  • Data Structures: A collection of information managed in an organized way.
  • Algorithms: A piece of code that manipulates data. A process or set of rules to follow in calculations or problem solving.

Objects provide a safe space for code where the rest of the program will not mess with it.

Makes it easier to modify an object without damaging the rest of the program.

An object is made up of 3 things:

State

A defined interface that can manipulate .this object. (rather than in terms of manipulating data).

Operations

Identity

many objects of the same type, reusing code -> operation on the object of a certain identity.

Object-oriented programming has four basic concepts:

  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism