Case sensitivity
Dave Kuhlman
dkuhlman at rexx.com
Fri Feb 21 19:42:21 EST 2003
> Alex Martelli wrote:
>>>Beginners should get used to this style of programming, like they get
>>>used to block idents in Python. That is my opinion.
>>
>>
>> So introduce a beginner to the excellent and very useful
>> module mx.DateTime and explain to him, or her, how and
>> why he or she needs to memorize (or continuosly check or
>> try) that the functions named (e.g.) 'today', 'localtime',
>> or 'add_century' MUST be lowercase, while (e.g.) functions
>> 'TimeFrom' and 'Age' and 'Time' MUST be mixed-case. Pah.
> >
As long as we have Alex wound up, it's a shame to let him sit down so soon.
Let me carry this a bit further. If there is no real value in
distinguishing between 'add_century' and 'Add_century', then perhaps there
is no need to distinguish between 'add_century' and 'addcentury'. And, if
there is no other variable that begins with 'addcen', then the
compiler/interpreter should let me use 'addcen' as a replacement for
'addcentury', and, by extension, for 'add_century'.
I have several comments about that:
1. Teaching this in a beginner's programming class would encourage new
programmers to be careless and lazy. I don't think we want to do that.
2. I believe that a language that allowed me to use these close but not
exact spellings would enable the compiler/interpreter to "trick" me into
making programming errors, for example, referencing the wrong variable or
function.
3. If, during a job interview, I heard a job applicant say something like:
"In the programming language that I'm used to, we don't worry about
spelling variables, functions, and so on correctly; we're not that fussy.",
I believe I'd be concerned about that.
A language that is case-insensitive encourages a similar type of laziness.
I don't want it to do that.
- Dave
--
Dave Kuhlman
dkuhlman at rexx.com
http://www.rexx.com/~dkuhlman
More information about the Python-list
mailing list