From: Avi Bryant Date: 2001-07-23T12:13:05+09:00 Subject: [ruby-talk:18316] Re: Ruby as opposed to Python? I may regret replying to this thread; bottom line is, if Python works for you, great. On Mon, 23 Jul 2001, Mark Nenadov wrote: > What do you consider a pure OOP language to be? I think no language is > pure OOP.. I think actually every implementation on earth of OOP is not > "pure" persay. Its simply a matter of who has the best OOP support, I > really doubt pure OOP really exists. Smalltalk is, arguably, a pure OOP language: *everything* is expressed in terms of messages from one object to another, including if statements, exceptions, subclassing, etc, etc. Ruby has a couple of things that make it more "pure" than many other OOP languages: - Although control structures are not expressed as messages, everything else is. In Python, primitive types do not behave as objects; don't I remember, for example, that you use len(array) rather than array.length? How do you redefine len() for a subclass of Array? I'm not very familiar with Python, so that example may not be the best one, but look at Java and its int, boolean, etc types. In Ruby, it's turtles all the way down. - Metaclasses. This is very strongly related to the point above. In my admittedly narrow view, if classes aren't objects, it ain't OO enough. Smalltalk, Ruby, Objective-C, CLOS qualify. Python doesn't. Neither does Eiffel, although it's usually considered a pure OO language. I'm not saying that being "pure OO" makes a language inherently better (it might make it appeal more to my personal aesthetics), or that there aren't tasks for which other paradigms work better. But different languages are to greater or lesser degrees built on the object oriented model, and Ruby, for better or for worse, goes much further down that road than most. And if you, like me, think best in that model, you may find that Ruby makes some things easy that less "pure" languages don't. avi