The names that you give to your variables will not have that much impact on how your application runs on the user's workstation, but it can affect the clarity of the source code. In the days before .NET, many Windows programming languages used a system called Hungarian Notation to craft variable names. Such names helped to communicate information about the data type and usage of a variable to anyone reading the source code. Unfortunately, the rules used to define Hungarian variable names were somewhat complex, and varied not only between programming languages, but between programmers using the same language. When Microsoft released .NET back in 2002, its documentation included various programming recommendations. One of those recommendations was, "Stop using the Java programming language." Another recommendation encouraged programmers to cease from using Hungarian Notation, and instead embrace a new system that used casing rules to differentiate variables. The rules state that all variable names should employ mixed-case names (where each logical word in the variable name starts with a capital letter and continues with lowercase letters). The only differentiation comes in the capitalization of the initial letter.
In the interest of full disclosure, I must tell you that I modified the original recommendations slightly from the documentation supplied with Visual Studio. The original rules were a little more complex when it came to field and method parameter names. Personally, I find the two rules listed here to be adequate for my needs. You might give a local variable a name like lookInThisVariable, which capitalizes the first letter of each word, but not the initial letter. If you defined this variable as a field instead, you would change its name to LookInThisVariable, capitalizing the first letter. |