Perl Style: The If / Else Statement
While reading Perl Best Practices I can across a section which began:
Don’t cuddle an else
It turns out that a cuddled else looks like
} else {
while the uncuddled else places the else on a new line
}
else {
However, I can’t agree. The way I see it, not merging the else and the closing brace of the if statement simply wastes space. And, it doesn’t hurt alignment because you can still follow the else block–it’s just two positions off what it would have been otherwise. What do you think?
This entry was posted on Wednesday, September 6th, 2006 at 10:34 pm and is tagged with alignment, best practices. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

Add New Comment
Viewing 6 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)