Language change and code breaks

James Logajan JamesL at Lugoj.Com
Fri Jul 20 13:01:34 EDT 2001


Guido van Rossum wrote:
> If you use this
> a lot (message = Message() etc.) your code is less readable than it
> should be.

Um, you've got that precisely reversed! If I see "message" anywhere in my
code, I know immediately that it is an instance of the class Message. Think
of it as an advanced form of Hungarian notation that tells you what type of
thing the variable is holding. (Although I'm no fan of Hungarian per se.)

I've gone through several identifier naming conventions over the last couple
of decades and I've settled on the one you think is "less" readable.
Fortunately, most of the programmers I've worked with not only don't have a
problem with it, most use it. A few, like you, think there is something
wrong with it, but none has ever had a problem with reading code that
contains that kind of thing. Some of those latter even do it when they are
"in a hurry" and then apologise for doing it!

Like you, I always "thought" that convention was bad. But having had to use
it a lot, I've grown to enjoy it and unless you can show me more than your
opinion, you can expect a nasty disagreement.

> It also makes it harder to discuss code in person or over
> the phone -- spoken language is not case-preserving, as anyone who has
> tried to give someone a URL over the phone knows. :-)

How about discussing indented code blocks? Spoken language is not
white-space preserving. It is not new-line preserving. It isn't a lot of
things. So what precisely does discussing code on the phone have to do with
this issue!?



More information about the Python-list mailing list