Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Buddys:
Firstly,Please let me introduce myself,I am come from China,This is my fist time access THE CODE PROJECT.I wish that I can get to know a great number of friends here.Recently,I am learning the win32 SDK platform programming.I am interest in the Hungarian notation,but I can't find the detail Documentation in chinaese website.If you have the material about Hungarian notation.Could you send to me via E-mail.
Thank you wery much
Best regard to you!
My Email:[Email - Removed]
mickey.zhou
Posted
Updated 15-Sep-10 5:11am
v2
Comments
HimanshuJoshi 15-Sep-10 11:11am    
You should not include email in your post. You will get email notification if someone replies to your question

Searching with google for Hungarian notation[^] gives heaps of information. Go for a wiki page.

Edit: Also, Hungarian notation might be considered a bit obsolete. Unless you're planning on an MFC future, you will be better off learning something else.
 
Share this answer
 
v2
Comments
Richard MacCutchan 15-Sep-10 11:45am    
"you will be better off learning something else." Such as?
Niklas L 15-Sep-10 16:56pm    
I'd say a new technology or library. Maybe STL or some Boost branches since we're in a C++ tagged discussion. One could study design patterns, or how a Single Malt affects your judgment. Any of those will give you more edge than knowing Hungarian notation IMO.
Just because the inventor is an amateur astronaut doesn't mean it's worth using. just say no to Hungarian notation! Unless (perhaps) you're an assembly language programmer that needs some way of documenting what types your untyped registers hold.

Here's the reasons:

- your code becomes far less readable by reducing abstraction - types suddenly become how the data is stored and not what their capabilities are

- there is no standard for Hungarian notation - your lpszName is someone elses strName and someone elses c_strName.

- it lies - when you see lp<anything> it doesn't mean a selector/offset pair

- even the company that created it don't like it anymore - .Net APIs seem to get away without needing types encoded in variable names

Cheers,

Ash
 
Share this answer
 
Comments
Niklas L 15-Sep-10 17:19pm    
You could put IntelliSense on your list as well. With a decent editor, you'll get all the type information you need.
Aescleal 15-Sep-10 17:25pm    
Good point - I tend to disregard intellisense due to MS's hamfisted implementation. Maybe when I get in VC++ 2010 I'll start using it again.
Hungarian notation had is motivation when all programming was mainly made in C, due to its weak type-system. It was meant to let you know the type of a variable to avoid you to invoke for it operations that where meant for other types of variables. In these cases the compiler says nothing about, and you will discover the bug may be after selling your app to 1000000 users!

If you use C++ properly (not as a "C with steroids", but with proper function overloading, templates and generic algorithm) that kind of things cannot happen (simply, the code doesn't compile thus revealing immediately the mistake) and also, "types" may be misleading, since a same generic algorithm may work with different types (thus you go with laying names...)

Of course, it still have sense when C++ code invokes plain old C APIs, but such part of code should be localized in well defined modules and not distributed everywhere.
Good design doesn't need to be Hungarian.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900