From: "Hal E. Fulton" Date: 2002-09-05T03:16:28+09:00 Subject: Re: Ruby aesthetics ----- Original Message ----- From: "William Djaja Tjokroaminata" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Wednesday, September 04, 2002 1:04 PM Subject: Re: Ruby aesthetics > I completely agree with you. Probably it is the standard way of > transforming a non-OO language into a OO language (just like OTcl from > Tcl). In language like C++, which is closely related to C which is very > low level, the language designer has bothered to hide the "this" pointer > so that we don't have to explicitly write it unless necessary. > > Therefore, when in Python, which claims to be an OO language, we have to > write object method as > > def f1 (self, arg1, arg2, ...) > self.data1 = ... > > , I think it is very crude; it smells like a standard procedural language > which was tweaked later to provide OO functionality (just like Perl, with > its ugly module construction to support class > functionality). Furthermore, in Python an object is pretty much a hash, > where we can access and add additional data members anywhere, > anytime, which is totally opposite to the "information hiding" concept in > OOP. This is one of most important reasons, if not *the* main reason I > switched from Python ro Ruby. I have heard of the "passing self" feature of Python, and I have not really understood it. I did a similar trick years ago when I had to use pure C but wanted to do a little OO. That was a simple ugly hack in order to gain a little flexibility. But Python people seem to think this is a feature, not a shortcoming. I saw it explained once (on this list), and I thought I grasped what he was saying, but I still was not convinced. A search for "Python" and "self" might find that post. Hal