in reply to Uncuddled else?
I think a far more readable style would be:if ( some condition ) { print "It's true\n"; } else { print "It's false\n"; }
Why am I proposing such a heretical thing, with the "else" starting on a line by itself, and being indented the same as its matching "if"? Simple - extend the statement to:if ( some condition ) { print "It's true\n"; } else { print "It's false\n"; }
See - each clause of the compount if-elsif-else structure is logically (imho) aligned.if ( Some condition 1 ) { print "First case\n"; } elsif ( Some condition 2) { print "Second case\n"; } else { print "Default case\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Uncuddled else?
by doran (Deacon) on Oct 17, 2000 at 02:15 UTC |