Best Practices in Rev development
Devin Asay
devin_asay at byu.edu
Wed Jun 20 20:04:05 EDT 2007
On Jun 20, 2007, at 5:55 PM, Robert J. Earp wrote:
> I'm sure that even the most perfect code does not declare all local
> variables as in the case of repeat loops, and practically speaking
> declaring them has no benefit. However, a MUCH more important
> point is to name variables with something short and meaningful, and
> if you do this with a "l" or a "g" as a first letter the code
> becomes self explanatory. We tend to keep a master list of
> variables in a cross reference as we talk to external devices.
> That helps too.
>
> Sorry Mark, I don't put code in separate handlers unless the code
> is going to be used more than once. Then the handler is stuck up
> the project somewhere its To always create two handlers just ends
> up with unnecessary message passing (overhead).
I tend to agree on this one. My rule-of-thumb is "2-3"; in other
words, if I need to execute the same code 2 or more times and that
code is more than about 3 lines, I'll break the code out into another
handler.
>
> Generally our projects are built by a group, so one other major
> recommendation is to add lotsa comments to the code. When I'm the
> only one developing a stack it always seems a waste of time, but
> with my brain it's saved me many times in the long run.
>
> Richard, didn't you publish a paper on recommended coding
> standards? If I remember correctly it was extremely valuable to
> new and old developers alike, and well worth reading every year or so.
<http://www.fourthworld.com/embassy/articles/scriptstyle.html>
Devin Asay
Humanities Technology and Research Support Center
Brigham Young University
More information about the use-livecode
mailing list