Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Would you use 'goto' here?

by dws (Chancellor)
on Dec 06, 2001 at 03:42 UTC ( #129803=note: print w/replies, xml ) Need Help??


in reply to Would you use 'goto' here?

In this case the performance gained from using the goto instead of a more conventional subroutine call is probably outweighed by the maintenance risk. Somebody is liable to pick this up and not understand it, and then either undo the trick or add a layer of bandaids on top of it. I'd go with
return edit_office_product(@_) if $query->param('officeID');

Replies are listed 'Best First'.
(Ovid) Re: Re: Would you use 'goto' here?
by Ovid (Cardinal) on Dec 06, 2001 at 04:05 UTC

    Actually, my concern was having the call stack accurately reflect what I wanted (and having a function do what I truly want it to do) versus having a bit of code that some might not understand. As a standing rule, I never optimize for performance. I optimize for correctness and clarity. Performance is rarely an issue for an unfinished product as it can't truly be predicted :)

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://129803]
help
Chatterbox?
[Cosmic37]: ok fankyou - I was wondering about that but thought there might be a redefine command or something; peachy
[Lotus1]: Cosmic37 if you undef $/ in a local context to a block it won't affect the global version after the block finishes
[Lotus1]: or you can just do local $/ in a block
[erix]: cool

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-06-29 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (673 votes). Check out past polls.