• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: compactness of expression question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Smile 1.8.7 update problem
  • Next by Date: Using error handlers (was Re: HD name change for X)
  • Previous by thread: Re: compactness of expression question
  • Next by thread: Re: compactness of expression question
  • Index(es):
    • Date
    • Thread