Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
- Subject: Re: Globals are considered harmful (was Re: Recursion script which doesn't?)
- From: Ehsan Saffari <email@hidden>
- Date: Sat, 7 Apr 2001 04:31:48 -0600
On Fri, 6 Apr 2001 22:09, John W Baxter <email@hidden> wrote:
>
>
At 16:22 -0700 4/6/01, Paul Berkowitz wrote:
>
>Well, this will be interesting. There are people, including some real
>
>experts here, who believe that globals are dangerous, but I've never
>
>understood why. It seems to be something taught in computer classes that
>
>stick with people to the ends of their lives, just like the things that your
>
>parents told you were "bad" when you were 5 years old. I've been wondering
>
>if it's really no more than a superstition and habit, since I've never seen
>
>anything bad result from using globals.
>
>
It's taught in computer class because experience in the days of routine use
>
of globals showed it *could* be a nightmare.
I've never attended a programming class, and I considered the chance of
someone else running another script concurrently that would use the same
global name as one of mine extremely remote.
So would the use of a property instead of a global be the answer,
initialized at the start of each run?
cheers
ehsan