Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Should I leave behind beautiful code or readable code?

by perrin (Chancellor)
on Mar 28, 2007 at 13:37 UTC ( #607022=note: print w/ replies, xml ) Need Help??


in reply to Should I leave behind beautiful code or readable code?

To me, beautiful code is code that is so simple and so clear that it's obviously correct. This code took me too long to understand (realize it has to be read right to left, remember that uc defaults to $_, mentally pass the array from one map to the other...). I'd change it.


Comment on Re: Should I leave behind beautiful code or readable code?
Re^2: Should I leave behind beautiful code or readable code?
by punch_card_don (Curate) on Mar 28, 2007 at 21:33 UTC
    I agree with what I believe is the spirit of this post.

    Even if I'm not an expert in a language, the code should be written clearly enough that when it says

    $x = function($a, $b);
    a reasonably intelligent person can correctly understand that 'function' is acting on $a and $b to produce result $x, for example. Then go find out what 'function' does.

    If a reasonably intelligent person can't even get that from the code without knowledge of all sorts of arcane idiosyncracies of the language, then we mustn't be surprised when IT managers reject Perl with that tired old refrain about it being unreadable

    Perl's 'beauty' may just be it's own downfall.




    Forget that fear of gravity,
    Get a little savagery in your life.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-07-23 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (131 votes), past polls