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

Peter Hansen peter at engcorp.com
Tue May 7 01:25:44 EDT 2002


Terry Hancock wrote:
> 
> Mark McEahern wrote:

Actually Terry, that was I, not Mark...

[snip]
> > Punctuation itself also inherently lowers
> > readability, I believe, which is a reason I find
> > assembly easier to read than Perl, though clearly
> > less productive.

[snip punctuation-less paragraph]
> Seriously, though I think that punctuation aides readability.

Well, I was definitely too concise (a rarity, believe me!).  
I really meant, as you point out, that more than "just enough" 
punctuation affects readability.  As !(you) might.find if/you 
re-wrote!! your $%previous @example-->more in the+style of 
**Perl...%%%. ;-)

> The real issue with Perl is probably the degree to which
> punctuation characters are not used *as* punctuation, but
> rather as *words* in their own right.  
>[....]
> Another useful criterion (probably a bigger deal for more
> auditory-oriented folks) is "can you pronounce it?".

Yes!  It's perhaps a little known fact that most people 
read "verbally", by pronouncing the words in their heads
at least in an accelerated fashion.  If you can't hear
the words, you get that "then we compare _hmm_ with _hmm_ 
and then _hmm_ _hmm_ _hmm_ ..."  that you described.
Excellent point.

> where each "_hmm_" is me losing my verbal focus, and
> substituting some unpronounceable concept. Since it's
> not associated with a word, it's harder to keep track
> of in your head, so it's probably easier to forget
> what you're doing.  

I nominate your insight and "losing verbal focus" for
some part of Quote of the Week.

Strange: readability is actually about hearing... :)

-Peter



More information about the Python-list mailing list