3 ms·
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,
by Ensorceled 14y ago
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.
- praptak 14y agoYeah, 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.