In programming variables keep data and for the code to be more understandable the name of a variable should suggest its purpose. Here are some recommendations for naming variables:
- The name should be short and descriptive and to explain what the variable serves for.
- The name should only contain the letters a-z, A-Z, the numbers 0-9, and the symbol '_'.
- It is accepted in C# for the variables to always begin with a lowercase letter and to contain lowercase letters, and each next word in them should start with an uppercase letter (this naming is also known as
- You should be careful about uppercase and lowercase letters, because C# makes a difference between them. For example
Ageare different variables.
- The names of the variables can not coincide with keywords in the C# language, for example
intis an invalid name for a variable.
|Although using the symbol