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

Mats Wichmann mats at laplaza.nospam.org
Thu May 9 23:03:42 EDT 2002


:> > "What makes code readable?"
:> >

:> >
:> > Punctuation itself also inherently lowers
:> > readability, I believe, which is a reason I find
:> > assembly easier to read than Perl, though clearly
:> > less productive.
:>
:
:>
:> 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).


In reading written text (not code), punctuation is used as a flow
control device and is very important.  Too much or too little
punctuation will make text cumbersome to read.  Sentences that are
just after or just before whitespace also assume more importance.

A lot of this is because humans are better image processors than word
processors, and recognize patterns (what a word looks like) more than
what the individual letters are.  This is why SHOUTING IN EMAIL is so
irritating :-) - you have a harder time recognizing the words.

Whether this applies to code readability I don't know. I think that in
any language there are enough non-letter characters that it's going to
break up the kind of reading flow that you get with text.  So I have
little clue as to what *would* make a programming language more
readable, except that *I* find Python is more readable than Perl.  End
of claims.


Mats Wichmann




More information about the Python-list mailing list