Case insensitivity

François Pinard pinard at iro.umontreal.ca
Sat Jul 21 00:09:22 CEST 2001


[Guido van Rossum]

> TeachScheme is an interesting case -- Scheme is a case-sensitive
> language, but in "beginner mode", TeachScheme is case-insensitive.  I

Did it change recently?  I thought Scheme was case-insensitive.  An idiom I
saw a few times in Scheme code, written by other people, is writing `lambda'
or `cdr' when you mean what it means, and `LAMBDA' and `CDR' when you are
quoting the same, for example when you write code which produces code.

But DSSSL, which introduces a flavour of Scheme, is case-sensitive.  (Please
someone correct me if I'm wrong.)  That is an improvement.

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

There are also people who like spelling correctly, and others who do not
care.  The later kind might ask that Python be forgiving about dyslexic
errors on Python keywords or variables names, and might even argue that
this would tremendously help beginners.

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

Yes, quite agreed.  It is the job of the editing environment to take care
of dyslexic errors, case discrepancies, or case clashes.  Python in itself,
as a language, does not really have to be modified to take care of such
things.  Beginners, or children, should merely use a suitable environment:
I do not understand the purpose of modifying the language itself for them.
What or where is the gain?

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

(I presume you meant "case-insensitivity" on the second line of the above
paragraph).

Would not it be convenient, before asking "how", to wonder "why"?  The real
prerequisite question might be to define quite precisely "What are we
wanting to achieve, here?".  Once this done, another question might be to
ask ourselves?  "Is modifying the language the proper answer to about how
to reach the goals?", meaning the goals identified by the first question.

I worry a bit that you state that the real important question is "how",
as if you were trying to escape the prerequisite questions, or maybe trying
to tell us that your mind got firm answers about them.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list