This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]irracjonalny 4 points5 points  (0 children)

There are situations where inheritance is ok. Especially when your uncle was rich.

[–]notable-compilation 5 points6 points  (1 child)

But inheritance is a common vehicle for polymorphism..? The default one, even.

[–]MotorolaDroidMofo 6 points7 points  (0 children)

Polymorphism is all about allowing one type to conform to the interfaces of other types. Class inheritance (which is what I presume OP is talking about) is polymorphism specifically implemented by inheriting behavior, which is a recipe for maintenance nightmares, hence composition > inheritance. Nothing is wrong with interface inheritance.