Case insensitivity
Matt
canimalatmydejadotcom at nospam.com
Fri Jul 20 14:23:25 EDT 2001
James Logajan <JamesL at Lugoj.Com> wrote in
news:3B5867E8.6B8751F8 at Lugoj.Com:
> Dan Bergan wrote:
>> (Declare the variable in mixed-case)
>> Dim myVariable as Integer
>>
>> (then I purposely type in the wrong case when I use 'myVariable')
>> myvaraible = 1 '<==TYPO!
>
> Well, if you "correct" that to myVaraible you would still be in error,
> because you accidentally exchanged "ia" with "ai" in addition to
> changing "V" to "v". Python will not inform you about about some typos,
> whether case-related, dropped characters, exchanged characters, or
> added characters.
That's what Dan is saying he likes about VB. It will tell you about typos
if your variables are mixed case.
The auto-case correction in VB will inform Dan that he has made a typo,
because the editor "snaps" variable names into their declared
capitalization as soon as they are typed. In the example above, when Dan
hits the spacebar after "myvaraible", the text will remain all lowercase
because "myvaraible" is not declared, and Dan will know he has made an
error.
I do most of my programming in VB, I exploit this feature the same way Dan
does, and I have had trouble getting used to Python's case sensitivity.
I don't see a need to change the language to accomodate VB programmers, but
having a case-checking option as part of the editor would be a blessing.
(ActiveState, are you reading this?)
Matt
More information about the Python-list
mailing list