Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Really Long if/elsif/else blocks

by mandarin (Friar)
on May 31, 2008 at 20:29 UTC ( #689460=note: print w/replies, xml ) Need Help??


in reply to Re: Really Long if/elsif/else blocks
in thread Really Long if/elsif/else blocks

Perl Best Practices by Damian Conway (O'Reilly, 2005) clearly states: "Don't cuddle an else". The recommended way is
if ( $foo ) { $blah; } elsif ( $bar ) { $baz; } else { $boom; }

Replies are listed 'Best First'.
Re^3: Really Long if/elsif/else blocks
by MidLifeXis (Monsignor) on May 31, 2008 at 22:47 UTC

    While PBP contains many good recommendations, that is what they are. They are not law, requirements, or to be followed blindly.

    --MidLifeXis

Re^3: Really Long if/elsif/else blocks
by educated_foo (Vicar) on Jun 01, 2008 at 03:31 UTC
    So what? There are many styles that allow one to easily line up sequences of if/elsif/.../else. "Person X does this, therefore X is the only way" is poor reasoning.
Re^3: Really Long if/elsif/else blocks
by Anonymous Monk on Jun 01, 2008 at 12:05 UTC
    one of the most petty things included in said book, that he gets the most heat for (its like spaces v. tabs )
Re^3: Really Long if/elsif/else blocks
by parv (Priest) on Jun 01, 2008 at 08:05 UTC

    Nope, there is only One True Way ...

    if ( ... ) { ... } else { ... }

    ;>} ... but really <what others have already stated>.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://689460]
help
Chatterbox?
[Corion]: Oooh - what a nice idea - QoS throttling on AWS, test enviroment runs fast, production also, until it doesn't
[Corion]: But then, you can just pay to make it fast again. Be a shame if it were to slow down, wouldn't it?

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-07-26 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (400 votes). Check out past polls.