News for hackers. Stuff that matters.

Paul_Dirac

Re:Inheritance Often Doesn't Make Sense on Monday March 19, 2018 @07:24AM (#16617596)
But he uses interface inheritance.

You see it at 9:44. Where he creates the concept_t and int_model_t inherits from it.

Re:Inheritance Often Doesn't Make Sense on Monday March 19, 2018 @07:14AM (#16617556)
The problem is that the square is a rectangle in the mathematical sense: a rectangle with ANY additional constraints while code which uses a rectangle expects a rectangle with NO further constraints.

I believe the right choice is to have an AbstractRectangle class representing the rectangle with any further constraints and Rectangle class representing the rectangle with no further constraints.