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

Re^2: On the rejected additions to List::Util

by metaperl (Curate)
on Apr 29, 2009 at 16:58 UTC ( [id://760921]=note: print w/replies, xml ) Need Help??


in reply to Re: On the rejected additions to List::Util
in thread On the rejected additions to List::Util

That is not very DWIM. I take engineering software seriously. And aim for readability and conciseness. DWIM supports that greatly.
  • Comment on Re^2: On the rejected additions to List::Util

Replies are listed 'Best First'.
Re^3: On the rejected additions to List::Util
by mr_mischief (Monsignor) on May 01, 2009 at 20:52 UTC
    How do you average numbers when you don't have a computer? I can't think of a more readable and DWIM-my way of writing something than by expressing the very definition of how it'd be done by hand.
Re^3: On the rejected additions to List::Util
by ikegami (Patriarch) on May 06, 2009 at 17:04 UTC

    Kids learn the average is the sum divided by the count at a young age, so it's definitely readable.

    As for conciseness, sum(@list)/@list is really not that far off from avg(@list)

    Nothing is stopping you from putting that expression in a sub if you think it's not readable or concise enough.

Log In?
Username:
Password:

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

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

    No recent polls found