
Originally Posted by
Sgarissta
I don't think I claimed it was "the only way" just that it was the way Ruby did it, and is in fact part of the reason for its performance issues.
Sorry you saw my comments as FUD or flame-bait, I was simply making a statement regarding the different design philosophies of the languages, and how it relates to their performance. Please try to keep this on the topic of performance, if you want to do a down and dirty comparison of Ruby and Python, feel free to start another thread.
OK, I must have missunderstood you (although you missunderstand Python too).
And no, there shouldn't be any performance penalties for Ruby because it has a more pronounced message passing philosophy.
Ruby behaves exactly the same as Python when accessing methods or properties. The only thing that's different is that in Python the method itself is an object and in Ruby the method can be wrapped inside an object (Proc). And that's a huge difference in philosophy. But when actually calling a method on an object, there is no difference. The same message passing technique applies to both since they are both dynamic.
That is why there shouldn't be any difference between Python and Ruby in performance just because Ruby is OOP. And that's why Ruby can be at least as fast as Python.
Off Topic:
A note about the self parameter: it is still available in recent versions because it is pythonic to have access to all inner workings. For example, in python, you don't have private variables, you only have a way to hide them from the class dictionary, but nothing else prevents you from accessing it. It is just pythonic not to hide stuff like that. In few words: "Easy to use, but visible". It is only a matter of taste, as I said.
Bookmarks