Case insensitivity

Dinu Gherman dinu at reportlab.com
Fri Jul 20 07:11:34 EDT 2001


I feel like this discussion has always suffered a bit from
showing a certain kind of vagueness. I'm trying to point
my finger below at what I mean.

On Thu, 19 Jul 2001 20:30:15 GMT, Guido van Rossum <guido at python.org>
wrote:

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

Who is pro insensitivity and for what reasons? The only one 
I know of is Randy Pausch, and while being a big fan of Alice 
and his work I wonder how many of his students have picked up 
Python for doing something *after* their modelling classes with 
Alice? Apart from Randy's, what other experience in a scienti-
fic setting do we have to suggest insensitivity?

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

Personally I think, case-insensitivity might be good for be-
ginners and case-sensitivity is good for more regular pro-
grammers, simply because of more readability and expressive-
ness added to the code by using camel-case etc. 

I claim that this, in fact, helps building better software 
models of the world, because we don't reduce the programmer's
symbol space to 26 characters, but also leave room for making 
a distinction between verbs, nouns as well as for conventions 
like instances with small letters and classes with big ones.
Using underscores or whatever to achive the same effect will
Python look more Perlish, say, in any case more of a pro-
gramming language and less of a natural pseudo-code language.

In that sense I've never understood why reducing this kind
of natural richness in expression can be good? I bet it 
could also be actively used while teaching beginners, pro-
vided the libraries did follow some consistent model, which
most often they don't, as you can tell from looking at the
Python standard library.

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

Well, first it would be interesting to know more about this 
rationale. Then, if possible, that would be interesting, as 
it might offer something for beginners and pros, but the 
issues remain about using legacy code with an insensitive 
Python interpreter.

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

Certainly not computational power, but see my argument above 
about reducing its power to express one's thoughts and the 
world's concepts (objects, actions, messages, etc.) as well 
as the mapping ti natural language.

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

Do you have examples of such good programming environments?
Or what they could work like?

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

Which ones? inst_c = class_c()? Looks like the hotly debated
hungarian notation to me...

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

Well, what tools do we have that allow for such a feature?
Which of them are available for Python and which for other
languages?

Finally, as Art has also mentioned, we should probably 
make an effort and try to explain what problem it is
that case-insensitivity is trying to solve? Teaching
Python to beginners more effectively is a noble reason,
but from all the controversy around that topic it seems
like not clear at all if this can or should be the only
reason to change the language and the millions of lines
of code. After all, from sneaking into the EDU-SIG mail-
ing list it doesn't even seem like they would agree that
case-insensitivity would help a great deal in pushing 
Python at schools. There, it is more about education 
politics, not about programming symbols that would make 
a difference...

Dinu

 
-- 
Dinu C. Gherman
dinu at reportlab dot com
http://www.reportlab.com
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or 
not. Otherwise you don't enjoy your work, you don't work well, 
and the project goes down the drain." 
                    (Kent Beck, "Extreme Programming Explained")



More information about the Python-list mailing list