nested ifs

Dave Cragg dcragg at lacscentre.co.uk
Wed Jan 25 15:45:01 EST 2006


On 25 Jan 2006, at 18:14, simplsol at aol.com wrote:


> if (long statement)
> then (long response)

It's this form I was referring to. To me it lacks clarity and is  
easily lost amongst the other statements in a handler.

I find the notion of  one "thing" per line to be clear and simple.   
But when we use control structures that span more than one line, then  
it's clearer to mark the end of that structure (end if, end repeat,  
etc.)

So, I find these clear:

1.
if <condition> then <statement>

2.
if <condition> then
   <statement(s)>
end if

3.
if <condition>
then
   <statement(s)>
end if

But the following I find difficult to read:

4.

if <condition>
then <statement>

and especially

if <condition>
then <statement>
else <statement>

But as you say, it's a matter of personal taste. :-)

Cheers
Dave



More information about the use-livecode mailing list