Re:Inheritance Often Doesn't Make Sense
by milesrout on Saturday March 17, 2018 @06:08AM
(#16606256)
The thing is, rectangles are a kind of square, and squares are a kind of rectangle, from different perspectives.
[ Parent
| on HN ]
Re:Inheritance Often Doesn't Make Sense
by your-nanny on Saturday March 17, 2018 @11:47PM
(#16610391)
From what perspective is a rectangle a kind of square?
Re:Inheritance Often Doesn't Make Sense
by balfirevic on Sunday March 18, 2018 @01:13AM
(#16610535)
From a write-only perspective. If you imagine mutating operations that square might have (for example setSideLength) rectangles can satisfy them perfectly well.