Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: A matter of style: how to perform a simple action based on a simple condition?

by GrandFather (Cardinal)
on Sep 26, 2010 at 04:02 UTC ( #862042=note: print w/ replies, xml ) Need Help??


in reply to A matter of style: how to perform a simple action based on a simple condition?

(almost) Never One - it requires too much brain work to figure out what's going on when scanning through code.

Never three - all that is seen is the condition; the action gets lost.

Most often Two. The action is obvious and generally the most important thing. If the condition is really important I'd:

if ($var) { sub (); }

to make the condition obvious and the action easy to find.

As a general rule stuff at the end of a long or complicated line will tend to be ignored. If it's important it be seen don't stick it on the end of a line.

True laziness is hard work


Comment on Re: A matter of style: how to perform a simple action based on a simple condition?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-04-17 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (441 votes), past polls