Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Non-destructive array processing

by demerphq (Chancellor)
on Jan 21, 2003 at 13:23 UTC ( #228671=note: print w/ replies, xml ) Need Help??


in reply to Re: Non-destructive array processing
in thread Non-destructive array processing

Im so glad I read the other replys before posting mine. This is exactly what I would have posted.

The cleverness in both those examples from Juerd is ok for personal and even module code for CPAN, but IMO generally unusable within a work/production context. First off they dont really look like they do what they do, second they are confusing and error prone. Wheras yours looks exactly like what it does. No maintenance programmer is going to get confused years after ive left the company.

++

--- demerphq
my friends call me, usually because I'm late....


Comment on Re: Re: Non-destructive array processing
Re: Re: Re: Non-destructive array processing
by pdcawley (Hermit) on Jan 21, 2003 at 13:42 UTC
    No maintenance programmer is going to get confused years after I've left the company.
    Now there's a motto to live by.
Re: Re: Re: Non-destructive array processing
by Juerd (Abbot) on Jan 21, 2003 at 19:27 UTC

    unusable within a work/production context

    I wouldn't handle large data sets in production code. This is primarily for one-time hacks, but I wondered what other people would prefer.

    No maintenance programmer is going to get confused years after ive left the company.

    Note that if code like this ever goes into production, I do of course add proper comments, including a note that you shouldn't use @$r elsewhere (re your other post).

    Juerd
    - http://juerd.nl/
    - spamcollector_perlmonks@juerd.nl (do not use).
    

      I do of course add proper comments

      I think the point is that its better not to have to comment at all. If the code looks like it does what it does then you dont need a comment. Plus comments get out of date sometimes and then cause confusion. I realize that a well chosen comment can be extremely useful, but I think you know what I mean.

      *shrug* Its a nice trick though for some things. :-) Although Ive usually used it as named routine.

      sub aliased_array { \@_ }

      --- demerphq
      my friends call me, usually because I'm late....

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-12-22 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (112 votes), past polls