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

William Tanksley wtanksle at dolphin.openprojects.net
Sun Jun 4 18:29:08 EDT 2000


On Sun, 4 Jun 2000 00:49 +0100 (BST), Tim Rowe wrote:
>wtanksle at dolphin.openprojects.net (William Tanksley) wrote:

>> This is a classical example of false dichotomy ;-).  I liked Python's
>> indentation not because it enforced consistency, but rather because it
>> makes code look good.  

>But, of course, the programmer could make C look just as good by applying 
>consistent layout.

Good for C!  In fact, I do just that the majority of time at work.

>The nice thing about Python is that the programmer /will/ apply (locally)
>consistent layout.

That *is* one nice thing about Python.  However, it's only trivially nice;
were it to go away Python would still be a good language (imagine, for
example, that Guido invented a parser which could *tell* when a programmer
was using inconsistent spaces per tab and parse correctly in spite of
that).  It's *much* nicer that Python draws the program tree in two
dimensions than that it forces the programmer to be consistent about it.

>> In fact, it could be argued that Python does _not_ enforce consistency;
>> the programmer is free to choose any indentation for each block, so long
>> as each block can be parsed (which does require internal consistency).

>And, of course, one is free to choose any legal identifier, so the case 
>sensitivity doesn't enforce consistency either.

*Exactly*.  You can also choose program structures which make little sense
for your problem area (using 'try' where it doesn't belong), thus ruining
the pretty indentation, or choose two different abbreviations for the same
word as variable names (thus ruining your case-sensitive consistency).

>> So I don't really care about languages enforcing consistency; if I need
>> it, I'll enforce it myself.

>Great. Ever maintain anybody else's code?

Are you trying to insult me?  Or are you trying to make some kind of
point?  If the latter, you have no idea what my experience level is, so to
communicate your argument you'll have to explain yourself more completely.

*My* point is that Python's job is to make it possible to write really
good-looking code.  It's my job, as the programmer or employer, to prevent
bad-looking code.

>> Take a lesson from the people complaining about Python's indentation: one
>> of the leading false accusations is that it's inflexible, that it won't
>> allow people to choose thier own indentation.

>Lesson taken. I won't give any credence to those who complain about case 
>sensitivity on the same grounds.

But this mythical person complaining about case-sensitivity is *correct*;
Python truly *is* case-sensitive.

-- 
-William "Billy" Tanksley



More information about the Python-list mailing list