From: David Masover Date: 2009-02-11T05:36:25+09:00 Subject: Re: Ruby vs Perl performance Igor Pirnovar wrote: > David Masover wrote: > >> I'm not trying to sell Perl's OO as the best thing, or >> even "better". But I'm defending it as inherently less >> useful than Ruby's. Someone might as easily say that >> Ruby's OO is inherently less useful than Java's, because >> Java does stricter (static) type-checking. >> > > It lacks so many > things that what you get by using it is redundancy and more work, the > things that good OO is trying to minimize if not eliminate. Granted... > what you call lack of type-checking can arguably be considered one of > Ruby's big advantages over those languages that have this feature. > Yes, I realize this. However, you should also realize that both Perl and Javascript have a few similar features that make Ruby actually stricter than either. The examples I gave both revolve around the fact that in Perl and Javascript, functions (or subroutines) are just that. They can be used as methods, and thus related to an object or a class, but they are not inherently tied to that object. In Ruby, however, I can't use a method from one class on a method from another class, unless the two classes are related. I also can't use a class as a module. In other words, it's the exact same sort of static type checking, protect-you-from-yourself mentality as Java. > Strictly, from a pragmatical point of view, it makes much more sense > classifying objects based on what they can do rather than to which > "aristocracy" they belong. Except that Ruby enforces the aristocracy with respect to which methods belong to which classes. > It takes to much effort > in procedural languages to account for that which they lack! > Except Perl is not strictly procedural, and Javascript actually has a very nice prototypal object system.