Hacker News new | ask | show | jobs
Composition Over Inheritance – Object Oriented Programming (variadic.me)
4 points by shintoist 4469 days ago
1 comments

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-...

The stack overflow answer seems to be a good guideline.