Google Groups Home
Help | Sign in
Message from discussion A different perspective on Ruby.
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Yukihiro Matsumoto  
View profile
 More options May 26 2005, 9:51 am
Newsgroups: comp.lang.ruby
From: Yukihiro Matsumoto <m...@ruby-lang.org>
Date: Thu, 26 May 2005 22:51:39 +0900
Local: Thurs, May 26 2005 9:51 am
Subject: Re: A different perspective on Ruby.
Hi,

In message "Re: A different perspective on Ruby."
    on Thu, 26 May 2005 21:35:19 +0900, "gsincl...@gmail.com" <gsincl...@gmail.com> writes:

|"It's 5.abs for absolute value, but Math.sqrt(5) for square root."
|
|Good point.  That bugs me too.  abs is a *function*, not logically a
|method.

The definition of abs is not questionable; it returns self, negated
when self is negative, for all numeric value.  On the other hand,
natural sqrt() may return float or integer, or something else.  That's
the reason for sqrt() being a function in Math module.  Note that the
name "Math" means math.h (collection of float value functions) in
Unix, not mathematics in general.

Besides that, he doesn't understand what POLS means.  Since someone
will surprise for any arbitrary choice, it is impossible to satisfy
"least surprise" in his sense.  The truth is two folds: a) when there
are two or more choices in the language design decision, I take the
one that makes _me_ surprise least.  b) as a result, you will have
less surprise in Ruby than other languages, once you have accustomed
to it.

But I'm tired of explaining POLS again and again.  I haven't even used
it first.  I hope no one will use the term "POLS" any more to sell
Ruby.  It's free after all.

                                                        matz.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google