Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Control Flow - Multiple returns or nested conditionals

by Your Mother (Archbishop)
on Oct 07, 2010 at 17:37 UTC ( #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.

  • Comment on Re: Control Flow - Multiple returns or nested conditionals

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? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2021-07-26 14:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?