Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The problem is that the square is a rectangle in the mathematical sense: a rectangle with ANY additional constraints while code which uses a rectangle expects a rectangle with NO further constraints.

I believe the right choice is to have an AbstractRectangle class representing the rectangle with any further constraints and Rectangle class representing the rectangle with no further constraints.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: