

Composition Over Inheritance – Object Oriented Programming - shintoist
https://variadic.me/posts/2014-03-28-composition-over-inheritance.html

======
collyw
Read the article, then wikipedia to see why the preference. Yes, I can see
that composition can leave you a more flexible model, but at the same time
inheritance could save you a fair bit of coding. And less code is less likely
to have bugs (though probably composition code is fairly straight forward). I
guess use each where it is appropriate.

[http://stackoverflow.com/questions/56860/what-is-the-
liskov-...](http://stackoverflow.com/questions/56860/what-is-the-liskov-
substitution-principle)

The stack overflow answer seems to be a good guideline.

