Case confusion, or exception befuddlement? (was Re: Case-sensitivity: why -- or why not? (was Re: Damnation!))

Nick Mathewson nickm at mit.edu
Mon May 22 03:56:44 CEST 2000


On Sun, 21 May 2000 13:28:33 -0700, James Logajan <JamesL at Lugoj.Com> wrote:
 [...]
>1) Did Professor Pausch explicitly explain (and demonstrate) early in the
>course that the language was case-sensistive, or was it implicitly assumed?
>I simply find it hard to believe that case-sensistivity is "hard to
>remember". More likely it was never taught. Or that typing errors accounted
>for most of the problem. Further clarification is needed.

One thing that worries me about the "newbies had problems with case in
Python, so case in Python is hard" argument is this:

  Python 1.5's errors are not really newbie-friendly.  Look what happens 
  when I enter newbie mode, and type:

    >>> x = 3
    >>> print X
    Traceback (innermost last):
      File "<stdin>", line 1, in ?
    NameError: X

  Obviously, this is confusing.  But is the problem in the case-sensitivity,
  or in the error message?  Suppose that instead, a newbie saw:

    Traceback (innermost last):
      File "<stdin>", line 1, in ?
    NameError: No such variable as 'X'.

  Or even better:

    NameError: No such variable as 'X'.  Did you mean 'x' instead?

This is the kind of case-insensativity I'd like to see in Python.  It
doesn't break anybody's programming style, but it teaches newbies to
use Python better.

I-should-hack-up-a-patch-ly y'rs,

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



More information about the Python-list mailing list