Re:Ask HN: What topics/subjects are worth learning for a new...
by zild3d on Monday September 17, 2018 @12:06PM
(#18007177)
> A rectangle by definition has width and height independent of each other.
That's not really true though. Definition is a quadrilateral w/ 4 right angles. Width and height can be dependent or not
Even if you did something like implementing the square's size as an average of the underlying rectangle's width and height, which would apparently support both classes correctly, you will get in trouble with the semantics or with other, less "fakeable" properties of these objects.