.NET Naming Conventions
Part of learning a new programming language is adopting the various industry best practices. The naming conventions used during software development can have a huge impact on future maintenance efforts. If no rules are followed then it becomes that much harder to read the code and figure out what is going on. This particularly important as developers with different skill sets come and go from IT departments.
Back in my Visual Basic days, the Hungarian style of naming variables and such was generally accepted as the way to do things. And in most cases I agreed. Sometimes people used the guidelines in redundant ways. For instance, class files would be named clsSomeClass.cls. The .cls extension is mandatory so why bother with the cls prefix? Anyway, it wasn't a huge deal, but something that I didn't agree with.
With the introduction of .NET, Microsoft has published a new set of naming conventions. They've dropped the Hungarian style of naming. Their reasoning is that the IDEs used for writing code these days are robust enough to provide data type specific information and so there's no need to encode such information in variable and object names. They also say that dropping the data type information will improve code portability.
Microsoft is right. The IDEs are pretty good these days. In particular, Microsoft's Intellisense does an excellent job of providing hints as to what should be typed in. So now all I have to do is drop the habit learned over several years of prefixing everything.
[Update November 13, 2003]
Microsoft's guidelines seem to completely ignore Windows forms programming. This is a strange oversight given that much of what's developed for Windows is forms-based. Anyway, the problem with the naming guidelines is that they don't describe how to handle a label and textbox that are related and should have a similar name. In VB 6.0, you'd probably call them lblName and txtName. But that's using Hungarian notation, which Microsoft seems to be moving away from. Unfortunately, I don't know of a useful alternative so it looks like Hungarian for form controls and Microsoft's guidelines for everything else.
