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

Will Rose cwr at crash.cts.com
Sun May 21 12:24:51 EDT 2000


ben at co.and.co wrote:
: [ Lots of things about case-sensitivity and readability already said ]

: I don't know about alice, but I think the quest for case-insensivity is
: masking the problem at hand:

: class Employee:
:     def __init__(self, salary=0):
:         self.Salary = salary
:     def set_salary(self, salary):
:         self.salary = salary

: The problem is: there's no way to check a python program without running
: it, and without variable declarations there's no way to catch errors
: like these. Case-insensitivity is not going to help:
[...]

Yes, to me this is a weakness in Python.  I once got badly bitten (two
days debugging) when a Basic program automatically created a (misspelled)
variable and initialised it;  since then I've been a big fan of
declaration before use.  (Why the misspelling wasn't caught by inspection
is another issue - suffice to say that my default scratch integer
variable is now j not i.  I have finally broken away from Fortran IV
conventions!).

However, I don't use Python as a classic interpreter; I always use an edit,
'compile', run, cycle, so my programs could in principle be statically
analysed.  Python is designed to be used from the interpreter command
prompt, and so a lot of static checking (I don't know how much) isn't
really practical.


Will
cwr at cts.com




More information about the Python-list mailing list