Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
P is for Practical
 
PerlMonks  

Re^2: Breaking out of an 'if'

by thor (Priest)
on Apr 14, 2005 at 19:29 UTC ( [id://448014]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Breaking out of an 'if'
in thread Breaking out of an 'if'

I find the extra braces to be too subtle when rereading the code
Whitespace is your friend:
if ($some_condition){ { #heck, even comment the bare block &some_stuff(); last if $another_condition; &some_more_stuff; } }

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^3: Breaking out of an 'if'
by bluto (Curate) on Apr 15, 2005 at 11:33 UTC
    Whitespace is your friend:

    That helps some, but to me it still looks like a cut/paste error without a comment. If you have to comment, I'm not sure what the point is (i.e. use something like one of the other solutions which is more self-describing), but of course YMMV. Now if you use this all of the time in the code you maintain then that's probably fine since it becomes an idiom (i.e. a programmer will see this code multiple times and realize it isn't a typo). I find that I rarely if ever do this so it would become more of a hazard than anything else to me...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://448014]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.