How many of you uses Hungarian notations?
Just wondering how many of you uses the Hungarian notations. Any of you guys made up your own?
I used it limitedly.
I always use the pointer pData, and simple data types prefixes.
But as far as using classes I ignore it.
Just because the church was wrong doesn''t mean Galileo wasn''t a heritic.
It just means he was a heritic who was right.
I always use the pointer pData, and simple data types prefixes.
But as far as using classes I ignore it.
Just because the church was wrong doesn''t mean Galileo wasn''t a heritic.
It just means he was a heritic who was right.
Just because the church was wrong doesn't mean Galileo wasn't a heretic.It just means he was a heretic who was right.
Excellent! the Hungarian Nnotations...
In all(the most at least) my programmes,all(the most at least) the variable names are the "Hungarian Nnotations",such as dwNumOfMoney,wStuffID,pbtFoo,szFileNamw,etc.,that make me maintaining my programmes is become very easy---when I see the variable "dwNumOfMoney",I would know that it is a double words(DWORD) variable and its means is the number of the money() at once,and don't need back to see the declaration line for it,the same as the other,it will save lots of my time and energy,and make me feel that programme is a kind of art
In addition,for all the global variables,I would add the "g_"(global) at the front of them,e.g.,g_szPlayName,it clearly shows that the variable is a global,so,it can be used anywhere...
Edited by - zhang_zhou on December 1, 2000 4:18:07 AM
In all(the most at least) my programmes,all(the most at least) the variable names are the "Hungarian Nnotations",such as dwNumOfMoney,wStuffID,pbtFoo,szFileNamw,etc.,that make me maintaining my programmes is become very easy---when I see the variable "dwNumOfMoney",I would know that it is a double words(DWORD) variable and its means is the number of the money() at once,and don't need back to see the declaration line for it,the same as the other,it will save lots of my time and energy,and make me feel that programme is a kind of art
In addition,for all the global variables,I would add the "g_"(global) at the front of them,e.g.,g_szPlayName,it clearly shows that the variable is a global,so,it can be used anywhere...
=============================================Hungarian Nnotations,I love you forever! =============================================
Edited by - zhang_zhou on December 1, 2000 4:18:07 AM
============================= Hey,I just wanna know WHY! =============================
I hate reading it. I suppose it could be useful
to know a variables type as you are reading the code.
But I hate reading it anyway. It kludges up the code
just like too many comments!
to know a variables type as you are reading the code.
But I hate reading it anyway. It kludges up the code
just like too many comments!
"I am a pitbull on the pantleg of opportunity."George W. Bush
I don''t use it, because:
A) It looks horrible (in my opinion)
B) If you change the data type of the variable, you have to do a search & replace in every file that uses it
C) And most importantly, in Visual C++ 6.0, you can see the declaration of a variable when you hold the mouse cursor over the variable name, so Hungarian notation loses its point
The only prefix I use is m_ for class member variables.
-Jussi
A) It looks horrible (in my opinion)
B) If you change the data type of the variable, you have to do a search & replace in every file that uses it
C) And most importantly, in Visual C++ 6.0, you can see the declaration of a variable when you hold the mouse cursor over the variable name, so Hungarian notation loses its point
The only prefix I use is m_ for class member variables.
-Jussi
Hungarian notation is evil.
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
I use a version of the standard we use at work with VB (language not buffer), and bastardised it a bit to use C types. Basically we prefix every variably name with two characters, the first is the variable type and the second the variable scope. i.e. in VB for a string that is a member of a class we would use zfStringName, a long that was global lgLongName and a local double as dpDoubleName. I guess I have just got used to using it at work, when it comes to writing things at home I just automatically use it. Personally I find it an immense benefit to my codes readability.
quote:
B) If you change the data type of the variable, you have to do a search & replace in every file that uses it
People who use C++ normally wouldn't have this problem. For instance all of my variables are kept private in classes with a Get and Set function for each variable that may need to be changed outside the class.
quote:
C) And most importantly, in Visual C++ 6.0, you can see the declaration of a variable when you hold the mouse cursor over the variable name, so Hungarian notation loses its point
True, except Hungarian Notation is still useful for global and member variables, as you pointed out. And as far as Visual C++ goes, that's true as long as you know that:
A) You'll never ever switch compilers
B) You'll never ever port code to another operating system
C) You'll never ever give the code to someone else, because they may not use VC++.
Personally, I find Hungarian Notation very useful and makes code much easier to understand.
- Houdini
Edited by - Houdini on December 1, 2000 9:35:19 AM
- Houdini
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement