Original Post
Just wondering if anyone out there uses hungarian notation. I personally never liked it, but has anyone found a good use for it?
Quote:
Original post by Oluseyi Quote:Yes. Apps Hungarian was a Good Idea™, especially for the time. Systems Hungarian was a disaster.
Original post by wasted_druid
Just wondering if anyone out there uses hungarian notation. I personally never liked it, but has anyone found a good use for it?
Edit: More details.
Quote:
Original post by Nitage
The purpose of hungarian notation is to let you see what type a variable is without looking at its definition.
There are several (free) IDEs that will happily tell you what type a variable is, without the user having to decipher gibberish.
If you're using any templated code (including any std containers) then you won't be able to embed anything useful in the prefix without getting into the area of 5+ char prefixes.
Hungarian notation is clearly obsolete. Add to that the fact that it's a nightmare to maintain and that it breaks the one definition principle.
Quote:
Original post by Verg Quote:
Original post by Nitage
The purpose of hungarian notation is to let you see what type a variable is without looking at its definition.
There are several (free) IDEs that will happily tell you what type a variable is, without the user having to decipher gibberish.
If you're using any templated code (including any std containers) then you won't be able to embed anything useful in the prefix without getting into the area of 5+ char prefixes.
Hungarian notation is clearly obsolete. Add to that the fact that it's a nightmare to maintain and that it breaks the one definition principle.
Plus it's hideous
Quote:No.
Original post by wasted_druid
Just wondering if anyone out there uses hungarian notation.
Quote:No.
I personally never liked it, but has anyone found a good use for it?
Quote:Wrong.
Original post by Nitage
The purpose of hungarian notation is to let you see what type a variable is without looking at its definition.
Quote:
Original post by Oluseyi Quote:Wrong.
Original post by Nitage
The purpose of hungarian notation is to let you see what type a variable is without looking at its definition.
The intent of the original Hungarian Notation (aka Apps Hungarian) was to indicate the usage of the data in a variable as a means of promoting good code. Read the links I provided for more information. Unfortunately, Charles Simonyi was Hungarian, so he used the word "type" where he clearly meant "usage," and even though the text of his paper made his meaning clear, it was still misunderstood by the legions who created what is known as Systems Hungarian or Anti-Hungarian Notation.
Apps Hungarian is useful in dynamically typed languages; Systems Hungarian is not. Apps Hungarian provides information that resides in the application design, not the code; Systems Hungarian does not. Apps Hungarian allows code to grow, such as changing the actual type of the variable; Systems Hungarian does not, leading to travesties such as lparam in the Win32 code tree (which should be dwparam since the conversion from 16 to 32 bits), a legacy of Win16.
The great problem of Hungarian Notation is that most people are familiar with A-NH or Systems Hungarian thanks to the books of Charles Petzold, but not aware that that is a complete misapplication of the system. They rightly reject this system as unproductive and detrimental to code quality, but wrongly lay the blame on Hungarian Notation as a whole.
Apps Hungarian is a Good Thing™.
Quote:
Original post by chollida1
Wow, so none of you use m to indicate a member variable of a class, that is the best use of Hungarian notation I've seen.
Sounds like I'm treading my own path here;)
I also perfer hungarian in langauges like vb and Objective C where you don't have to declare a variable type, you can just say dim var and it can represent anything.
I will often use dim strVar to indicate that this variable will hold a string.
Cheers
Chris
Quote:
Original post by chollida1
Wow, so none of you use m to indicate a member variable of a class, that is the best use of Hungarian notation I've seen.
Quote:
Original post by Oluseyi
The intent of the original Hungarian Notation (aka Apps Hungarian) was to indicate the usage of the data in a variable as a means of promoting good code. Read the links I provided for more information. Unfortunately, Charles Simonyi was Hungarian, so he used the word "type" where he clearly meant "usage," and even though the text of his paper made his meaning clear, it was still misunderstood by the legions who created what is known as Systems Hungarian or Anti-Hungarian Notation.
Quote:
Apps Hungarian is useful in dynamically typed languages; Systems Hungarian is not. Apps Hungarian provides information that resides in the application design, not the code; Systems Hungarian does not. Apps Hungarian allows code to grow, such as changing the actual type of the variable; Systems Hungarian does not, leading to travesties such as lparam in the Win32 code tree (which should be dwparam since the conversion from 16 to 32 bits), a legacy of Win16.
...
Apps Hungarian is a Good Thing™.
Quote:
Original post by chollida1
Pardon?? I must be confused. I thought hungarian notation's definition has now evolved into any leading text that indicates what the type of a variable is.
Quote:
According to this site http://web.umr.edu/~cpp/common/hungarian.html "m_" is part of Hungarian notation. ANd since its on the internet it must be true:)
How do you define it??
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more