Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: What is clear code ?

by clintp (Curate)
on Apr 29, 2002 at 02:25 UTC ( #162746=note: print w/ replies, xml ) Need Help??


in reply to What is clear code ?

Don't feel bad. Strictly on readability, I actually like yours better. Not necessarily because of the "number of concepts."

For me it's simply because it can be read top-down (instead of bottom-up). I despise having to visually scan down several lines for the semicolon, and scan back up to see what's being done. With all of the comments, yours is far more readable to me. Remove the comments, and his becomes much better. One grouping, one explanation.

Ovid's would be re-written as:

sub Readable_Ovid_Clear_MakePtag{ my $fixme = shift; # make newline-breaks into HTML paragraphs return join "\r\n", map { "<p>$_</p>" } grep { /\S/ } split "\r\n", $fixme; }


Comment on Re: What is clear code ?
Download Code
Re: Re: What is clear code ?
by Fletch (Chancellor) on Apr 29, 2002 at 14:06 UTC

    If you've done any Lisp (or other functional style programming) you kinda get used to parsing things inside out. You almost could wrap parens around Ovid's version and . . . :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-09-19 08:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (133 votes), past polls