Hungarian Notation

G

Guest

Good or bad? I've always used HG in VB6, but the .NET guidelines say no.
I think it's useful as you can have similar named variables differentiated
only by identifier type, hence more variable options. What's the standard? Is
it still considered choice of team?

Many thanks for your thoughts on this

Ant
 
O

Otis Mukinfus

Good or bad? I've always used HG in VB6, but the .NET guidelines say no.
I think it's useful as you can have similar named variables differentiated
only by identifier type, hence more variable options. What's the standard? Is
it still considered choice of team?

Many thanks for your thoughts on this

Ant

I find them very hard to pronounce...
Otis
 
B

Bruce Wood

Personally, I think that HG is grossly overused. I thought that using
it even in C was a bad idea.

HG was originally created for programming in assembly language, where
it makes tremendous sense: you cannot tell just from a declaration what
type a variable is meant to be; you have to encode it in a name.

In C, HG was problematic: yes, you could tell at a glance what type
your variable was, but then if your variable declaration was so far
away that you couldn't easily find it and with it the type, then there
was something wrong with the way you were coding C, IMHO.

In C#, with Intellisense and the ability to declare variables as you
need them, it makes even less sense, and the arguments against HG
become even stronger. The best anti-HG argument is: what happens when
you change the type of a variable, property, etc? What happens when you
discover that you need that int property to be a decimal property?
Suddenly you have to re-engineer the property name everywhere it's
used, or live with a decimal property named iLinearFeet or something
like that. Yuck.

Intellisense will tell you what type a thing is just by mousing over
it. I see no reason for adding HG to that, especially given the
problems it brings with it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top