473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Hungarion Notation is out but..

Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name it
that"

Class Names are an interesting side. If we name them in a meaningful way and
then we name an instance of in a meaningful way there will ultimately be a
semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading it.
(am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff
Nov 21 '05 #1
14 1198
since when is hungarian notation out? We use it all the time in code, and
every major dev we've worked with uses it.
"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name it
that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will ultimately
be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading it.
(am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff

Nov 21 '05 #2
This isn't a thought of my own invention. I have read it (.net\hungarion
not) in a number of books and my eyes popped out the first time I read it,
but in practice I found that with a few exceptions I am ok with this style.
I wouldn't convert an existing codebase or change coding conventions on a
continuing codebase.

But I am starting a new codebase at work that has nothing to do with the
past. So I am trying to stay in the spirit of the .net conventions. You
might want to look at FXCop. I find it way too rigid for my taste, though.

Here is a good discussion of hungarion\not by Richard Hale Shaw.
http://www.richardhaleshawgroup.com/.../03/03/20.aspx

jeff

"Brian Henry" <no****@newsgroups.com> wrote in message
news:uM*************@TK2MSFTNGP09.phx.gbl...
since when is hungarian notation out? We use it all the time in code, and
every major dev we've worked with uses it.
"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name
it that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will ultimately
be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading
it. (am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff


Nov 21 '05 #3
"Jeff Jarrell" <jj************@yahoo.com> schrieb:
This isn't a thought of my own invention. I have read it (.net\hungarion
not) in a number of books and my eyes popped out the first time I read it,
but in practice I found that with a few exceptions I am ok with this
style. I wouldn't convert an existing codebase or change coding
conventions on a continuing codebase.

But I am starting a new codebase at work that has nothing to do with the
past. So I am trying to stay in the spirit of the .net conventions. You
might want to look at FXCop. I find it way too rigid for my taste,
though.

Here is a good discussion of hungarion\not by Richard Hale Shaw.
http://www.richardhaleshawgroup.com/.../03/03/20.aspx


Before discussing whether or not using the Hungarian Notation makes sense
it's important we make sure that we are all referring to the same thing:

Making Wrong Code Look Wrong
<URL:http://www.joelonsoftware.com/articles/Wrong.html>

I don't think that the Hungarian Notation as introduced by Charles Simonyi
is completely obsolete, not even strict typing and OO make it obsolete.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
ML
Any naming convention is used properly and consistently is good. To say HN
is obsolete is foolishness IMHO. Naming conventions are there to make the
code easier to follow and read, how can using HN with .NET be bad? It may
be redundant but certainly not bad/wrong.

"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
This isn't a thought of my own invention. I have read it (.net\hungarion
not) in a number of books and my eyes popped out the first time I read it,
but in practice I found that with a few exceptions I am ok with this
style. I wouldn't convert an existing codebase or change coding
conventions on a continuing codebase.

But I am starting a new codebase at work that has nothing to do with the
past. So I am trying to stay in the spirit of the .net conventions. You
might want to look at FXCop. I find it way too rigid for my taste,
though.

Here is a good discussion of hungarion\not by Richard Hale Shaw.
http://www.richardhaleshawgroup.com/.../03/03/20.aspx

jeff

"Brian Henry" <no****@newsgroups.com> wrote in message
news:uM*************@TK2MSFTNGP09.phx.gbl...
since when is hungarian notation out? We use it all the time in code, and
every major dev we've worked with uses it.
"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name
it that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will
ultimately be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading
it. (am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But
thats not in the spirit of .net now. Should I just get used to not
immediately recognizing the difference between an instance and a type?

thanks,
jeff



Nov 21 '05 #5
nice point. it is an important distinction between apps hungarion and
system hungarion. I have to admit though, this is the first time I have
read or considered the distinction. I'd like to say I was simply thinking
of system hungarion but that wouldn't be the case for my example.

I am just trying to grow into the spirit of .net. I wasn't trying to
project a point of view with how the community at large should think of
hungarion notation. Fact is that as a old timer, I have had to open my mind
to reconsider the issue.

Now lets take it from a different point of view.

I have an domain object type that describes a user. What would you name it?

I have an instance of the above user domain object type. What would you
name it?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:u%****************@TK2MSFTNGP14.phx.gbl...
"Jeff Jarrell" <jj************@yahoo.com> schrieb:
This isn't a thought of my own invention. I have read it (.net\hungarion
not) in a number of books and my eyes popped out the first time I read
it, but in practice I found that with a few exceptions I am ok with this
style. I wouldn't convert an existing codebase or change coding
conventions on a continuing codebase.

But I am starting a new codebase at work that has nothing to do with the
past. So I am trying to stay in the spirit of the .net conventions. You
might want to look at FXCop. I find it way too rigid for my taste,
though.

Here is a good discussion of hungarion\not by Richard Hale Shaw.
http://www.richardhaleshawgroup.com/.../03/03/20.aspx


Before discussing whether or not using the Hungarian Notation makes sense
it's important we make sure that we are all referring to the same thing:

Making Wrong Code Look Wrong
<URL:http://www.joelonsoftware.com/articles/Wrong.html>

I don't think that the Hungarian Notation as introduced by Charles Simonyi
is completely obsolete, not even strict typing and OO make it obsolete.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6
Here is where Microsoft recommends not to use Hungarian notation:

Standard ECMA-335
Common Language Infrastructure (CLI)

2nd edition (December 2002)
http://www.ecma-international.org/pu...s/Ecma-335.htm

Annex D Class Library Design Guidelines
This is a nice chapter I specialy recommend to read.

"Do not use Hungarian notation. Good names describe semantics, not type."

This is the index:

D.1. Naming Guidelines
D.1.1. Capitalization Styles
D.1.1.1. Pascal Casing
D.1.1.2. Camel Casing
D.1.1.3. Upper Case
D.1.1.4. Capitalization summary
D.1.2. Word Choice
D.1.3. Case Sensitivity
D.1.4. Avoiding Type Name Confusion
D.1.5. Namespaces
D.1.6. Classes
D.1.7. Interfaces
D.1.8. Attributes
D.1.9. Enums
D.1.10. Fields
D.1.10.1. Static Fields
D.1.11. Parameter Names
D.1.12. Method Names
D.1.13. Property Names
D.1.14. Event Names

Best Regards,
Alejandro Lapeyre

"Jeff Jarrell" <jj************@yahoo.com> escribió en el mensaje
news:ON**************@TK2MSFTNGP09.phx.gbl...
This isn't a thought of my own invention. I have read it (.net\hungarion
not) in a number of books and my eyes popped out the first time I read it,
but in practice I found that with a few exceptions I am ok with this
style. I wouldn't convert an existing codebase or change coding
conventions on a continuing codebase.

But I am starting a new codebase at work that has nothing to do with the
past. So I am trying to stay in the spirit of the .net conventions. You
might want to look at FXCop. I find it way too rigid for my taste,
though.

Here is a good discussion of hungarion\not by Richard Hale Shaw.
http://www.richardhaleshawgroup.com/.../03/03/20.aspx

jeff

"Brian Henry" <no****@newsgroups.com> wrote in message
news:uM*************@TK2MSFTNGP09.phx.gbl...
since when is hungarian notation out? We use it all the time in code, and
every major dev we've worked with uses it.
"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name
it that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will
ultimately be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading
it. (am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But
thats not in the spirit of .net now. Should I just get used to not
immediately recognizing the difference between an instance and a type?

thanks,
jeff



Nov 21 '05 #7
"Alejandro Lapeyre" <Al**************@hotmail.com> schrieb:
Here is where Microsoft recommends not to use Hungarian notation:

Standard ECMA-335
Common Language Infrastructure (CLI)

2nd edition (December 2002)
http://www.ecma-international.org/pu...s/Ecma-335.htm

Annex D Class Library Design Guidelines
This is a nice chapter I specialy recommend to read.

"Do not use Hungarian notation. Good names describe semantics, not type."


CLI <> All .NET programming languages!

I don't think that a general statement or recommendation would make much
sense at all. First, as I already mentioned in another post, "Apps
Hungarian" as described in
<URL:http://www.joelonsoftware.com/articles/Wrong.html> doesn't describe
types, it describes semantics of variables in a handy abbreviated form.

This is especially important when dealing with programming languages'
intrinsic types which often cannot and should not be extended by renaming,
aliasing or subtyping. For example, when dealing with angles given in
degrees and radians, a distinction is important to prevent mixing both
units, however, all of these values are stored in 'Double' format. There
are much more examples when introducing prefixes like 'deg', 'rad', etc.
would make sense. One could argue that a well-built project doesn't mix
units, but as practice shows, this is not always the case. 3rd-party
libraries sometimes use different units, data stored in legacy-databases and
file formats can suffer from the same problem.

Additionally not all .NET programming languages support strict typing and/or
provide a way to turn strict typing off to make dealing with COM etc.
objects easier. In this case, /type/ prefixes can help to write better code
by preventing the developer from mixing types without using appropriate
conversion methods or assigning variables of incompatible types to each
other.

To make a conclusion: I don't think that Hungarian Notation (both, Apps and
System) are bad per-se and should be avoided under all circumstances.
Shifting to programming languages which support strict typing will reduce
the need for using these notations, but they won't become completely
obsolete.

I am curios about other people's thoughts on this topic.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #8
Herfried,

I am curios about other people's thoughts on this topic.

ACK,

As addition, the size of a project (in size or time of live, workers) makes
in my opinion how much agreements there are needed. In which this is one of
those.

Cor
Nov 21 '05 #9
I agree with you, I don´t think that Hungarian notation is bad per-se. On
the one hand, it should be avoided in the public classes, methods,
parameters, etc. of a class library, because people should not be forced to
use your naming conventions. For that purpose MS has some class library
naming guidelines. But on the other hand, for internal code not exposed
outside the assembly, I find it very useful (and productive for
intellisense) to use "i" for Integers and so on, or say, to use "m_" to
denote class variables as opposed to procedure variables or parameters. In
fact, it can help to reduce programming errors.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> escribió en el mensaje
news:%2***************@TK2MSFTNGP15.phx.gbl...

CLI <> All .NET programming languages!

I don't think that a general statement or recommendation would make much
sense at all. First, as I already mentioned in another post, "Apps
Hungarian" as described in
<URL:http://www.joelonsoftware.com/articles/Wrong.html> doesn't describe
types, it describes semantics of variables in a handy abbreviated form.

This is especially important when dealing with programming languages'
intrinsic types which often cannot and should not be extended by renaming,
aliasing or subtyping. For example, when dealing with angles given in
degrees and radians, a distinction is important to prevent mixing both
units, however, all of these values are stored in 'Double' format. There
are much more examples when introducing prefixes like 'deg', 'rad', etc.
would make sense. One could argue that a well-built project doesn't mix
units, but as practice shows, this is not always the case. 3rd-party
libraries sometimes use different units, data stored in legacy-databases
and file formats can suffer from the same problem.

Additionally not all .NET programming languages support strict typing
and/or provide a way to turn strict typing off to make dealing with COM
etc. objects easier. In this case, /type/ prefixes can help to write
better code by preventing the developer from mixing types without using
appropriate conversion methods or assigning variables of incompatible
types to each other.

To make a conclusion: I don't think that Hungarian Notation (both, Apps
and System) are bad per-se and should be avoided under all circumstances.
Shifting to programming languages which support strict typing will reduce
the need for using these notations, but they won't become completely
obsolete.

I am curios about other people's thoughts on this topic.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #10
Jeff,
| Class Names are an interesting side. If we name them in a meaningful way
and
| then we name an instance of in a meaningful way there will ultimately be a
| semantic collision.
I normally use camelCasing for variables & ProperCasing for types, so I
don't have as big a problem with the perceived semantic collision.

Dim user As New User

I find using "a", "an", "the" as a prefix helps make the code more human
readable and helps avoid the perceived semantic collision. I understand its
used by some Java programmers.

Dim aUser As New User ' a user of a set/collection of users

Dim anOperator as New Operator ' an operator from a collection

Dim theUser As New User ' the only user

Unfortunately I don't use "a", "an", & "the" as often as I probably should
or could. They & Hungarian notation don't adhere to the .NET Design
Guidelines for Class Libraries for fields, properties & parameters..

http://msdn.microsoft.com/library/de...Guidelines.asp

http://msdn.microsoft.com/library/de...reviations.asp

http://msdn.microsoft.com/library/de...Guidelines.asp

http://msdn.microsoft.com/library/de...Guidelines.asp

http://msdn.microsoft.com/library/de...Guidelines.asp

Which does not say you cannot use them on private instance fields or local
variables...

For control names I normally spell out (normally one or two words) the
control type rather then attempt to abbreviate it. In other words I use
textFirstName & buttonCancel instead of txtFirstName, btnCancel, or
cmdCancel.

Hope this helps
Jay

"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
| Hungarion Notation is out but..
|
| I am trying to keep the notion of naming things "it is what it is, name it
| that"
|
| Class Names are an interesting side. If we name them in a meaningful way
and
| then we name an instance of in a meaningful way there will ultimately be a
| semantic collision.
|
| For example,
|
| In a VB6 way
| dim oUser as new clsUser
|
| In a .Net way
| dim User as new User
|
| When I read vb6 example, it jumps out at me whether I am refering to the
| type or the instance. In the .Net way I am not sure from just reading it.
| (am I using a static function in a type or a function that uses an
| instances).
|
| I am tempted to either suffix the type or prefix the instance. But thats
| not in the spirit of .net now. Should I just get used to not immediately
| recognizing the difference between an instance and a type?
|
| thanks,
| jeff
|
|
Nov 21 '05 #11
Herfried,
Although I agree with the intent of Making Wrong Code Look Wrong, I would
avoid the use of abbreviations for example instead of s & us, I would
probably use safe & unsafe as prefixes or better still encoded & unencoded
prefixes as IMHO encoded & unencoded gives "better" semantics on what the
variables contain.

I would consider refactoring the unencoded prefix to something "better"
later as encoded & unencoded tend to "blur" together... Based really on how
the unencoded variables were being used.

Remember the .NET Design Guidelines for Class Libraries suggests to avoid
abbreviations.

http://msdn.microsoft.com/library/de...reviations.asp

Just a thought
Jay
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:u%****************@TK2MSFTNGP14.phx.gbl...
| "Jeff Jarrell" <jj************@yahoo.com> schrieb:
| > This isn't a thought of my own invention. I have read it
(.net\hungarion
| > not) in a number of books and my eyes popped out the first time I read
it,
| > but in practice I found that with a few exceptions I am ok with this
| > style. I wouldn't convert an existing codebase or change coding
| > conventions on a continuing codebase.
| >
| > But I am starting a new codebase at work that has nothing to do with the
| > past. So I am trying to stay in the spirit of the .net conventions.
You
| > might want to look at FXCop. I find it way too rigid for my taste,
| > though.
| >
| > Here is a good discussion of hungarion\not by Richard Hale Shaw.
| >
http://www.richardhaleshawgroup.com/.../03/03/20.aspx
|
| Before discussing whether or not using the Hungarian Notation makes sense
| it's important we make sure that we are all referring to the same thing:
|
| Making Wrong Code Look Wrong
| <URL:http://www.joelonsoftware.com/articles/Wrong.html>
|
| I don't think that the Hungarian Notation as introduced by Charles Simonyi
| is completely obsolete, not even strict typing and OO make it obsolete.
|
| --
| M S Herfried K. Wagner
| M V P <URL:http://dotnet.mvps.org/>
| V B <URL:http://classicvb.org/petition/>
|
Nov 21 '05 #12
Hello Jeff. It seems like most of the other posts have been focused on the
merits
of Hungarian Notation, but because I've found myself in the same dilemma as
you, I'd like to give some input on the original question.

So, if you accept Microsoft's recommendation to avoid HN, how to handle the
following code?
dim User as new User
I've found that in most cases, the code I am writing to access an instance
of a particular class is in some kind of special context that can be used in
the variable name. In other words, I use the type of operation being
performed on the class to differentiate the class name from the instance
name. For example, if the person is selecting a User from a ListBox, my
variable name would be SelectedUser. If I'm getting ready to insert a new
User into a collection, I would name the variable InsertUser.

Now, admittedly, there isn't always an obvious choice for a "context prefix"
(perhaps because you are writing code that intentionally handles the class
in any context). Personally, I handle this in one of two ways. The first
is just to use the My prefix, as in MyUser. Using "My" has always seemed a
bit amateurish to me, but my aversion to HN is strong enough that it always
wins out over any fear that my fellow programmers would make fun of my use
of "My". The other way (which happens more as a result of my design rather
than another way to avoid this naming conflict) is to imbed the logic
which uses the instance in a method. For example, my code often contains
functions in this format...

Public Sub InsertUser(user as User)

I personally am not a fan of C#'s case sensitivity, but VB.NET's case
"awareness" can come in very handy in this situation. The Microsoft naming
standard specify that parameter names be in camelCase (and "user" is in
camelCase). So by following this naming standard you can differentiate
the class name (User) from the instance (user).

HTH.

- Mitchell S. Honnert



"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl... Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name it
that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will ultimately
be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading it.
(am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff


Nov 21 '05 #13
thanks for the coming back to the original question. i share a similar
feeling with respect to HN and at this point feel its ok to prefix the
instance. I am not sure I can keep my team consistent that with naming that
only differentiates in terms of case usage (c# a different story). I think
i am going to go with "aUser".

"Mitchell S. Honnert" <news@honnert~R~E~M~O~V~E~.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hello Jeff. It seems like most of the other posts have been focused on
the merits
of Hungarian Notation, but because I've found myself in the same dilemma
as
you, I'd like to give some input on the original question.

So, if you accept Microsoft's recommendation to avoid HN, how to handle
the
following code?
dim User as new User


I've found that in most cases, the code I am writing to access an instance
of a particular class is in some kind of special context that can be used
in
the variable name. In other words, I use the type of operation being
performed on the class to differentiate the class name from the instance
name. For example, if the person is selecting a User from a ListBox, my
variable name would be SelectedUser. If I'm getting ready to insert a new
User into a collection, I would name the variable InsertUser.

Now, admittedly, there isn't always an obvious choice for a "context
prefix"
(perhaps because you are writing code that intentionally handles the class
in any context). Personally, I handle this in one of two ways. The first
is just to use the My prefix, as in MyUser. Using "My" has always seemed
a
bit amateurish to me, but my aversion to HN is strong enough that it
always
wins out over any fear that my fellow programmers would make fun of my use
of "My". The other way (which happens more as a result of my design
rather
than another way to avoid this naming conflict) is to imbed the logic
which uses the instance in a method. For example, my code often contains
functions in this format...

Public Sub InsertUser(user as User)

I personally am not a fan of C#'s case sensitivity, but VB.NET's case
"awareness" can come in very handy in this situation. The Microsoft
naming
standard specify that parameter names be in camelCase (and "user" is in
camelCase). So by following this naming standard you can differentiate
the class name (User) from the instance (user).

HTH.

- Mitchell S. Honnert



"Jeff Jarrell" <jj************@yahoo.com> wrote in message
news:uH*************@TK2MSFTNGP12.phx.gbl...
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name
it
that"

Class Names are an interesting side. If we name them in a meaningful way
and then we name an instance of in a meaningful way there will ultimately
be a semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading
it.
(am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff


Nov 21 '05 #14
You should check out my new book about this and a lot more .NET coding
standards. You can pick up a copy @
http://www.cafepress.com/vsdntips.20412485.

=====================
David McCarter
www.vsdntips.com
"Jeff Jarrell" wrote:
Hungarion Notation is out but..

I am trying to keep the notion of naming things "it is what it is, name it
that"

Class Names are an interesting side. If we name them in a meaningful way and
then we name an instance of in a meaningful way there will ultimately be a
semantic collision.

For example,

In a VB6 way
dim oUser as new clsUser

In a .Net way
dim User as new User

When I read vb6 example, it jumps out at me whether I am refering to the
type or the instance. In the .Net way I am not sure from just reading it.
(am I using a static function in a type or a function that uses an
instances).

I am tempted to either suffix the type or prefix the instance. But thats
not in the spirit of .net now. Should I just get used to not immediately
recognizing the difference between an instance and a type?

thanks,
jeff

Nov 21 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jova | last post by:
Does anyone know of a good site where I can learn of this?
3
by: Robert Mark Bram | last post by:
Howdy All! Is there any difference between referencing objects and attributes with dot notation or bracket notation? Example, document.formname.controlname document Can I access...
6
by: S. | last post by:
if in my website i am using the sgml { notation, is it accurate to say to my users that the site uses unicode or that it requires unicode? is there a mathematical formula to calculate a unicode...
17
by: Thomas Lorenz | last post by:
Hello, I'm a little confused about object initialization. According to Stroustrup (The C++ Programming Language, Special Edition, Section 10.2.3) constructor arguments should be supplied in one...
4
by: Matthias | last post by:
I have been told not to use preceding underscores when notating data members for example. What kind of notation do you use in general? I have seen Microsoft uses hungarian notation a lot. Is that...
14
by: John T. | last post by:
I have a number in 8.8 notation that I wish to convert to a float....... 8.8 notation is a 16 bit fixed notation, so: 0xFF11 is the number 255.17 0x0104 is the number 1.4 0x2356 is the number...
2
by: funcSter | last post by:
I was asked to program using the Dutch Notation with C#. I am not familiar with the Dutch notation at all. I use the Hungarian. I asked a programmer friend "What is the Dutch Notation?" He...
19
by: | last post by:
Just seeking some advice (or solace)... Am I the only who's having trouble letting go of notation? Having extensive experience in C++ years ago (both before I jumped into VB3 in college and at...
22
by: bearophileHUGS | last post by:
>From this interesting blog entry by Lawrence Oluyede: http://www.oluyede.org/blog/2006/07/05/europython-day-2/ and the Py3.0 PEPs, I think the people working on Py3.0 are doing a good job, I am...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.