How to use Pascal Casing and Camel Casing for short cuts in C #?

A short abbreviation is similar to an identifier or database that has only 2 characters.

How to name them in pascal (for property or class names) and for Camel Casing (input diagrams, arguments)?

I know that each company has its own standard, but I am looking for a more common standard.

eg. with pascal:

ProductID or ProductId? IDOfProduct or IdOfProduct? DBRate or DbRate? RateOfDB or RateOfDb? 

and when the camel shell:

 productID or productId? idOfProduct? dbRate? rateOfDb or rateOfDB? 
+8
c # coding-style naming-conventions camelcasing pascalcasing
source share
3 answers

According to MSDN (or Msdn :)

  • Use both characters of two-character acronyms, except for the first word of the identifier with a camel line.

  • Use only the first character of abbreviations with three or more characters, except for the first word of the identifier with a camel line.

  • Do not use any of the characters of any abbreviations, regardless of their length, at the beginning of the identifier with a camel line.

More here

+4
source share

It does not matter.

This is truly a personal preference. When a short abbreviation finishes the name, I use both values:

 testDB or TestDB 

When a short abbreviation starts a name, I just capitulate the first, because I think it makes it more readable:

 dbTest or DbTest 

All about readability . Whatever you choose, do it consistently.

+2
source share

Use both characters of two-character acronyms, except for the first word of the identifier with a camel line.

A property named DBRate is an example of a short acronym (DB) used as the first word of an identifier with pascal. A parameter named ioChannel is an example of a short acronym (IO) used as the first word of an identifier with a camel shell.

Check out this link.

http://msdn.microsoft.com/en-us/library/ms229043(v=vs.100).aspx

0
source share

All Articles