(I tried to move this "globals" discussion to another thread "OT: Palm OS programming philosophy (was Passing variables between forms)" but that failed :))
The whole CS notion of avoid globals is a good rule of thumb, but its not gospel. The concept that they are trying to get across is well-define data dependency and to not have globally visible resources that can be used for multiple purposes in a system. It also encourages better design by avoiding hidden state -- having functions that depend on a variable not in their interface to control their behavior.I agree.
When the lifetime on an variable approaches infinity, the chance of your program to put it in an illegal state approaches 1.
The chance of a program putting a variable in an illegal state doubles for each programmer working on the code.
/V
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
