News for hackers. Stuff that matters.
Re:Software Engineering at Google (2017) by erik_seaberg on Friday January 04, 2019 @04:38PM (#18827891)
This gets back to the https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle. I should be able to override just the behavior I want to change, rather than permanently edit the shared implementation eliminating the behavior you want.
Re:Software Engineering at Google (2017) by BeetleB on Friday January 04, 2019 @05:13PM (#18828190)
A better solution is "Just don't couple the two pieces of code!"

It takes a fair amount of work to design a good class where one can easily apply the open-closed principle. And one should where it's needed. But tying together two completely unrelated parts of your code base with such a class just because the two pieces of code are almost identical is the wrong approach. Then going ahead and designing it for the open-closed principle merely adds complexity.