Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re (tilly) 3: Efficiency in maintenance coding...

by perrin (Chancellor)
on Nov 15, 2001 at 14:56 UTC ( [id://125591]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re (tilly) 3: Efficiency in maintenance coding...
in thread Efficiency in maintenance coding...

This is difficult subject to discuss without histrionics. I mentioned on the CB one day that I try to avoid the use of $_ because I think it makes code harder to read, and it was not a very popular notion.

Most of the advanced people on this site would certainly prefer eduardo's version, but my experience has been that many of the people I have to work with every day just don't know Perl well enough to quickly grok stuff like $frequency{$_}++ for (split /\W/, <>) quickly. Because of this, I try to stick to the more standard control structures when I can, and especially avoid stacking up a lot of operations on one line.

I still use things like map, grep, hash slices, and extended regular expressions, but not when something simpler will work with similar efficiency.

Replies are listed 'Best First'.
(jeffa) 6: Efficiency in maintenance coding...
by jeffa (Bishop) on Nov 15, 2001 at 17:04 UTC
    I try to avoid the use of $_ because I think it makes code harder to read ...

    Well, i suppose you are likewise going to start removing 'it' from your vocabulary. ;)

    But i agree that $_ can be abused.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    F--F--F--F--F--F--F--F--
    (the triplet paradiddle)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://125591]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.