So what are the right naming conventions? How do you make sure your code is keeping up with today's standards? If you'd show off your code to your coding buddies, would they laugh?
Believe it or not, naming conventions effect whether someone determines that your code is messy or not. Other factors also determine this, but naming conventions play a large role.
What are the current most popular naming conventions? There are a few popular ones but people tend to incorporate them in their own flavors to suite personal taste.
Probably one of the most well-known naming conventions is the Hungarian Notation, originally created by some...well Hungarian guy who worked at Microsoft, Charles Simonyi. Hungarian notation may have been ideal in those days, but it is now(in most cases) unneeded.
One of the key features in HN was the ability to easily point out a variables type in a specific part of code without having to scroll back up to where it was defined. This was generally done by attaching lower case letters to the beginning of the variables name. For example if we had a variable dogname that was a string it would be renamed to something like strDogName. Simple, eh?
So why is Hungarian Notation bad? Well, one reason that it is now heavily avoided is because it's more then often unnecessary. Most IDE's like Microsoft's Visual studio have implemented features to easily identify a variables specifics without having to scroll back up to the definition. Microsoft's specific implementation is known as Intelli-sense. Because of these new features in today's more modern IDE's, Hungarian Notation is now deemed seemingly next to useless and generally adds to the noise.
The two other more ideal notations are Pascal, and Camel notation. In Pascal notation each word in the variable would start with a capital letter. Our variable dogname would be renamed to DogName.
Camel notation is like Pascal notation, except the first letter of the variable name is also lower case, so dogname would instead be dogName.
The Microsoft industry standard uses a combination of both the Pascal and Camel notation. Pascal notation is used for Class Members, where as Camel notation is used for method arguments and variables defined within a method.
The Microsoft naming convention. As much as we dread Microsoft, at least I can sleep knowing they did something right. On a side note, if you look at any of the API's Microsoft's made, like DirectX for example, they don't necessarily follow their own conventions.
Comments? What conventions do you use? Do you still use Hungarian? Why?