Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: Ampersands and sub speed

by creamygoodness (Curate)
on Oct 14, 2005 at 21:55 UTC ( #500383=note: print w/replies, xml ) Need Help??

in reply to Re: Ampersands and sub speed
in thread Ampersands and sub speed

Yes, you'd have to comment every place you use it -- because this is one of those subtleties you couldn't assume a maintenance programmer would grasp.
Marvin Humphrey
Rectangular Research ―

Replies are listed 'Best First'.
Re^3: Ampersands and sub speed
by Anonymous Monk on Oct 14, 2005 at 22:17 UTC
    why wouldn't you assume he'd know basic perl?
      We can't all be geniuses like you, Anonymous.

      Mainly because it's *not* basic Perl. It's a subtle effect that isn't obvious. If the OP included the ampersands without commenting, it would be reasonable for a maintainer to remove them, not knowing the effect they have on speed. And as you are fond of pointing out, not everyone who programs is a good programmer, right?

        It's a subtle effect that isn't obvious.
        well, it's documented in the beginning of perlsub.pod. i want to program assuming my co-workers/successors have at least read the common perldoc-pages. i don't want to comment things that are already documented in the documentation for perl itself.
        what i *would* docunment in a case like this is *why* i do this. so instead of saying
            &foo; # give current @_ to foo.
        i'd say
            &foo; # foo needs @_ because ...
        then any programmer stumbling over this code would know why or have to read perlsub.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://500383]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-03-19 19:22 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.