Because it's a misconception that the literal type of a variable is what's
used for the tag. Your question presents a misuse of Hungarian, and thus
isn't a useful question in the context of discussing correct Hungarian.
It distracts from questions that _are_ useful, and thus is a red herring.
If you don't know the type of something then you will have
trouble looking it up. This is probably ok if it's your own project but
that
just because you remember the type of most variables.
If you know _how_ the variable is used, _what_ it represents, then you
know the tag. If you don't know those things, you need to learn them
before working on the code. And that's true with or without Hungarian.
I'm not sure how to respond here. Are you trying to imply I have no
experience with Hungarian.
You don't seem to have experience with correct Hungarian. Whether you do
or not I can't say.
All I can comment on in the context of replying to your previous post is
that in code where correct Hungarian is used, you'd never see a variable
named "intCount" or "lngCount". The name "Count" indicates to me that the
variable is a count of something, which means that the correct Hungarian
tag would be "cXXX" where "XXX" is the type tag for whatever it is you're
counting (and may or may not actually be three characters).
Clearly you've never worked in a team if you think there is no problem
That's a really dumb statement, if for no other reason than that it's
easily proven false. Not only have I worked on a wide variety of teams,
the first team I worked with professionally is the one in which I learned
Hungarian. It worked very well, and did not cause any problem with
inconsistent tags.
Your statement "If you are using real Hungarian" says it all really
because
in my experience everyone has their own version. Do you have some
document
that specifies all the hungarian notation?
Well, the definitive document would be Charles Simonyi's original thesis.
I don't have a link to that handy, but Doug Klunder's write-up of the
convention is IMHO more accessible anyway, and does a reasonably good job
of describing the basic foundation of Hungarian.
There are a number of copies floating around. Here is one:
http://www.byteshift.de/msg/hungarian-notation-doug-klunder
As Doug Klunder was a part of one of the original production development
teams where Hungarian was actually used in practice (Multiplan at
Microsoft, if I recall correctly), I would consider his description of
Hungarian almost practically as definitive as the original thesis.
You may find it helpful to review the Wikipedia entry on Hungarian:
http://en.wikipedia.org/wiki/Hungarian_notation
In particular, where I talk about "correct Hungarian", this most closely
correlates to "Apps Hungarian", and the incorrect Hungarian used in the
Win32 API would be "Systems Hungarian". Note also that of the opinions
listed in the Wikipedia article arguing against Hungarian, they are
specifically regarding the "Systems" manifestation, and since that's not
correct Hungarian, they aren't useful in discussing whether Hungarian
itself is useful, flawed, etc.
Does this docuement list
everything that a developer might prefix? What about instances of their
own
classes?
Hungarian describes quite well how to create tags for your own data types
and usages. But that's irrelevant...the examples you provided are using
tags that appear to be assigned to built-in types, which is almost never
correct in Hungarian (exceptions being where the data in question is used
only as the built-in type itself...a common example of that exception
would be the use of "b" as the type tag for a byte, as in "rgb", an array
of bytes where all you care about is that it's bytes).
Pete