News for hackers. Stuff that matters.
Re:Paul Graham on Spaghetti Code by Ensorceled on Friday April 19, 2013 @08:08AM (#5576138)
Yeah, I was asked to model a graphics program in an interview and got into a argument about why circles should not be a subclass of ellipse. I explained that, yes, mathematically it's a degenerate case, but in a graphics package circles have different algorithms and different user interfaces. They actually have more in common with squares than ellipses.

After about 10 minutes of no progress, I suddenly realized I would be working with and for idiots so I excused myself from the rest of the process.

Re:Paul Graham on Spaghetti Code by praptak on Friday April 19, 2013 @08:26AM (#5576225)
Yeah, Liskov Substitution Principle. I believe that (mutable) circle and (mutable) ellipse is the chief example of the bad kind of inheritance wrt to this rule.