Accessing globals is faster than accessing data via feature memory, preferences, or database records (unless your routine was passed a locked pointer to the data already). Global variables also have much better access times when data needs to be frequently written.
Performance tuning is still important when your CPU can't dissipate so much power that it requires a fan larger than an entire handheld. Matthew Bevan writes:
Some applications I have written have over 40 globals... *shudder* I find it ironic that every computer programming course I take stresses the need for -no- globals, while PalmOS philosophy is quite the opposite.
Once upon a time, college computer programming courses taught BASIC on timeshared minicomputers. *Every* variable in (ANSI standard) BASIC was global. Of course, the famous computer scientist Edsger W. Dijkstra once observed that "It is practically impossible to teach good programming style to students that have had prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." ( hmmm... maybe you should ignore this message... :^) Ron Nicholson HotPaw (a developer of BASIC interpreters which run under PalmOS...) <http://www.hotpaw.com/rhn/hotpaw > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
