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

Roy Smith roy at panix.com
Tue May 7 07:42:33 EDT 2002


Terry Hancock <hancock at anansispaceworks.com> wrote:
> Seriously, if you can read the code aloud (especially in
> an unambiguous way) this may be very helpful.

Oh, you have no idea how true that is.  In my work, I deal with SNMP mibs a 
lot.  Our standard is to name variables in our code exactly the same as the 
objects from the mibs, to avoid ambiguity.  Depending on the mib, this may 
be good or bad.  Things like "ifStatus" and "sysUpTime" are easy to read, 
but sometimes you get stuck with things like "cpqFcaPhyDrvFWRev", which 
makes Perl line-noise look good by comparison.  It is amazing how much 
difference this makes in readability of code.



More information about the Python-list mailing list