You might read this:
Hungarian notation specifies that a prefix be added to each variable to
indicate its type. However, not every type was given a standard prefix. In
addition, as other languages were introduced and new types created, new
prefixes had to be created. This is why even if you go into a shop that
employs Hungarian notation, you might see some prefixes you're not
accustomed to seeing. (By the way, the term "Hungarian notation" comes from
the fact that the prefixes make the variables look as if they are written in
a language other than English; plus, Mr. Simonyi is from Hungary.)
Perhaps the most important publication that encouraged the use of Hungarian
notation was the first book read by almost every Windows and OS/2 developer:
Charles Petzold's Programming Windows (Microsoft Press), which used a
dialect of Hungarian notation throughout its demo applications. In addition,
Microsoft employed the notation in its own development. When MFC was
released, a bunch of new prefixes specific to C++ development were released
with its source code, thereby guaranteeing the continued use of Hungarian
notation.
So why not simply continue using Hungarian notation? Because Hungarian
notation is useful in situations where it's beneficial to know the type, or
scope, of a variable being used. However, as you'll see in more detail in
the next chapter, all types in C# are objects and based on the .NET
System.Object class. Therefore, all variables have a basic set of
functionality and behavioral characteristics. For this reason, the need for
Hungarian notation is lessened in the .NET environment.
I would however not agree with the last sentence in the last paragraph. I
believe it is still very useful to know a variables type even if it does
inherit from the base Object type.
HTH
Steve
"VM" <None> wrote in message news:e7**************@tk2msftngp13.phx.gbl...
What's the correct variable naming in C#? How should a form be called (eg.
Frm_myForm)? or an int variable (eg. Int_Var) or a DataGrig (eg.
DG_myGrid)? I'm writing an application but I would like to name variables, objects,
etc... corectly so everyone knows what the variable is and what it holds
when they look at it and make the code easier to read.
Thanks.