Const in python?

Alex Martelli aleax at aleax.it
Wed Mar 26 04:46:05 EST 2003


David Brown wrote:

> 
> "Lulu of the Lotus-Eaters" <mertz at gnosis.cx> wrote in message
> news:mailman.1048613681.19759.python-list at python.org...
>> Dave Brueck <dave at pythonapocrypha.com> wrote previously:
>> |> ALL CAPS conventions - they look ugly,
>>
>> |To you, perhaps. This is a very widely used, understood, and accepted
>> |convention - I quite like it.
>>
>> As if this were a democracy, I'll just chime in "I agree" :-).  Brueck
>> does a great job of explaining exactly why capitalized contstants aid
>> comprehension.
> 
> He did indeed give a good explaination.  I don't like all caps personally,
> but I fully realise that I'm in the minority.

I'm in that minority too (to me, ALLCAPS read as "raising your voice"
and I don't really see why one should raise one's voice when speaking
out the name of a constant;-), but don't feel strongly enough about it
to make all that much of a fuss:-).


>> Maybe I'm tainted by having already used it in a dozen languages before
>> Python... hmmm, do you think there is a reason those dozen languages all
>> use the same convention?
> 
> Perhaps because it's conventional?  People are used to it, so there is no

I think C was the first language to introduce this convention (though
maybe it borrowed it from BCPL...? not sure!), and C's success (which
in turn may be explained in many ways) helped spread its ideas and
conventions far and wide.  If Modula-2 had won (among case-sensitive
languages), we'd all be using caps for keywords instead (a convention
which at least would make it painless to introduce new keywords;-).


Alex





More information about the Python-list mailing list