.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hungarian Notation

8 REPLIES 8
Reply
Message 1 of 9
Punisher
333 Views, 8 Replies

Hungarian Notation

I read in a MS C# book, that Hungarian notation was not to be used any further, and the C++ people would just hate it. I still see C# code samples from Autodesk and others in Hungarian.

Is it in fact not to be used industry wide, or is this just the Author's preferences
8 REPLIES 8
Message 2 of 9
smcclure
in reply to: Punisher

It is true - Hungarian notation is being dropped. The preference is now CamelCase and variations on it (pascalCase I believe is the other name).

The .NET Coding Guidelines - Guidelines for Names is available at:
http://msdn2.microsoft.com/en-us/library/ms229002.aspx
Message 3 of 9
Anonymous
in reply to: Punisher

As it turns out it really doesn't matter although the convention you have
been referred to has its merits as it does result in quality code. Too many
Microsoft employees are primadonnas and do not even
follow their own guidelines let alone cooperate with language conventions
agreed by general consensus. This can be observed at MSDN and MSDN2 which
for the most part provide high quality documentation supporting coding
conventions. Then observe there is a break-away group who have
forked the development platform by using the asp.net website to start doing
their own thing using Atlas to subvert the conventions that so many spent so
much personal time arguing and eventually agreeing to adopt.

The point is then Too many of them are
undisciplined rank hypocrits. By all means take what is useful from what you
have been referred to as a guideline but do what works for you -- noting if
and when you are working with others -- its best to discipline yourself as
you may likely have when adopting CAD Layer Guidelines and other standards.
That is, be cooperative and adopt the convention your peers have
established. Be a pro.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W



wrote in message news:5306092@discussion.autodesk.com...
It is true - Hungarian notation is being dropped. The preference is now
CamelCase and variations on it (pascalCase I believe is the other name).

The .NET Coding Guidelines - Guidelines for Names is available at:
http://msdn2.microsoft.com/en-us/library/ms229002.aspx Message was edited by: Discussion Admin
Message 4 of 9
Punisher
in reply to: Punisher

Thanks for the information
John
Message 5 of 9
ChrisArps
in reply to: Punisher

I have only found one place where I still use "hungarian" notation. When I define UI elements like combo boxes or text boxes I prefer to use prefixes so it is easier to work with the code.

Example :

dim deltaX as double = 0.0 ' No Hungarian needed
dim numbertOfUsers as integer = 5 ' None here

dim txtUserName as TextBox ' all textboxes start with txt
dim cmbState as ComboBox ' combos with cmb

Chris Arps
Message 6 of 9
Anonymous
in reply to: Punisher

.net also holds onto the COM "I" for interfaces.
wrote in message news:5315980@discussion.autodesk.com...
I have only found one place where I still use "hungarian" notation. When I
define UI elements like combo boxes or text boxes I prefer to use prefixes
so it is easier to work with the code.

Example :

dim deltaX as double = 0.0 ' No Hungarian needed
dim numbertOfUsers as integer = 5 ' None here

dim txtUserName as TextBox ' all textboxes start with txt
dim cmbState as ComboBox ' combos with cmb

Chris Arps
Message 7 of 9
Punisher
in reply to: Punisher

I thought it was hoaky when I started using it, but now I wish they were not stopping the use of it. It is much easier to deal with variables, especially moving data back and forth between strings, text fields, db arrays, doubles, and which UI field is this. I am beginning to interact with the "outside world", and don't want to use an outmoded style.
Message 8 of 9
Anonymous
in reply to: Punisher

I think it depends on the IDE you're coding in. If I was writing C# code in notepad without tooltips and intellisense, I'd be lost without HungarianNotation. In the VS.NET IDE, however, it makes sense to use camelCase, with all the clues the IDE gives you as to what the variable type is.

I've also adopted camelCase everywhere except UI elements. (txtFirstName, cboState, etc)
Message 9 of 9
Anonymous
in reply to: Punisher

I'm suggesting sticking to FxCop's specs.

http://www.gotdotnet.com/team/FxCop/

Regards,
Maksim Sestic

wrote in message news:5305766@discussion.autodesk.com...
I read in a MS C# book, that Hungarian notation was not to be used any
further, and the C++ people would just hate it. I still see C# code samples
from Autodesk and others in Hungarian.

Is it in fact not to be used industry wide, or is this just the Author's
preferences

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost