Hungarian Notation and Smelly Code

While doing some research for a coding standards document, I found a big wiki discussion on the pros & cons of Hungarian Notation. I started out programming with Pascal, then C (LPC actually), then C++, then VBA, then javascript, then VB, then C# & VB.NET. Maybe there were some other languages in there, too.

So, I instinctively use Hungarian Notation, yet I’m reading that it’s a bad idea. That it only handles basic types, not objects (most of my variables are objects anyhow), that it obfuscates code, that it’s “yucky”, etc. Seems like Microsoft has gotten away from it in their coding guidelines, too.

Seems like the traditionalists are largely in the pro-HN camp, which makes me think that in 10 years you won’t see very much HN at all. Although who knows what code will be like then.

Lastly, I got a kick out of the CodeSmell article. It refers to an experienced coder’s ability to look at code & somehow sense that something “could” be wrong with it, without exactly knowing what. Hence the “smell” aspect … it smells like it could be bad, but you’re not as certain as if you could see it, touch it, etc.

0