Key links

Traits

Based on Programming Paradigm on Wikipedia.

  • Data and methods are kept as one unit called an object.
  • Perfect encapsulation.
    • One of the distinguishing features of OOP
    • The only way that another object or user would be able to access the data is via the object’s methods - data is “encapsulated” (i.e. “surrounded”) by an object wrapper.
    • SO an object’s inner workings may be changed without affecting any code that uses the object.
    • The need for every object to have methods means that some skeptics associate OOP with software bloat. An attempt to resolve this dilemma came through polymorphism - reducing conditional checks in methods by rather assuming that a method on the right class will know what to do. So you don’t have to check what the type is and then tell the object what to do. This is the “Don’t ask, tell” approach.

OOP languages

Some well-known OOP languages. Based on the list on Programming Paradigm on Wikipedia.

  • Simula (1967)
  • Smalltalk (1972)
  • C++ (1979) - The first modern OOP language.
  • C# (2000) - Based on Java.
  • Eiffel (1986)
  • Python (1991)
  • PHP (1995)
  • Java (1995) - Everything has to exist inside a class, even if it is just a static class with a main method.