case-sensitivity
Ron Adam
radam2 at tampabay.rr.com
Thu Nov 13 20:06:42 EST 2003
On Thu, 13 Nov 2003 16:12:09 +0100, Ronald Oussoren
<oussoren at cistron.nl> wrote:
>
>On 13 nov 2003, at 6:53, Ron Adam wrote:
>
>> On Thu, 13 Nov 2003 02:12:38 GMT, "Rainer Deyke" <rainerd at eldwood.com>
>> wrote:
>>
>>> Ron Adam wrote:
>>>> Which would you choose from the following?
>>>
>>> Here are the options I see, in order of preference:
>>>
>>> 1. The compiler enforces a consistent capitalization scheme,
>>> preferably
>>> all_lower_case. Note that MixedCase is only consistent if
>>> PsychoTheRapist
>>> is a different identifier than Psychotherapist. Different syntactical
>>> elements (identifiers vs keywords) are allowed to use different
>>> schemes.
>
>A slighty different scheme would be to disallow names that differ only
>in case. This would make it possible to talk about code ("the foo
>function is buggy") without confusion ("which one, the one in capitals
>or lower-case?"), without having having the confusing notion that 'FOO'
>and 'foo' are the same. To me at least 'foo = FOO' looks like something
>different than 'foo = foo'.
>
>Ronald
>
I agree, I don't know how often it occurs in the libraries, and so
can't say how difficult it would be to change at this time. But I do
think it is a good thing not to use case as the only indicator of a
difference.
I think it should be discouraged as a bad or poor programming practice
in any case. In my opinion it more often than not makes code less
readable when we use case as the only difference between names.
_Ron Adam
More information about the Python-list
mailing list