The discussion about Strict Compile Mode brought in a lot of stuff about 
globals, and I sense that many people think they're a bad thing - I am not 
talking about trick ways of using them, just regular globals that allow one to 
refer quantities (numbers, strings, anything really) across scripts which are 
housed in different objects in the same program (set of stacks).

The thing is, I can't see the objection. Clearly any technique can become 
sufficiently messy and obscure as to negate its own usefulness, but what's 
wrong with the idea itself? If I want to maintain for example a status across a 
whole program, if I don't use a global, I am going to have to use a custom prop 
or a function to transmit that status across object boundaries, and that means 
more typing with no more security, so why do it? What's wrong with

   if gMy_Status is "open"...

compared to

   if fMy_Status() is "open"…

or

   get the cpMy_Status of stack "myStack"
   if it is "open"…

Again, since the 'constant' command doesn't have global status, what's wrong 
with using globals to store program-wide constants? Is any other way cleaner?

Obviously I'm missing the point - I know I am. It's probably my age. But I'd 
like to see a more reasoned attack on globals before I give them up.

Graham
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to