Feb 21, 2016

It's just a tool. OOP is basically the same as

  Classname_method(&structure, ...)
Inheritance is a good fit when you want execution efficiency when implementing interfaces. It makes you think in terms of base behavior vs customization and thereby re-use code properly. Most of the time, the resul is that the base class implementation is generic enough to do what you need regardless of the specific instance. But if you really need to override base behavior, that's when you can have things layered on top of basic inheritance.

For example:

* Database access (ORM or NoSql)

* Any sort of server object access (eg File, Request, Socket)

* APIs that discourage duck typing to increase cohesion

* Low level implementations that need efficient implementations of function calls

* Automatic, zero-overhead memory management http://www.stroustrup.com/resource-model.pdf