To identify the type of a variable, the variable name would start with the letter(s) of its type. So a variable sum of type double would be dsum, a variable of name of type char* would be lpchar (long pointer - don't ask unless you did 16 bit programming...). A handle variable would start with h etc etc. Microsoft were very hot on this way back when. I never liked it.
The trouble with Hungarian Notation is when it gets out of hand - it's not obvious what the notation means. I have seen examples where there were 4 capitalised chars at the beginning of a class name - no idea what that means unless it's documented somewhere.
I tend to put "global" variables into their own namespace.
For in/out parameters there are sections F.16 to F.20 in coreguidelines.
Hungarian Notation - or in general, using names that carry type information - may be useful in untyped languages.
Embedding semantic information in names is occasionally useful in languages like C++: for example, if temperatures are sometimes in Celsius and sometimes in Fahrenheit, it may make sense to have a uniform naming convention. For example, cAmbientTemp vs fAmbientTemp
*Arguably, that's what the non-wart part of the name is for.
In other words, if you start to encode the meaning of the data the variable holds in the wart, then what do you use the rest of the identifier for?
Yeah, I do that all the time. My text editor– TextMate– allows me to type the first couple letters of a variable, then hit the ESC key and it automatically completes the variable name. Which has led to some bad habits with using overly long, complicated names.
but its obsolete now, IMHO
I still sort of use it, because I don't use an IDE. I won't go into why, it's a long explanation, but the short one is, I've used TextMate for almost 20 years now, I'm used to it, and I don't want to learn something else. I also hate how IDE's are always so complicated, and they have unnecessary stuff like a debugger and compiler, both of which I already have (clang++ or g++ and lldb or gdb).
[Edit] Misattributed first quote to @TheIdeasMan, quote was actually from JLBorges.