Case insensitivity

Guido van Rossum guido at python.org
Thu Jul 19 16:30:15 EDT 2001


"Arthur Siegel" <ajs at ix.netcom.com> writes:

> Many of us feel, I believe, that case insensitivity is such
> an affection.  Guido seems to be saying that he views it
> otherwise - that it is case sensitivity that is an affect.

I apologize for my poor English -- I don't know what you mean by "an
affection" or "an affect".  Consulting a dictionary didn't help, but
I'm guessing that you mean something that gets in your way when
programming.

> Which to me is the beginning of a real discussion.

Fair enough.  So let's begin the real discussion.

> Not meaning to be nasty at all, but these issues have 
> been on the table for quite some time - and I do think
> it a tactical error to try to trump deeper discussion 
> by pointing to selective anecdotal reports  from
> near random sources, taken out of any meaningful 
> context,  that happen to support a predilection.

Here we go again -- I had to use a dictionary to find out what
"predilection" means (it's a "preference").

Anyway, I wasn't trying to do anything of the sort -- I was indicating
I have a right to be torn over this issue, since strong arguments can
be made for both cases.

Several people whom I respect have strongly suggested that if Python
wants to appeal to non-programmers, it should be case-insensitive.
(Leaving apart details of how to implement that; I agree that it
should be case-preserving.)  Others, whome I respect just as much,
feel that it should be case-sensitive.

Unfortunately there isn't a lot of scientific evidence to help decide
this.  There may be old reports that case-sensitivity hurts beginners.
I know that many other designers of programming languages aimed at
non-programmers have consciously choses case-insensitivity
(e.g. hypertalk, REXX).

TeachScheme is an interesting case -- Scheme is a case-sensitive
language, but in "beginner mode", TeachScheme is case-insensitive.  I
can't find it on the web, but I bet the TeachScheme folks have a
rationale for this decision.

My own intuition and experience tells me that there seem to be two
kinds of people: some folks think case-sensitively, others think
case-insensitively.  Myself, I am a case-sensitive person, but I can
easily learn to work with case-insensitive systems.  It's possible
that most programmers have case-sensitive minds, but I think that most
non-programmers probably have case-insensitive minds.  And
non-programmers are quite the majority.  *If* there is any hard
scientific evidence that case-sensitivity is a hindrance to learning
to program (for most people), that would confirm my hunch.

It has been argued that making Python case-insensitive would be
"dumbing it down".  I find this a strange argument.  It doesn't take
any power away (as long as there's a way to link to external systems
that require case-sensitivity).  I see it as lowering the bar --
what's wrong with that?  (If you really feel that being a programmer
makes you part of an elite and you want to keep others out of that
elite, I pity you.)

It has been argued that case-sensitivity is a minor wart that's easily
explained.  I find that a weak argument.  Lots of minor problems can
be explained and gotten used to, but that doesn't mean we shouldn't
try to get rid of them if we can.  Historically, this argument has
been used as an excuse for poor compilers or linkers.

It's been argued that making string, String, STRING and StRiNg mean
the same thing makes for less readable programs.  I agree.  A good
programming environment should silently correct the case of
identifiers as you type to conform to the definition.  This also means
that you can still use different case conventions to hint about what
type of identifier it is, e.g. MACRO, Class, variable.

It's been argued that it's convenient to be able to write c = C(),
where C is a class and c is an instance of that class.  Surely there
are other conventions we can use.

To me, the only real important question is, how can we introduce
case-sensitivity for novices without breaking the millions of lines of
existing Python code.  One option could be: forget it, it's too late.
Another: put the case-insensitivity in the tools.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list