Programing style
Mark Wieder
mwieder at ahsoftware.net
Sun Nov 19 13:39:47 EST 2006
Eric-
Sunday, November 19, 2006, 3:33:31 AM, you wrote:
> I am used to put a "u" before custom properties names.
> As I put a "t" before local variables, a "g" before globals, etc.
That's the convention I use as well, ala Richard's writeup. By placing
a "t" before the local variables I can instantly tell the scope of a
variable: whether it's local to the current handler or is script-wide.
And the "g" prefix for globals has another advantage as well. I
normally try to avoid globals, but there are times when they serve a
useful purpose. If I later decide I can make a global into a local
variable I run into a problem: globals are persistent, even after the
stack that defined them is not longer present in the computer's
memory. Changing a global by redeclaring it will result in a compiler
error, but not if the "g" prefix is deleted.
--
-Mark Wieder
mwieder at ahsoftware.net
More information about the use-livecode
mailing list