Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

vbisme

How many of you uses Hungarian notations?

This topic is 6401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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.

Share this post


Link to post
Share on other sites
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...


=============================================
Hungarian Nnotations,I love you forever!
=============================================


Edited by - zhang_zhou on December 1, 2000 4:18:07 AM

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
quote:
Original post by clonemaker

never!


Now theres a shocker. You mean the person who hates comments that make code easier to understand, also hates Hungarian Notation which also makes code easier to understand? GASP!

jk of course =)


- Houdini

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!