News for hackers. Stuff that matters.
Re:Inheritance Often Doesn't Make Sense by hota_mazi on Sunday March 18, 2018 @01:00AM (#16610513)
> Yes, if you ask me for any rectangle, and you reject a square, you are wrong

Intuitively it makes sense, but practically... What if your function wants to set the width and the height to different values?

This is valid for a rectangle, not for a square.

From a mathematical perspective, a square might be a rectangle. From a software standpoint, it's not.

The reason for the discrepancy between mathematics and programming?

Mutability.

There are no comments on this comment yet.