What makes code "readable"? (was Re: Python vs. Perl, which is better to learn?)

Robert George Mayer mayer at acm.org
Wed May 8 20:21:50 EDT 2002


Peter Hansen wrote:
> 
> Mark McEahern wrote:
> >
> > [Peter Hansen]
> > > More out of curiosity than an intention of starting a flame war, but
> > > would someone post a snippet of twenty or so lines of Perl which they
> > > believe is "readable"?
> >
> > Does anyone know of research into what the criteria for readability might
> > be?
> 
> That's a good slant on it!  I have no idea ... Google?
> 
> When I was looking at that "readable" Perl code which George
> pointed us to (some comments probably forthcoming from me in
> a reply to his post, but in any event thanks George! :)  I
> started to ponder that question.
> 
> "What makes code readable?"
> 
> (Actually it was "why do I still not find this highly readable?")
> 
> One thing that occurred to me was that the Perl code had a
> very high number of "transitions" between punctuation and text.
> Effectively every line, and sometimes literally a dozen times
> within a line, text and symbols are mixed.  Not just the odd
> parenthesis or period, but great streams of that infamous Perl
> "line noise".
> 
> I think a high "symbol-set-transition rate" (please offer a better
> term) leads to low readability.
> 
> Punctuation itself also inherently lowers readability, I believe,
> which is a reason I find assembly easier to read than Perl, though
> clearly less productive.
> 
> -Peter

I have always found shell and Perl to be difficult to read.  I call
the problem Cartoon-Obscenity Syntax (TM), which involves any
extensive use of keyboard-shift-upper-row (non-numeric) characters.
That is what makes those languages so &!*%# hard to read.

- BOB



More information about the Python-list mailing list