From: Gavin Sinclair Date: 2002-09-06T10:58:50+09:00 Subject: Re: Ruby aesthetics > Hi, > > In message "Re: Ruby aesthetics" > on 02/09/06, Christian Szegedy > writes: > > |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. > | > |I think Ruby would be a much better language if the instance > |variables would only live per class and not per hierarchy... > > It's in the ToDo list. Private instance variables will be something > like @_foo. But it's pretty hard to implement. If someone come up with > a good idea, I'm glad to hear. > > matz. I'm not too well versed in the principles of data hiding in inheritance hierarchiesm, but the explanation of how it's done in C++ (was it by Christian?) was pretty convincing to me. Therefore, I think private should be the default. Maybe have a keyword to indicate which data members are visible up the chain. Or just rely on accessor methods. My 1c. Gavin