Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Logical expression style

by dada (Chaplain)
on Jul 18, 2002 at 12:02 UTC ( [id://182772]=note: print w/replies, xml ) Need Help??


in reply to Logical expression style

that's how I do it (I know it isn't perlstyle, it's just how I do it):
if( A and B and C ) { # ... } # I drop the extra space when doing 'or': if(A or B or C ) { # ... } # I super-indent when booleans are composite: if( A and ( B or C ) and D ) { # ... }
I *always* leave parentheses on a line by its own, because too often I have to add an 'or C1' that I didn't thought of.

this also goes for lists, BTW. I *always* leave the last dangling comma (many, many times I wish I could do it in C):

my @array = ( $one, $two, $three, );
cheers,
Aldo
__END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://182772]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-26 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found