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

Christopher Browne cbbrowne at acm.org
Tue May 7 10:10:06 EDT 2002


The world rejoiced as "Steve Holden" <sholden at holdenweb.com> wrote:
> "Terry Hancock" <hancock at anansispaceworks.com> wrote ...
>> Seriously, though I think that punctuation aides readability.
>>
> Of, ((course- $if %there[''s"] (((too *much@) of!) #it), +it, {can; {get}}
> [in]- +the ~way~ `as`) \well).
>
> [...]
> a-place-for-everything-and-everything-in-its-place-ly y'rs  - steve

I rather like the thesis of "verbal" versus "visual."

Punctuation in traditional "human language" is all about providing a
bit of a visual cue indicating different bits of emphasis.  A comma
indicates a little pause; a semicolon, a bit more of a pause; period
offers a sort of "final pause."  The sounds you make with a "!" differ
from those made with "?".

The approach of sticking punctuation _everywhere_ definitely isn't in
keeping with the "human language" approach to things.  It indicates
that the pronunciation of the text has to be carefully managed at
practically every word.   We don't write text in "phonetic English,"
nor do we accent every word.  (That's left to the French :-).)

The notion that "being easily audibly readable" would be strongly
correlated with code being considered "most readable" makes a lot of
sense.  

Note that that indicates that Hungarian notation is Truly Evil (we
already all knew that! :-)), just as would be the idea of pLaYing
gaMES with sTUDly CapiTALIZation.

And this points back to Leo Brodie's _Thinking Forth_, where the
crucial concept is that coming up with good _names_ for functions is
the most important thing...
-- 
(concatenate 'string "cbbrowne" "@cbbrowne.com")
http://www.cbbrowne.com/info/multiplexor.html
I was just  wondering if the Chinese are busy trying  to deal with the
"Year Of The Dragon" bug.



More information about the Python-list mailing list