views:

54

answers:

2

What is the proper naming convention in C# for the following user related properties?

Social Security Number: SSN or Ssn? Date of birth: DOB or Dob?

+6  A: 

Acronyms consisting of more than two letters should capitalize only the first character (so that would be Ssn and Dob). Out of personal taste (and upon the advice of that MSDN page), I would either expand the terms to their full length (SocialSecurityNumber or DateOfBirth) or find alternative terms to use, as those don't look very appealing to me.

Adam Robinson
+1 for the pointer.
CesarGon
I intentionally ignore that guideline all the time because I feel it junks up the code. Personally I think a lot of those guidelines are totally arbitrary. It's even worse if the acronym (of which there are plenty in telecom) spells a word.
Josh Einstein
junks up the code? I'd rather use an API with `SocialSecurityNumber`, which is self documenting, than SSN (or Ssn for that matter)
Sander Rijken
+5  A: 

The general naming convention is no to use abbreviations. I think SocialSecurityNumber and DateOfBirth make much more sense than the acronyms.

If you do want the acronyms, use Ssn and Dob for three letters and more.

Sander Rijken
+1 for the suggestion to avoid abbreviations.
CesarGon
On a pedantic note, SSN and DOB are acronyms, not abbreviations ;) +1 for having the same answer as I did, though.
Adam Robinson
@Adam: Being even more pedantic, and following the most commonly agreed-upon conventions, SSN and DOB *are* abbreviations and also initialisms. They are not acronyms. Please see http://en.wikipedia.org/wiki/Initialism for an in-depth explanation. :-)
CesarGon