Yet Another Case Question

David Mertz, Ph.D. mertz at gnosis.cx
Sat Feb 22 21:39:09 EST 2003


I am aware that this topic is fairly idle--Python most certainly will
not become case-insensitive, and not even those of us who are fond of
case-insensitivity in the abstract want such to happen.  But I think
there might still be something to learn here.

>From several posts (including mine), it seems clear that there are at
least two extremes among people who write programs.  Some of us are
strongly verbally/phonetically oriented.  I tend to imagine keywords,
variables, etc. as "word images", i.e. as if a voice in my head were
speaking them.  Other folks are much more visually/eidetically oriented.
A keyword of variable is a mark with a particular shape, and it is
imagined in a geometric style.  Obviously, most people fall between
these extremes; and lacking some kind of peculiar brain injuries,
probably no one entirely lacks in either capability.

For people like me--near the verbal extreme--case-sensitivity makes
programming noticably more difficult.  I have explained elsewhere the
general process by which I reconstruct, and sometimes stumble, over the
correct case-sensitive spelling of names.  I don't want to overstate
this matter, of course.  Even if I need to spend some extra seconds
because of case issues, I am perfectly well able to write code despite
it.  And in the range of all the little obstacles I, or anyone, faces in
writing a program, this is only one small matter.  Nonetheless, working
around case-sensitivity has a negative effect that I have described,
even if it is a manageable one.

Many of the folks who argue for case-sensitivity perceive the negative
effect as being small or non-existent.  Quite likely, most of them are
towards the visual end of things, and the relative stumbling block of
finding the correct case for a term is less for them than for me.

But in all this latest discussion (and in the prior ones about the same
matter), I do not think I've really seen any explanation of a POSITIVE
benefit to case-sensitivity (as a language feature).  I am quite willing
to believe there are some... but I just don't know what they are.

I'd like to rule out several answers, however.  I think some frequent
remarks are really misleading on this.

 NON-ANSWERS:
 - If a language were case-insensitive, users would use absurdly mixed
   case variables, e.g.  "maXImUMCoLumnS".  This is just factually
   false--many millions of lines of code in existing case-insensitive
   languages fail to show such a problem.
 - Case-sensitivity allows conventions such as allcaps CONSTANTS.  Such
   conventions are indeed good... and are widely used in
   case-insensitive languages as well.
 - Programmers should learn mental discipline by learning to remember
   casing.  There's plenty of learning to go around either way,
   arbitrary games are not any plus.
 - If names were case-insensitive, string literals would have to be so
   too.  With all due respect to my friend Tim Churches, this notion is
   just plain whacked.
 - Case-eating nano-viruses will invade our source code.
 - People naturally learn case as part of spelling.  Overwhelmingly,
   this claim is false; far more ofte in ordinary usage, case varies in
   ways that have nothing to do with the referents of terms.  Almost
   always, case follows other context, or is just randomly varied.  In a
   few borderline situations, case-sensitive names actually are used
   outside of programming languages.

 SEMI-ANSWERS:
 - The convention about instances and classes:  "person = Person()" is
   fairly elegant.  I agree.  But other conventions are possible too
   that would achieve a similar effect.

Yours, David...





More information about the Python-list mailing list