Case-sensitivity: why -- or why not? (was Re: Damnation!)

Nick Mathewson nickm at mit.edu
Sun May 21 02:02:02 EDT 2000


On Sun, 21 May 2000 02:01:37 GMT, Guido van Rossum <guido at python.org> wrote:
 [...]
>(2) I've met many people who are experienced and accomplished Python
>programmers but who still, when referring to Python modules or
>functions in an informal context (e.g. email), make up their own case
>conventions.  E.g. people will write me about the String module or
>about FTPLib.

IMO this is simply the fact that, in English text, we want to
capitalize proper nouns and acronyms.

>I also know some of the things I plan to do to make the transition
>painless and to make the usual problems with case insensitivity more
>palatable.  E.g. I may add a case insensitivity feature to IDLE which
>makes sure that all identifiers are written in a consistent case, I
>may add flags to pre-Py3k Python interpreters to turn on case
>insensitivity or case sensitivity or a special warning mode.

Why not just provide the tools, and leave the core language alone?  In
other words, have IDLE autocorrect miscapitalization, and have the
interpreter issue warnings, but keep the current case sensitivity.
That way, people who know how to program Python already don't have to
revise all their programs, and people who have problems learning to be
case-sensitive don't have to.

Or how about this Modest Proposal <wink>: 

  * If the Python executable is invoked as 'Python', 'PYTHON', or
    'pYTHon', then it interprets Python as a case-insensitive language.  
     The function 'string.join' may be called as 'String.Join'.

  * If the executable is called as 'py-thon' or 'python_", then all dashes
    and underscores in identifiers are silently removed.  The function
    'string.join' may be called as 'str_ing-join'.

  * If the executable is invoked as 'pythonne' or 'piethon', then the
    interpreter matches identifiers phoneticly, for users who can't spell.
    The function 'string.join' may be called as 'sdrink.djoyn'.
 
  * If the executable is invoked as 'snake', then we use a thesaurus to
    match synonyms.  'Spam', 'excessive_crossposting', and
    'mysteryMeat' are all the same identifier.  The function 'string.join' 
    may be called as 'twine.unite'.

  * If the executable is called as 'piton' or 'diePythonschlange', then we
    translate international identifiers into English.   In other words,
    "Dog", "Chien", and "Perro" are all the same variable.  The function
    'string.join' may be invoked as 'cuerda.juntar'. 

  * And, of course, if you invoke 'python', then we keep the same 
    do-what-I-say, case-sensitive semantics we have today.

The-scary-thing-is-that-most-of-these-
        wouldn't-be-too-hard-to-implement-ly y'rs,

-- 
Nick Mathewson     <nickm at mit.edu>     http://www.mit.edu/~nickm/



More information about the Python-list mailing list