DevPinoy.org
A Filipino Developers Community
ATTENTION:Take our Code Challenge for the month of October 2008 and win some great prize! Learn more about it here!

Hungarian Notation

I started programming with C and used Hungarian notation since then.  It was very helpful back then to instantly know what type the variable is from its name.

When I started programming in .NET using Visual Studio, Intellisense made a major breakthrough and helped a lot.  You just point your mouse over a variable and intellisense will provide you with its underlying type.  Not to mention the automatic dropdown of object members after a dot(.) operator. 

Upon seeing a number of codes on the net and knowing the preferred convention of on naming variables, I started to realize that I'm beginning to hate Hungarian Notation.  I don't want to see those str prefixes on string variables, etc.  And besides, if you follow today's standard naming guidelines, you can deduce from the variable names their types.
 


Posted Mar 29 2005, 08:42 AM by jokiz
Filed under: ,

Comments

anjin wrote re: Hungarian Notation
on 08-14-2005 12:46 AM
hi!

i believe the reason they explicitly said "Do not use Hungarian notation" is because the notation was so misunterstood by people, it was better not having it.

When Charles Simonyi invented the hungarian notation, his original purpose was to prefix a variable based on their type (meaning purpose), rather than the type of the variable in a language.

So for example you'll have "ms" for milliseconds and "tck" for ticks. If you see a code like

msTotal + tckPrev

then it's obviously wrong, since they are not of the same type (purpose) even if they maybe both Integers (so the compiler does not notice).


Add a Comment

(required)  
(optional)
(required)  
Remember Me?

Enter the numbers above:

Copyright DevPinoy 2005-2008
Powered by Community Server (Commercial Edition), by Telligent Systems