Just came across this quote in a book on OOP that I’m reading,
A child is only allowed to augment functionality and add functionality. A child is never allowed to remove functionality. If you do find that a child need to remove functionality, this is an indication that the child should appear before the parent in the inheritance hierarchy!
But my question is, isn’t this what overriding does?
You can remove functionality with overriding. But normally you use it to change the behaviour. To let the class behave as it should be.
If behaviour is removed then it is very often a sign of a bad class design.