From: Christian Szegedy Date: 2002-09-06T04:48:49+09:00 Subject: Re: Ruby aesthetics Reimer Behrends wrote: > Christian Szegedy (szegedy@nospam.or.uni-bonn.de) wrote: > [...] > >> What I really dislike in Ruby, that the data members are seen >> by the child classes. This is a very serious issue, and a claer >> violation of object-orientation. > > > Umm, no, it is not. At least the creators of Smalltalk and Eiffel > disagree with you on that. Vertical information hiding -- between parent > and child in an inheritance hierarchy -- is very much a religious issue > and hard to argue objectively one way or the other. > > [...] > > Reimer Behrends In C++, you don't have to know the implementation of the base class, i.e., you only need to know the interface. If you declare a new data member, then it will hide the original one, so you don't have to worry about the private part of all ancestor classes, if you define a new data member. In Ruby, the situation is even worse, as all methods may introduce new data memebers, so you have to check the body of all methods, if you want to avoid name collisions for sure. It may be OK for small projects, but if you have to work in a large class hierarchy written by someone else, it can become hopeless, and you can only hope that nothing goes wrong. Besides, I think it is a clear violation of the separation of mplementation and interface. Best Regards, Christian