I am in the process of unifying these inconsistent naming conventions and this one problem has been a bit driving me crazy lately.
In the code base I am working with has
Microsoft has updated its guidelines since this question was asked.
In the MSDN article Capitalization Conventions (.NET Framework 4.5), there is a section named Capitalizing Compound Words and Common Terms. Within the table in this section, the following capitalization guidelines are given for the abbreviation for "identifier" when naming identifiers:
System.Attribute.TypeId
)var id = 42;
)I always capitalize ID when it is an abbreviation for identifier, etc. It just looks wrong and makes me think of Freud, otherwise -- which is definitely not a good thing.
If you would care to check the dictionary, you would find that ID is not treated as an abbreviation. In fact, the form is specified as ID or I.D. there. This is probably because it came from an expression like "Identity Documentation" or "Identification Data", and was not originally taken as a short form of "Identifier". Thus the form ID is not only recommended, but is directly supported by the dictionary.
Capitalization is for 2 letters acronyms. UI, IP, etc.
"Id" is an abbreviation for Identifier, so it should stay pascal cased.
The latest guidance is "Id", for more on this and others (e.g. "Ok"), see my post on the very latest Framework Design Guidelines (2nd edition)
I think that the reason some people are using 'ID' instead of 'Id' is because it is a subset of 'GUID', 'UUID' or 'UID' that are generally capitalized.
I agree that it should be 'Id' but I think that it strongly depends on the context because in some environments it might be more appropriate to use 'ID'.
So to me 'ID' is a technical term and a subset of the above or used to refer either one of these technical terms whereas 'Id' is the shorthand to any kind of identifier and in a non-technical context when you need a person to read it like in your public APIs or UML you should (in my opinion) use 'Id'.