Re: compactness of expression question
Re: compactness of expression question
- Subject: Re: compactness of expression question
- From: email@hidden
- Date: Thu, 17 Jan 2002 22:16:18 -0500
On Thu, 17 Jan 2002 15:44:13 -0600, billp <email@hidden> noted,
>
Thanks for the solution. I am up against my 32k limit in ScriptEditor
>
so every character counts now. The reason I set each global inside
>
the various if statements before was to not cause AS to set a global
>
for something it may not have measured. I was thinking it was more
>
efficient memory-wise.
Ah, a chance to toss out one of my favorite programming aphorisms.
More computing sins are committed in the name of
efficiency (without necessarily achieving it) than
for any other single reason--including blind stupidity.
--William A. Wulf, "A Case Against the GOTO,"
Proceedings of the Twenty-Fifth National ACM Conference, 1972.
So how to improve? If your script is getting too big, and its got lots of
globals, the problem probably isn't the code, but the data structures you are
using. Code tweeking can only make marginal improvements, but using a proper
data structure can make the script smaller, faster, and easier to understand all
at once.
And consider, a global variable costs less than 0.01 cents ( or 0.1 milliEuros)
so don't worry about their cost. Splurge. Live a little.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden