News for hackers. Stuff that matters.
Re:A Square Is Not A Rectangle by spooneybarger on Monday September 14, 2009 @04:03PM (#822495)
a square is indeed not a rectangle therefore i see this as the only flaw that needs to be pointed out:

public class Square extends Rectangle

inheritance for the sake of implementation is bad OO design.

Re:A Square Is Not A Rectangle by raganwald on Tuesday September 15, 2009 @04:13PM (#824638)
It is an old concept that got ignored somewhere along the road to java. Inheritance for the sake of implementation is called WAS_A. In C++, this is what private inheritance does. In languages like Java and Ruby, WAS-A is often implemented using delegation, so that a square HAS-A rectangle.