Coding standard: Prefixing variables to indicate datatype

David LeBlanc whisper at oz.net
Thu Jan 16 19:29:56 EST 2003


Charles Semonie (sp?) said he rued the day he ever even thought of
"hungarian" notation, let alone foisted it upon an unsuspecting developer
world.

Plain and simple it's bad programming practice. Among other things, it
encourages bad names for variables and focuses more on the data's type then
it's use.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Lothar Scholz
> Sent: Thursday, January 16, 2003 15:24
> To: python-list at python.org
> Subject: Re: Coding standard: Prefixing variables to indicate datatype
>
>
> >
> > This general class of notation is called Hungarian notation.  It's
> > either strongly liked or disliked; there's rarely opinions that lie in
> > between.  (I'm of the opinion that it is almost always overkill, tends
> > to become inaccurate over time due to code shift, and 99% of its
> > benefits can be gained simply by choosing appropriate identifiers.  Not
> > to mention terrribly ugly.)
>
> I can't find at least one good reason for this notation. Its a well
> known
> jokes that Hungarian notation was the reason that Win95 was delayed 2
> years
> because the programmer had to change every line of code :-)
>
> In fact now you have this fucking WIN32 API where you can find lots of
> places where the variable is different then the prefix. Event
> datatypes change during program lifetime - ignoring this means simply
> being a manager that has never written a really large software system.
>
> If your variables are so short that you can't imagine the name you are
> doing something wrong. I program in eiffel the whole day and we have
> method names
> like  "create_keyboard_shortcut_from_string". You read a program
> multiple times
> but you type it much less.
> --
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list