scripting style issue

Richard Gaskin ambassador at fourthworld.com
Tue Jan 14 04:18:01 EST 2003


As documented in the Script Style Guide at
<http://www.fourthworld.com/embassy/articles/scriptstyle.html>, I'm fairly
OCD when it comes to variable names, having adopted the sort of
Hungarian-notation-lite that makes dissecting code just a little easier.

There's an item not addressed in that document that's becoming an
ever-bigger part of my scripting: arrays.

It's useful to denote arrays distinctly because they require different
syntax from other variable types.  For example, you can get the value of an
arrany element, but you can't get a displayable string from the array
itself.

For a long time I just added the word "Array" to the end of a variable name
as a reminder, like "gMyOpenWindowsArray".  As I use arrays more and more, I
simply don't want to type that much, any more than I would type
"globalMyOpenWindows"

In recent weeks I've started adding an "a" after the type specifier as a
shorter, arguably clearer, notation:

  string form:  gMyOpenWindows
  array form:   gaMyOpenWindows

With script-locals being:

  string form:  sMyOpenWindows
  array form:   saMyOpenWindows

Parameters:

  string form:  pMyOpenWindows
  array form:   paMyOpenWindows

...etc.

While I've enjoyed this in my own scripting, I recognize there's a fine line
between adding specificity and making things cumbersome.

So three questions:

1. Does this convention seem useful? Specifically, should I bother adding it
to the Script Style Guide?

2. How do you denote arrays?

3. Is this boring?

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.1: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list