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

Re^2: What is code readability?

by Moron (Curate)
on Apr 17, 2007 at 18:03 UTC ( [id://610604]=note: print w/replies, xml ) Need Help??


in reply to Re: What is code readability?
in thread What is code readability?

I don't see your sentiment (which I agreed with) reflected in your modifications to the example. To my mind, breaking it into understandable functions would end up more like:
# with this level of modularity almost anything is readable! sub determine_maximum_fee { # # functional description goes here # $fee = Roundup( Sum( @_ ) ); $fee < 100 ? $fee : 200; # all 100+ fees become 200 } sub Roundup { # # Increase just barely to avoid any rounding down problem # 100 * ( ($_[0]/100) + 0.0000001 ); } sub Sum { # # needs no description. # my $result=0; $result += shift() || return $result while (1); }
__________________________________________________________________________________

^M Free your mind!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-26 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found