[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Is this old style Ruby?
From:       Hal Fulton <hal9000 () hypermetrics ! com>
Date:       2005-02-15 23:47:07
Message-ID: 421289E5.30402 () hypermetrics ! com
[Download RAW message or body]

David A. Black wrote:
> Hi --
> 
> On Tue, 15 Feb 2005 centrepins@gmail.com wrote:
> 
>> Page 349 of the (printed) pickaxe2 mentions '::' and '.', but doesn't
>> really suggest which one is best to use.  So I guess it's possibly one
>> of those "preffered-style" things?
> 
> 
> I've never seen :: used where the receiver was anything but a Class or
> Module, and usually for constant access rather than method access.
> *Please* let's not start seeing it in the general case....

Some people do it -- I've seen it before, but I don't advocate it.
It smells like C++ to me.

>> It seems a little bit odd to me to have two ways of doing the same
>> thing.  Seems best (as was mentioned above) to stick to :: for module
>> access and . for everything else.  ??
> 
> I would advocate :: for constant access, and . for method access.

I also advocate . for methods.

:: is necessary for constants. (I once started a thread where I wondered
why we couldn't use dot for constants -- but eventually I painted myself
into a corner and realized "it's already done the right way.")


Hal


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic