Skip to main content
gamedev.net
🔒 Locked

Hungarian Notation

Started by PsYcHoPrOg 6 replies 750+ views
Original Post
PsYcHoPrOg
PsYcHoPrOg
Who around here actually bothers to use Hungarian Notation? "Remember, I'm the monkey, and you're the cheese grater. So no messing around." -Grand Theft Auto, London "It's not whether I win or lose, as long as I piss you off" -Morrigan, Super Puzzle Fighter II Turbo Edited by - psychoprog on 9/9/00 9:41:47 AM
D:
felonius
felonius
Hungarian notation is in my opinion outright stupid. Why use it? It just add redundant information that your IDE might as well give you automatically (I know MVC++ can) and makes you code unreadable.

If you like spaghetti, though, it is great.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
Quantum
Quantum
oh god...not another one

i like hungarian notation...but most of the time i dont use it
because if i just hold the mouse over or click a variable it shows me the decleration
firahs
firahs
HN is the nastiest stuff i have ever seen.
jamin1001
jamin1001
I agree that HN is ugly and makes things hard to read. However, I do use a prefix letter for variables that let me know whether the variable is local (l), parameter (p), or class member (m). That way you know where the variable is coming from.

For a while I used to put the type of whatever my variable was, such as RectanglePtr or NameArr, but found it too be easier to rely on the type by context - so that now everything looks like pSphere, lCylinder, or mFilename. Otherwise things tend to look like all kinds of acronyms that takes a few seconds just to decode in your head (and programmers have enough going on in their head as it is...).


Jamin FrederickIdryonis
Myopic Rhino
Myopic Rhino
I used to be a big advocate of Hungarian, but after listening to the arguments against it, using it extensively, and trying out other styles, I decided to drop it. I still use some elements of it, but I''ve dropped the prefixes.
SHilbert
SHilbert
Well, as of now I use semi-hungarian notation. Let me explain:
If it''s a member variable, it''s prefixed with "m_".
If it''s a global variable, it''s prefixed with "g_".
Local variables have no prefix.
After that prefix is a second prefix (usually.)
The second prefix is "n" for integers, "p" for pointers, "sz" for strings, but no prefix is used for complex data types (except I sometimes use "vec" and "mat" for vectors and matrices, respectively.)
Does that count?

lntakitopi@aol.com - http://www.geocities.com/guanajam

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.