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 13:32:22 -0600
On 07/04/2001 12:39, John W Baxter <email@hidden>, wrote:
>
>At 4:31 -0600 4/7/01, Ehsan Saffari wrote:
>
>So would the use of a property instead of a global be the answer,
>
>initialized at the start of each run?
>
>
No...properties are essentially globals which are given an initial value at
>
compile time, when used in the main script. The problem with globals isn't
>
that running a different script concurrently could trample on them but that
>
they don't scale well to large scripts (or large programs):
So their asset turns out to be their liability?
>
it is too easy for the script writer to get confused. A script editor which
>
supports multiple panes would help.
So is it bad to use a global if one is using SE, but OK in SD (or others?)
>
Global doesn't mean "every script can see it" but rather "everything in
>
this script can see it."
Thank you for the correction. And I thought that was the point of using a
global, so a value can be set a retrieved anywhere else in the script.
This sounds like "We use a match to light a fire but we shouldn't use
matches because they may cause a fire"
>
John (who has removed an erroneous assertion and a wonderful example
>
purporting to demonstrate it....whew!)
And thank you for doing so, appreciate it.
cheers
ehsan