• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is Hungarian notation?

 
Randall Twede
Ranch Hand
Posts: 4371
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the style page it says not to use Hungarian notation. Could someone explain to me what Hungarian notation is?
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Peter Tran
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Peter Tran
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randall,
Read this post to see a better (i.e. unbias ) explanation given by Frank Carver.
-Peter
[ July 18, 2002: Message edited by: Marilyn de Queiroz ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic