Unpopularity of global variables - why?

J. Landman Gay jacque at hyperactivesw.com
Fri Oct 12 21:13:22 CDT 2012


On 10/12/12 6:50 PM, Timothy Miller wrote:
>
> I consistently put empty into all unused globals when a script starts.

Unlike HyperCard, in LiveCode you can actually delete them entirely:

   delete global gMyGlobal

I don't have a particular hatred for globals either, you just have to 
know how to be careful with them. On the other hand, I don't think I've 
needed one now for years but if I did, I wouldn't hesitate to use it. 
They are faster and more convenient than a property or a handler, but 
their main advantage is that they aren't tied to any particular stack. 
That's a big advantage, even if you don't need it very often.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list