File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Cattle Drive and the fly likes What is Hungarian notation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "What is Hungarian notation?" Watch "What is Hungarian notation?" New topic

What is Hungarian notation?

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

On the style page it says not to use Hungarian notation. Could someone explain to me what Hungarian notation is?

Visit my download page
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Hungarian notation started with something that told you the type of the object, i.e. iMyInt was an int.

The roots of this naming standard are in early Object-Oriented languages, where it was an important requirement to distinguish between classes and objects. In Smalltalk, for example it is/was traditional to name a class (for example) "Thing", and an instance of it "aThing". When they came to decide on what to do with method (message) names, they chose to lump them with objects, considering them as concrete things rather than abstract things like classes.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Peter Tran

Joined: Jan 02, 2001
Posts: 783
I thought the Hungarian notation was something concocted by someone working for Microsoft, so they published this long coding standard paper for using the notation. Later they found out that it was a stupid idea, and they stop using it at Microsoft. Of course like Microsoft, they decided not to admit to their mistake and tell the rest of the world.
Forgive me for forwarding you to this site, but this was the only link I could find any useful information.
Peter Tran

Joined: Jan 02, 2001
Posts: 783
Read this post to see a better (i.e. unbias ) explanation given by Frank Carver.
[ July 18, 2002: Message edited by: Marilyn de Queiroz ]
I agree. Here's the link:
subject: What is Hungarian notation?
jQuery in Action, 3rd edition