Best Practices in Rev development

Ken Ray kray at sonsothunder.com
Tue Jun 19 14:16:53 EDT 2007


On Tue, 19 Jun 2007 10:18:26 -0600, Devin Asay wrote:

> Are they helpful?

Very nice, Devin!

> Could some of them inadvertently cause problems down the road?
> Have I left something important out?

Well, I don't know if this is *important*, but it works for me - it's 
along the lines of "Use meaningful names": I name all buttons exactly 
the same as their labels, without any spaces or punctuation, so for 
example a checkbox that says "Use meaningful names" would be named 
"UseMeaningfulNames" - this makes it unnecessary to look up the name of 
a button in order to address it in a script. The only times I break 
this habit is where conventional abbreviations are things that come to 
"top of mind" as an alternative (for example, a button that says 
"Download Now" would be named "DLNow" because "DL" is a very common 
alternative for "Download"). 

Similarly I name all fields based on the label that precedes it (if 
there is one) using the same approach. So a label field that says 
"First Name:" and has a text entry field next to it would have the 
entry field named "FirstName". I generally don't give names to label 
fields, but if I do need to, I follow the rule above and add "lbl" in 
front of it (so the label field I describe above would be called 
"lblFirstName" if I needed to address it).

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list