Request for Python Source Code

Dave Brueck dbrueck at edgix.com
Tue Oct 10 11:15:38 EDT 2000


>I suppose (this is just an assumption) that Simoney invented it
>in the 70ies when writing assembler code. There, it might make sense
>to prefix a name of a variable with a type prefix.
>It doesn't make much sense from C upwards.

Really? It's probably _most_ useful in a language like C where the
programmer is allowed to abuse data types at will, sometimes without so much
as a warning from the compiler. Because it's largely the programmer's
responsibility to keep track of whether something is an int or a pointer,
for example, having that information contained in the variable name can be
pretty handy.

Even when the compiler does warn you, I still find that it's handy to know
(via the name) what sort of an object you're operating on. It's certainly
not a must, and I've never used the full Hungarian style, but it really adds
to code readability to know the data type when it affects the program's
behavior.

In Python I don't use that notation as much because things are more concise,
but it's still occasionally helpful (boolean flags are the most common case
in which I use them). Anybody else do this in Python or is it just my bad
habit left over from programming in inferior languages?

-Dave





More information about the Python-list mailing list