<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> > Well, you would if you override the two set_* methods to set both<br>> > height and width to the same value <G>
<br>><br>> But that breaks expectations: a user doesn't expect set_width() to affect<br>> the height.<br><br>I can't speak for everyone but I certainly expect setting the width of<br>a Square to change it's height. In fact, that would probably be the
<br>reason I used a Square rather than a Rectangle in the first place.<br></blockquote></div><br>You might expect this, but the algorithm that resizes a rectangle for some reason does not expect this. That's why a Square IS NOT a Rectangle from an IT point of view, even if it is from a mathematical one. I see this every day in my code, and if a square were to be given instead of a recatngl, all my code would break immediately.
<br>One can see inheritance as a generalization, not the opposite.<br clear="all"><br>Matthieu<br>-- <br>French PhD student<br>Website : <a href="http://miles.developpez.com/">http://miles.developpez.com/</a><br>Blogs : <a href="http://matt.eifelle.com">
http://matt.eifelle.com</a> and <a href="http://blog.developpez.com/?blog=92">http://blog.developpez.com/?blog=92</a><br>LinkedIn : <a href="http://www.linkedin.com/in/matthieubrucher">http://www.linkedin.com/in/matthieubrucher
</a>