Re:Goodbye, Clean Code
by terandle on Saturday January 11, 2020 @05:20PM
(#22022769)
What is this implying? That instead of adding a property/method to a class you should instead create a child class that inherits from the original with the new properties? Sounds like a great way to have a very complicated class hierarchy IMO
[ Parent
| on HN ]
Re:Goodbye, Clean Code
by erik_seaberg on Saturday January 11, 2020 @05:24PM
(#22022791)
Exactly that. Just because you want new behavior doesn't mean all the other consumers of that class also want it. The old behavior should still exist, and have a name. I'm not sure whether the idea was ever fully developed into patterns for replacing deep hierarchies with simplified classes that factor out some inheritance from otherwise-unused base classes.