On Mon, May 28, 2012 at 4:56 PM, Peter Zotov <[email protected]> wrote:
> Robert Klemme писал 28.05.2012 16:38:
>
>> In my experience it is extremely rare that I needed global variables -
>> so rare I can't actually remember the last time I introduced a global
>> variable myself.  If at all I use pre defined globals like $stderr and
>> the like.
>
> I find it quite likely that you are using singletons a lot.

I don't - meaning: I don't use singletons a lot.  The same statement I
made for global variables is true for singletons and constants as
well.  Actually I use global state extremely seldom, if at all.  I
just don't need it they way I write software.

> I'd say that in Ruby, constants are pretty much scoped global variables.

Correct.

> Note that I'm not saying this is necessarily bad; I just mean that there's
> not much difference between "singletons" and "global variables". Both
> represent global state, and the global state itself should be regarded as
> possibly harmful, not particular manifestations of it.

Absolutely agree.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to