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: John W Baxter <email@hidden>
- Date: Sun, 8 Apr 2001 10:42:17 -0700
At 13:32 -0600 4/7/01, Ehsan Saffari wrote:
>
>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?)
That wasn't my intent, but I see how you read it that way.
Script Debugger (and others with multiple panes or the equivalent) might
help recover from problems caused by globals simply because you can see
more than one part of your script at a time. (You can with Script Editor
too, but it's not as clean: take a screen shot of one part...open that in
SimpleText, use Script Editor to look at other parts, arrange windows
appropriately...remember to toss out the screen shot when you make it stale
by changing something that is shown in it.)
Aside from that, the debugging capabilities would help as well.
Or one could avoid the problems in the first place by leaving the errors
out of one's scripts, and a common source of errors is mismanaged globals.
If there are no globals, that particular error is impossible...if there are
few it is not too hard to avoid.
--
John Baxter email@hidden Port Ludlow, WA, USA