Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

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


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 22: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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-25 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found