Case-sensitivity: why -- or why not? (was Re: Damnation!)

Martijn Faassen m.faassen at vet.uu.nl
Mon May 22 05:45:18 EDT 2000


Guido van Rossum <guido at python.org> wrote:
[snip]
> Yet, here are some of the reasons why I am considering making Python
> case-insensitive:

> (1) Randy Pausch, a professor at CMU, found, when teaching Python to
> non-CS students in the context of Alice (www.alice.org), that the
> number one problem his students were having was to remember that case
> matters in Python.  (The number two problem was 1/2 == 0; there was no
> significalt number three problem.)

Minor data point: I haven't had any trouble explaining case-sensitivity
to the bunch of people I've been teaching Python so far. That's about
10 people, most of them fairly computer-savvy, though some aren't. I don't
know enough about Alice, but I recall the setting was people using Alice
primarily for the 3d capabilities, and being gradually introduced to Python
as something secondary to extend Alice's possibilities. Am I correct in that
there wasn't a teacher introducing it? Was it discovered through exploration?

If there's a teacher around it really isn't so hard to explain or remember
the case-sensitive part, is it? So far I haven't found it to be an issue,
at least. Computers are picky anyway. I've had more trouble with explaining
the indentation, and the whole *concept* of block structure. The syntax issue
is something minor in the whole picture of learning something. I recall
learning the weird greek alphabet was the easiest part about learning 
ancient Greek.

This is not to say that syntax doesn't matter; it does -- especially the
way it relates to the underlying semantics. Compare alphabetic versus
iconic writing systems, for instance.

> (2) I've met many people who are experienced and accomplished Python
> programmers but who still, when referring to Python modules or
> functions in an informal context (e.g. email), make up their own case
> conventions.  E.g. people will write me about the String module or
> about FTPLib.

This sounds a bit much like DWIM, though. I'm sure these same people
also get their braces or indentation wrong at some points. Perhaps they
get tripped up by single element tuples. The whole idea of a syntax
check is to make sure that the code conforms to some basic surface rules.
If it doesn't, it's likely to be unclear to the reader, too.

Many of the arguments for block structure by indentation can be made
for case insensitivity: a good programmer is supposed to indent/
case-consistent *anyway*, so why not let the environment enforce it?

> I also know some of the things I plan to do to make the transition
> painless and to make the usual problems with case insensitivity more
> palatable.  E.g. I may add a case insensitivity feature to IDLE which
> makes sure that all identifiers are written in a consistent case, I
> may add flags to pre-Py3k Python interpreters to turn on case
> insensitivity or case sensitivity or a special warning mode.

You'll have trouble getting the current coders get rid of all the:

foo = Foo()

Where Foo is a class. This should be quite common (as it's a useful
idiom).

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list