Skip to content

Comment on Why composition is often better than inheritanceparent

Comments

Your wikipedia link actually does a good job of showing why the composition shown in the article is poorly conceived. The whole point of 'composition over inheritance' is that your object is still polymorphic on the composed-of classes.

that's a good point, in the process of trying to use composition the author has made a (very) leaky abstraction.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.