Discussion:
Any Convention on Naming Conventions?
Calvin Waterbury
2011-01-15 01:14:40 UTC
Permalink
Hello,

I have spent some time perusing the articles on "Naming Conventions,"
but I did not discover anything about mutual agreement on the subject
(maybe I missed it?).

Is there any universally accepted and agreed on "Naming Convention" I
should adopt?

Thank you,
Calvin
Bob Sneidar
2011-01-15 01:36:50 UTC
Permalink
Everyone has their own. I name variables beginning with the, as in theSQL, but others will tell you this is bad practice because if I put a space between the and everything else, LiveCode will think I am talking about a property! DOH! I'm a bad, bad programmer. SBT Accounting used to have all variables begin with m (for Memory I guess), arrays began with a, global variables began with m0 (or a0 for global arrays) etc.

Besides that, I preface data grids with dg, groups with grp, labels with lbl, data fields with fld, buttons with btn, etc. Why you ask? Because the Application Browser sorts by name, and this way I can have all my like objects sorted together whilst still maintaining the tree format it uses. Also, when searching, I can find all references to buttons by searching my scripts for btn.

I also try to make it a habit to enclose object names in quotes. It isn't strictly necessary, as LiveCode is very forgiving in this respect, but it avoids any conflicts and actually makes it a bit easier to distinguish variables from object names in my code.

Bob
Post by Calvin Waterbury
Hello,
I have spent some time perusing the articles on "Naming Conventions," but I did not discover anything about mutual agreement on the subject (maybe I missed it?).
Is there any universally accepted and agreed on "Naming Convention" I should adopt?
Thank you,
Calvin
_______________________________________________
use-livecode mailing list
http://lists.runrev.com/mailman/listinfo/use-livecode
Mark Wieder
2011-01-15 01:54:07 UTC
Permalink
Calvin-
Post by Calvin Waterbury
Hello,
I have spent some time perusing the articles on "Naming Conventions,"
but I did not discover anything about mutual agreement on the subject
(maybe I missed it?).
Is there any universally accepted and agreed on "Naming Convention" I
should adopt?
Some weekend reading for you:

http://www.fourthworld.com/embassy/articles/scriptstyle.html
http://www.fourthworld.com/embassy/articles/revolution_message_path.html
--
-Mark Wieder
***@ahsoftware.net
Calvin Waterbury
2011-01-15 02:01:07 UTC
Permalink
Hey Mark,

Thanks! I had already read the first one, courtesy of David C., but the
second link is fresh territory!

@Richard - Nice!

Fair winds,
Calvin
------------------------------------------------------------------------
Friday, January 14, 2011 7:54 PM
Calvin-
Post by Calvin Waterbury
Hello,
I have spent some time perusing the articles on "Naming Conventions,"
but I did not discover anything about mutual agreement on the subject
(maybe I missed it?).
Is there any universally accepted and agreed on "Naming Convention" I
should adopt?
http://www.fourthworld.com/embassy/articles/scriptstyle.html
http://www.fourthworld.com/embassy/articles/revolution_message_path.html
------------------------------------------------------------------------
Friday, January 14, 2011 7:14 PM
Hello,
I have spent some time perusing the articles on "Naming Conventions,"
but I did not discover anything about mutual agreement on the subject
(maybe I missed it?).
Is there any universally accepted and agreed on "Naming Convention" I
should adopt?
Thank you,
Calvin
Richard Gaskin
2011-01-15 14:58:41 UTC
Permalink
Post by Calvin Waterbury
------------------------------------------------------------------------
Mark Wieder <mailto:mwieder at ahsoftware.net>
Friday, January 14, 2011 7:54 PM
...
Post by Calvin Waterbury
http://www.fourthworld.com/embassy/articles/scriptstyle.html
http://www.fourthworld.com/embassy/articles/revolution_message_path.html
Thanks! I had already read the first one, courtesy of David C., but
the second link is fresh territory!
@Richard - Nice!
Thank you for the kind word, but you should be warned:

If you advocate the use of Hungarian-lite notation you put yourself at
risk of being pelted with small packets of M&Ms.

:)

Long story. I'll tell you over a pint at the next RevCon if you're
there, or next time you're passing through Los Angeles.

(Man, I miss Dar being on this list more regularly....)

--
Richard Gaskin
Fourth World
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

Continue reading on narkive:
Loading...