----- Original Message -----
From: Yukihiro Matsumoto <matz / ruby-lang.org>
To: ruby-talk ML <ruby-talk / ruby-lang.org>
Sent: Monday, September 03, 2001 11:38 PM
Subject: [ruby-talk:20838] Re: RCR: non-bang equivalent to []=


> Hi,
>
> In message "[ruby-talk:20834] Re: RCR: non-bang equivalent to []="
>     on 01/09/04, "Conrad Schneiker" <schneiker / jump.net> writes:
>
> |> > I'd like to have bang and non-bang versions of each and every method.
> |> > The names should just differ in the !, like collect and collect!
> |
> |IIRC from previous discussions, isn't this precisely the convention that
> |Scheme uses? (IIRC, this is where Matz got the idea for his particular
> |variation.)
>
> It is the origin of the bang name idea, but in fact they are
> different.  As Hal pointed out, Scheme's bang is the mark for
> self-modifying functions, on the other hand, Ruby's bang is the mark
> for "more dangarous alternative; handle with care".

Hmm, I made some related comments, though I never mentioned
Scheme (which I don't know). Someone else mentioned Scheme.

I think I'm in agreement with Matz if I understand him right.

But the comments below are mine only. And there are no insults or
flames intended toward any individuals! This is not an emotionally
charged issue for me (not as much as some things in Ruby).  ;)

It was Ralph Waldo Emerson who said, "A foolish consistency is the
hobgoblin of little minds." To me, a unilateral bang-notation falls under
the heading of a fooolish consistency. (It's interesting to note that even
one of the proponents of this policy advocated several exceptions to it.)

I think that some people want to make this into a kind of "Hungarian
notation" -- and I don't say that in a complimentary way, as I've always
hated that convention.

The punctuation in this case should serve as a hint or reminder rather
than an absolute unfailing guide. It is an  *aid* to your understanding --
not a *replacement* for your understanding.

If we embraced the other philosophy fully, I think we would end up
looking more like Perl, where array names are marked with a special
punctuation mark. I'm also reminded of ancient BASIC programs
where punctuation indicated data type. (I don't really know VB. Maybe
it still does this.)

It might be amusing to write a little program to read a data file and
calculate the ratio of punctuation to alphanumerics. Then run the program
with a large representative corpus of Perl code, Ruby, BASIC, C, C++,
etc....

I'd bet the subjectively "prettier" code has a lower ratio. But if it's
subjective, it's debatable anyway, isn't it? Enough speculation.

Cheers,
Hal