From: William Djaja Tjokroaminata Date: 2002-09-06T05:08:55+09:00 Subject: Re: Ruby aesthetics I think you have a very good point regarding Ruby design. Although I don't think (at least for now) that Ruby is going to be used in very large scale, it may limit the scalability of Ruby. I don't think people can be expected to always check obj.instance_variables every time they create a new data member. In my case, as I develop in C, I have put a lot of data members in C struct instead of Ruby data hash, in which case name collision is impossible. I still have not solved the puzzle of how to best create the C's struct so that we can mimic the Ruby object inheritance on the C side. Probably the solution is to combine Ruby and C++ for large projects where C++ takes much of the load and Ruby is used more as an advance, programmable, interface? Regards, Bill ========================================================================== Christian Szegedy wrote: > 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