case-sensitivity

Ron Adam radam2 at tampabay.rr.com
Wed Nov 12 20:32:51 EST 2003


On Wed, 12 Nov 2003 23:49:57 GMT, "Rainer Deyke" <rainerd at eldwood.com>
wrote:

>Ron Adam wrote:
>> The only reason to use case
>> sensitivity is as a way to differentiate names.
>
>No.  The only reason to use case sensitivity is to let the programmer
>recognize names immediately without mentally translating them into a common
>case.  A language which allows 'sWord' as an alias for 'Sword' is
>unnecessarily difficult to read.
>
>Differentiating names is an undesired side effect of case sensitivity.
>
>
>-- 
>Rainer Deyke - rainerd at eldwood.com - http://eldwood.com
>


Once side of this is from the programmers point of view and the other
is from the machine interpreter point of view.  

>From the interpreters view,  case sensitivity is used to differentiate
names in name space.  

 From the programmers view,  it helps us to recognize names.

I don't believe they are mutually exclusive.   You can still have caps
and identifiable variables without requiring case sensitivity.   

A smart editor can implement case insensitivity without changing
Python.  This isn't true case insensitive but it has the same effect
from a programmers point of view.  It would need to correct case at
some point to do it.  So call it case correcting instead of case
insensitive.


Which would you choose from the following?

As I type in a program:

1:   I get an error for using the wrong case at compile time.  Then
have to find the problem and correct it. Then try to recompile.

2:  I'm very careful to make sure and look up all the proper names
which takes quite a bit of additional time.  The program compiles and
runs normally if I didn't have any typos.  If I did,  then the result
is the same as #1.

3.  The editor doesn't do anything special and the compiler ignores
case differences and it compiles and runs normally.  I only have to
remember the correct spellings.  I can use any editor I choose or have
available with the same result.

4:  The editor or IDE matches what I enter to the names and then
substitutes the proper case of the name at some definitive point.
This ensures that the case is correct and the program compiles and
runs normally.   If I choose a different editor then see #1 or #2.

5.  The editor or IDE matches corrects the case as in #4, and the
compiler which is case insensitive compiles and runs normally.  I can
choose any editor.  If it doesn't support case correcting then see #3.



My preferences would be in order:

#5,  #3,  #4,  #1,  #2

Numbers 1 and 2 are really the same, but #1 is what I'm most likely to
do.  Numbers 5 and 3 are basically the same,  but #5 uses case
correcting while editing.   Number 4 is possible to do now, but I
don't know of any editors that currently do it.  It would be a nice
option to include in one I think.

_Ron Adam






More information about the Python-list mailing list