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

Andrew Henshaw andrew.henshaw at gtri.gatech.edu
Wed May 24 03:29:50 EDT 2000


Martijn Faassen wrote:
>Andrew Henshaw <andrew.henshaw at gtri.gatech.edu> wrote:
>> Ben Cornett  wrote:
>>>
>>>this IS An exAmple oF WHat I meaNt WHEn I SAid "vOtIng DoesN'T HElP".
>>>
>> ...snip...
>> The interesting thing about this is that I could read it.  A case-insensitive
>> compiler couldn't handle a single case flip.  That's why I don't understand
>> the argument that (English-speaking) humans are case sensitive.  In general
>> we're not.  We prefer that everyone follow case-usage rules, but we don't
>> require it.  In my opinion, that's the way programming should work.  I would
>> like to read a program that followed case usage for readability; but, I
>> don't want an interpreter to barf when case is ignored.  
>
>if 1:
>    print "This is "
>   print "incorrectly indented"
>     print "code"
>
>Now let's paraphrase:
>
>"The interesting this about this is that I could read it. A indentation
>based compiler couldn't handle a single indentation misalignment. That's why
>I don't understand the argument that humans are indentation sensitive. In
>general we're not. We prefer that everyone follow indentation-usage rules,
>but we don't require it. In my opinion, that's the way programming should work.
>I would like to read a program that followed indentation usage for readability;
>but, I do'nt want an interpreter to barf when indentation is ignored."
>
>Do you, or do you not, think about Python's indentation system this way?
>
You've (basically) made this argument in other threads, but I'm glad it showed
up here so that I could address it in this same context.

Python's indentation rules provide for instruction grouping.  There **must**
be some mechanism to indicate grouping, and indentation fills that need in
Python.   If indentation is not used, then block tokens are commonly used.  
These are both acceptable solutions to the problem.  Your argument
seems to be incomplete in that you haven't provided a replacement solution to
the grouping problem.  Given this argument, one must ask "Indentation
provides a reasonable solution to a difficult compilation problem, what
difficult compilation problem is solved by case sensitivity?"

Perhaps your solution to instruction grouping is recognition of grouping by
context.  If your carefully chosen example was representative of most code
then I would, perhaps, agree with you.  However, if your code stopped with the
second print statement, or was not an artifically-separated sentence, then I
would say that the flow of control was ambiguous.

Andrew Henshaw



More information about the Python-list mailing list