Case insensitivity

Pekka Pessi Pekka.Pessi at nokia.com
Sat Jul 21 20:52:10 CEST 2001


In message <cpvgkofyru.fsf at cj20424-a.reston1.va.home.com> Guido van Rossum <guido at python.org> writes:
>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. 

        Most non-programmers like to use identifiers in their native
        language.  Some people are happy with US-ASCII (like, Swahili,
        and perhaps Dutch), most Europeans are content with ISO Latin 1,
        but the vast majority would like to use Unicode.  Currently
        Python supports ISO Latin 1, but I think that Unicode is the
        future.  In my opinion, supporting Unicode is more valuable for
        more people than case-insensitivity.

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

        I have some experience of teching programming with AmigaBASIC by
        Microsoft, which was both case-insensitive and had ISO-Latin-1
        identifiers.  So, one could write program like this:

äiti=32:isä=35
lapsi1=isä/7
lapsi2=äiti/4
LAPSI3=ABS(lapsi1-LAPSI2)+LAPSI2+ABS(ISÄ-ÄITI)
PRINT lapsi3

        However, this would not work. The Microsoft programmers were not
        clever enough to extend case-insensitivity to ISO-Latin-1
        characters: LAPSI2 is same as lapsi2, LAPSI1 is same as lapsi1 -
        but ISÄ is not the same thing as isä, nor ÄITI same as äiti.
        Now *this* is nasty surprise.

        *Broken* case-insensitivity is not a minor wart.  Calling it
        hindrance would be an understatement.  It is a major pain.

        However, implementing the case-insensitivity properly is a real
        hurdle.  With Latin1, one may argue that it is doable, but
        actually you would have to known the language in which the
        identifiers are written (because casing rules vary from language
        to language). Doing that with Unicode is next to impossible.
        Really.
        
>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.

        If you plan to do it *properly*, go for it.  Otherwise, forget
        it.

>Another: put the case-insensitivity in the tools.

        That would be easier, and much more valuable (the tools could
        fix typos and propose similar sounding indentifiers, as well).

                                        Pekka



More information about the Python-list mailing list