From: William Djaja Tjokroaminata Date: 2002-09-06T01:08:07+09:00 Subject: Re: Ruby aesthetics Hi Gavin, It seems that we agree on most of the stuff. I just want to add that, being a "flexible" language Python is, there is a way to make data private in Python, as discussed in: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=920m9h011uh%40news2.newsguy.com&rnum=4&prev=/groups%3Fq%3Dtjokroaminata%2Bgroup:comp.lang.python.*%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D920m9h011uh%2540news2.newsguy.com%26rnum%3D4 I think it was my last discussion in the python group before I found Ruby, where information hiding in terms of private data member is standard, and I switched right away... Regards, Bill =========================================================================== Gavin Sinclair wrote: >> The biggest problem for me is that in >> Python an object is pretty much like a hash; this is equivalent as having >> all data members as public in C++. > It is a hash. You can add data members to the object outside the class, just > by making a typing mistake. Some may say flexible. I just sneeze. >> (Sure, there is a way around this in >> Python, but it has to be manually made by the programmer, not built-in in >> the language itself.) > AFAIK, you can't make data private in Python. >> In Ruby, on the other hand, all data members are >> private by default (which is the recommended practice in C++), unless we >> explicitly make it otherwise (through the accessor methods). > Data members cannot be made public to the outside world. They are invisible. > The accessor methods are methods, only incidentally related to members :)