A curious case
Richard Gaskin
ambassador at fourthworld.com
Wed Mar 2 11:26:57 EST 2011
Andre Garzia wrote:
> I tend to work on the same way. longer forms makes shorter understanding
> time. I'd rather write more and understand more than write faster and then
> one week from now, be completely lost in nested mazes
Well said.
And sometimes lengthy deeply-nested IFs are good candidates for a switch
block.
I once stumbled across two tips about code style that have been very
helpful:
1. If a given function has nested IFs more than three levels deep, it
may be a good candidate for breaking it up into smaller functions.
2. If a function is longer than can be viewed in one screen, it may be a
good candidate for breaking it up into smaller functions.
Sometimes those can't be applied for sound practical reasons, but where
they can oh boy does it make code more readable.
--
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
More information about the use-livecode
mailing list