Case sensitivity

Alex Martelli aleax at aleax.it
Tue Feb 25 06:35:19 EST 2003


M.-A. Lemburg wrote:
   ...
> Ok, you have a meta-point there.

Nice that we agree on something:-).


>> A minor wart in a free, useful language is still a wart, and in
>> my opinion it serves no purpose to pretend it isn't, even though
>> it will never be fixed.
> 
> True, but I wouldn't call this "wart" -- some people may feel
> that a certain way of using case in identifiers is the right
> way, while others feel it's wrong. That's a matter of taste,

...and the language's case sensitivity ends up forcing the
highly various tastes of package authors on the users of said
packages, who may have different tastes; indeed, if a user's
module needs names from two modules A and B by disparate
authors (and A and B might well both be in the standard
Python library), then, "thanks" to case sensitivity, the
user's module is forced into using a mishmash of conventions.

Explicit rebindings at the start of the user's module may
at least isolate this specific sub-wart.  There remains the
fact that the user is forced to memorize (or check each time)
which specific conventions each author of each module (e.g in
the standard library, but the problem is far from being
limited to it) has chosen, and how said author has further
chosen to "interpret" that convention (e.g., why is AudioDev
function in module audiodev mixed case, and the module lower
case, while in other modules from the same standard library
the module's name is mixed case, or functions are lower case,
or...?  no rhyme or reason, thus, useless memorization load
gets imposed on the user).

> not one of language deficiency as the term "wart" would hint
> at. Minor point, though.

I do not know of any wart that EVERY user of a language is
convinced IS a wart -- there are always sides pro and con,
because human beings can and do get used to anything and
often get attached to what they've gotten used to.  Thus, we
hear from many people who enthuse about case sensitivity and
will never accept it IS a wart.  However, while most points
in the debate may boil down to matters of taste, some don't.

Having to remember the exact capitalization audiodev.AudioDev
in order to call function AudioDev in module audiodev in the 
standard library IS an extra memory load -- this is a fact.
Raising an exception when one tries spelling audiodev.audiodev
(e.g. to apply the convention that functions are lowercase)
has a small but >0 impact against the user's productivity.

The implementation of name lookup is made simpler and faster
by case-sensitivity -- this is also a fact.

One can quibble on the relative importance of these factors,
and even more about others that are less factual and of a more
subjective nature.  E.g. some claim that case sensitivity makes
it easier to interface to other software; COM users will never
agree to that -- since COM is defined to be case-insensitive,
interfacing to it from case-sensitive languages is LESS easy,
handy, and natural.  The underlying fact is, life is easier if
your conventions regarding case sensitivity are the same as
those of the "other sofware" you want to interface to -- so,
people who routinely interface to C, C++ or Java will see this
one way, others who routinely interface to COM, Fortran or
Delphi (Object Pascal) will see it another.


Alex





More information about the Python-list mailing list