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

Peter pcc at ecet.vtc.edu
Tue May 7 23:16:08 EDT 2002


In article <m3pu0859s1.fsf at chvatal.cbbrowne.com>, cbbrowne at acm.org 
says...

> 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...

As someone who teaches programming, I've observed that the students who 
have a good grasp on what they are doing tend to choose appropriate 
names for things while the students who are clueless tend to use names 
like "x", "y", "y2", and so forth. The usual conclusion is that the 
student who chooses poor names does so because he/she doesn't understand 
what the program is doing and thus can't think of anything better. Yet I 
would turn that around and say that if the student worked on coming up 
with good names it would help clarify the program for him/her. I tell my 
students this, of course, but it doesn't always help.

In any case, I'd love to teach a class using Python. I like Python's 
elegant regularity. I really like the way it forces the programmer to 
indent properly (I can't tell you how many rants I've given my students 
about indentation). Alas, right now we give our students Perl because 
Perl is seen as a language they are more likely to encounter. Python is 
currently considered "exotic" in my department... something only a 
quirky person like me could get into.

I will say that the students love Perl... but that's probably because 
their prior programming experience is all C and C++. :-)

Peter




More information about the Python-list mailing list