I have a longtime habit of naming things like UserID with the i and the d capitalized, but FxCop doesn't seem to like that and keeps recommending Id.
Which do you use and which do you think is correct?
Published Thursday, August 12, 2004 9:30 AM by AndrewSeven
-
James Steele
firefox
Jim Bolla
Steve Hall
Mike Barger
Wim Hollebrandse
Nasseam Elkarra
AndrewSeven
Michael Henderson
Søren Lund
Darrel
JS Greenwood
Make sure you are consistent... and make sure you are obeying the laws. Therefore, make sure you are always using Id. The rules are there for a reason. Don't let your personal emotions get in the way of doing what's right.
Jim Smith
I vote for ID. One reason is that the plural looks better. Consider: "One ID, two IDs", versus "One Id, two Ids". "Two Ids" looks like it should be written as "Two Id's", but then it gets confused with a possessive ("enforce the Id's uniqueness") or an is/has abbreviation ("my Id's changed recently").
Carl
Just came across this one. I should note that Id is also a psychological term coined by Freud. That being the case, ID seems a good way to differentiate the former. The previous poster mentioned "two Ids", which sound more like something that came out from a psychology book than from a program.
Esteban
I think the mistake was that an abbreviation was chosen in the first place! Abbreviations are nasty.
They should have picked an acronym perhaps, like DI - Data Identifier.
Jake Collins
see MSDN
Capitalization Rules for Acronyms
msdn2.microsoft.com/.../ms229043.aspx
"NOTE:
The two abbreviations that can be used in identifiers are ID and OK. In Pascal-cased identifiers they should appear as Id, and Ok. If used as the first word in a camel-cased identifier, they should appear as id and ok, respectively."
serhio
It's simple - if you go according to CamelCase or pascalCase, then it follows that for the common rule is to start each new word with a Uppercase letter, thus identity document would become: ID, BUT, BUT, BUT, in our case the word in question is: identity or identifier, thus it can only become Id, because it's one word only.
werner
I'm going for ID.
First of all, it's the accepted norm in every day use. Secondly it is in accordance with the .NET naming conventions. Lastly a good number of people seem to be under the impression that ID actualy stands for Identification, and while this seems to be what most people think, it did originaly stand for Identification Data/Document. Hence it is, in fact, an acronym AND an abbreviation.
Chris