What a load of malarkey! You simply don’t understand object-oriented programming correctly.

Smalltalk is the best way to understand OOP. It’s the premier OOP language for a reason. Smalltalk is based on the concept of message passing between objects. Each object is essentially a self-contained computer. When you send it a message, you’re asking it to do something for you. These messages are your contract or interface.

The implementation details of the object may change, but this should not affect other objects that communicate with it.

Class inheritance works well if you design it properly. It does require careful thought. But then, programming in general should always require careful thought. Sloppiness will not be tolerated.

If the base class has to change in such a way as to break your design (behaviour should not ever change!), then you’ve done it wrong. You haven’t put sufficient thought into it.

OOP done right is the antithesis of monolithic programming. Each class is essentially a module with its own data structure and associated functions. The key difference is data encapsulation and data hiding.

Moreover, OOP does not mandate inheritance. You can perfectly well use composition or aggregation if this suits your program design better.

Smalltalk has been used for decades by enterprises around the globe to successfully write very large and complex applications. OOP and inheritance have never been an issue for these companies, but that’s because they understood how to use OOP correctly.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store