Sun, Mar 21, 2010 7:19 AM
The Scripting Style Guide was recently updated to include this note about nesting conditional expressions:
When nesting conditions I've found it helpful to use a separate line for each condition, making use of the "\" line continuation character and putting the conjunction in all-caps to draw attention to it:
if (tWd is among the lines of the windows) \ AND (the vis of stack tWd is true) \ AND (the mode of stack tWd = 1) then ... end if
This means a few extra characters when you're typing, but the clarity is well worth the effort. Conditional expressions are the heart of complexity, and the more complex your code is the more difficult it can be to maintain and enhance. Giving them a little extra attention when you write you code can pay big dividends down the road if something breaks.
Blog Home Filed under: best practices scripting style
|
Richard Gaskin
Ambassador, Fourth World
Netbook market on the rise
RunRev Complies with Jobs' Request, Moves Toward Android
Apple Snubs OS X at WWDC
Moment of Zen
Apple's new SDK license locks iPhone out of the HLL revolution
Scripting Style Guide Updated
Agile Manifesto
Bugs in Rev: a little perspective
New Rev-centric Linux Distro
Crystal ball time
Too tall to live, too weird to die
Oracle, Sun, and the future of MySQL
RevWeb security warnings: use sparingly
Installers making a comeback on Mac?
"Rev Message Path" article updated
Your Windows 7 Launch Party
Smartphone competition - at last
Benchmarking performance
New Interviews at revJournal: Jerry and Andre
Windows 7 HIG: time to say goodbye to XP?
agile (1)
Apple weirdness (2)
best practices (2)
community (1)
databases (1)
fluff (2)
games (2)
HyperCard (1)
iPad (3)
iPhone (1)
irony (1)
linux (1)
marketing (6)
mobile (1)
netbooks (1)
performance (1)
predictions (1)
rant (2)
RevMobile (1)
RunRev FAQ (5)
scripting style (1)
server (1)
UI (1)
usability (6)
RunRev.com
Sarah's Rev Blog
Björnke's Stacks Blog
theWorcesterSource
Releasable Rev Blog
RevEditor (tRev) Blog
Chipp Walters 'Rev Blog
WeCode Planet

|