----- Original Message ----- 
From: Yukihiro Matsumoto <matz / ruby-lang.org>
To: ruby-talk ML <ruby-talk / ruby-lang.org>
Sent: Tuesday, August 21, 2001 9:46 AM
Subject: [ruby-talk:20057] Re: The Ruby Way [was: Ruby Article]


> But I'm not sure the followings are the Ruby Way:
> 
> |X)  Ask objects to convert themselves
> 

Hmm. Well, it is not my place to disagree with Matz.  :)
I have done it once or twice before, and I think I always
ended up seeing that I was mistaken.

But if I understood this statement correctly, I agree with 
it. My interpretation was: "If an object is to be converted,
that conversion should not be forced on it from outside
using an external piece of code, but there should be a
method associated with the class or object that enables
this kind of conversion, and that should be used instead."

This as I see it is data encapsulation, separation of 
concerns, etc.

Oh, one other thing: Some have made comments saying,
"(This or that principle) is true for *any* language, not just
Ruby." They are correct.

But my comment would be that the Ruby Way embodies 
a way of thinking that is certainly not entirely new. As Ruby
borrows from other languages, so will its techniques borrow
in a straightforward correspondence.

In short, much of the "Ruby Way" is more universal than Ruby
is. To me, it comes down to a question of: Shall we perceive
the universe in a way that matches our prejudices? Or shall 
we change to conform to the universe? If you take the big
picture, the long view, I think the second view is correct, and
that is what I perceive Ruby as doing.

Hal