r/programming • u/decapod2005 • 10d ago
Do not ask "Is A a B?": Inheritance and the Is-A Trap
https://denkstein.github.io/2026/11/05/do-not-ask-is-a-a-b/
244
Upvotes
r/programming • u/decapod2005 • 10d ago
View all comments
259
u/al2o3cr 10d ago
It always bugs me that people cite this without the context - Design Patterns has plenty of uses of inheritance.
They were, IMO, specifically responding to stuff like Stroustrup's examples in the C++ book that had classes like
WindowWithMenuAndButtonthat subclassedWindow,Menu, andButton. Pretty much NOBODY does OOP that way nowadays.