TechShri from Shriniwas Wani

Custom Search

20 February, 2008

Notations in C#

Naming conventions followed in C#:

Pascal casing on method names/ Class names where the first character is capitalized.

Camel casing on variable names where only first letter small and next connectible.

Hungarian notation specifies that a prefix be added to each variable to indicate its type e.g. int iAccountNo ;

In C# the Pascal and camel Casing are used in combination.



About variable names :

  1. You can’t start an identifier/variable name with a digit.
  2. You cannot use any of the C# keywords as identifier / variable names, C# does allow you to precede a keyword with an @, allowing it to be a legal identifier. For example, @for is a valid identifier. But its not recommended.
  3. C# is a case sensitive , so use of variable Total instead of total will cause an error.


Labels:

0 Comments:

Post a Comment

<< Home