Better HN
topnewbestaskshowjobs
Log inSign up

Paul_Dirac

1 karma · joined Mar 19, 2018 (8y ago) · 2 submissions

Submissions

comment 8y ago · link · parent

But he uses interface inheritance.

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

comment 8y ago · link · parent

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.