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

Re: Control Flow - Multiple returns or nested conditionals

by Your Mother (Archbishop)
on Oct 07, 2010 at 17:37 UTC ( [id://864048]=note: print w/replies, xml ) Need Help??


in reply to Control Flow - Multiple returns or nested conditionals

I'd argue for whichever structure feels the most natural for the given use. I find that I have to twist or contrive temporary variables and such more often when attempting to avoid multiple return statements so I tend to prefer the multiple style. As others have said, it is often easier to read and avoiding long or deep nesting almost always improves readability.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-29 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found