November 21, 2019

Back to Basics: Object-Oriented Programming

Speaker

Jon Kalb, Software Instructor

Thoughts

I’ve being trying to find good modern material about OOP it’s very difficult. I imagine that OOP has some good lesons about modularity and composition that might be very good to really master and to apply in different contexts. I noticed that OOP depends a lot on the community behind it, I could not find many good same principles from Java, C++ and Ruby comminuties. But I am still studying and trying to understand polymorphism better.

Definitions

OOP: a programming paradigm in C++ using polymorphism based on runtime function dispatch using virtual functions

Quotes

After the base class guarantees the preconditions and postconditions of an operation, any derived class must respect those guarantess. An override can ask for less and provide more, but it must never require more or promise less because that would break the contract that was promised to calling code.

Recommendations

  1. Why are so many developers hating on Object-Oriented Programming?

  2. Make every class in your hierarchy either a base-only or leaf-only

  3. Give one entity one cohesive responsibility

  4. Use OOP to model "is-a" relationships, not for code-reuse

Tags: c++ programming