hungarian notation is evil (was Re: Do I always have to write "self." ?)

James Logajan JamesL at Lugoj.Com
Fri May 5 06:36:54 CEST 2000


"Samuel A. Falvo II" wrote:
> Then I realized, "You know -- it's just not worth it."  We're arguing over
> personal preferences here.  But I was still angry enough to not just let it
> go myself.

It isn't quite a case of personal preference. Where I work we have a
programming style guide. The intent is that code produced by all the
individuals in our group should have roughly the same style. Adoption of
Hungarian was an early heated battle. In the end it was recommended but not
required.

I am generally opposed to strict adherence of Hungarian notation. It is not
an evil notation though. Some of its adherents may be evil, but the notation
isn't. It was probably useful for the audience it was originally targeted
to: inexperienced programmers who have to work in a team environment.

In dynamically typed languages or in C++ templates I think it can actually
be misleading. Come to think of it, if you want to declare anything evil, I
think you should declare C++ templates evil. Another case where Python got
it right (EVERYTHING in Python is a sort of template!).



More information about the Python-list mailing list