Q:

Should the variable be named Id or ID?

This is a bit pedantic, but I've seen some people use Id as in:
private int userId;
public int getUserId();

and others use:
private int userID;
public int getUserID();

Is one of these a better name than the other? Why? I've seen this done very inconsistently in large projects. If I were to set a standard which would most people be familiar with? Which is the conventional standard?

A:

Consistency is king; pick one or the other, but do it consistently everywhere.
That said, I prefer the first variation, because it doesn't violate camelCase (doing so means you have two style rules to remember, not just one).  
Two capital letters is sometimes used because of this, but an ID is really just a form of Id-entification.

A:

TL;DR: In the context of .NET class libraries, Microsoft recommends that you use Id.  This is slightly counter-intuitive, since it's a rare example of an abbreviation that is allowed / recommended (abbreviations are generally frowned upon).
If we're talking about C# or .NET class library conventions, Microsoft has some fairly well defined naming guidelines available.  They are well thought out, with many explanations on a variety of issues - actually, every developer should take some time to read the entire Design Guidelines section.
When it comes to acronyms, the rule of thumb is: for two letter acronyms, you tend to keep them upper case (where Pascal case is applicable), so e.g. IOStream might be the name of a class.  For a longer acronym, you lower case the rest of the acronym, e.g. XmlDocument or HtmlParser.  This is actually a mostly unambiguous rule (there's no confusion as to where the one word ends and the next begins, unless you're chaining two-letter acronyms), and you get used to it very quickly.
So, is it ID, or Id?  Well, according to Microsoft, it might not be what you think:

Acronyms differ from abbreviations in that an abbreviation shortens a single word. For example, ID is an abbreviation for identifier. In general, library names should not use abbreviations.
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.

Anecdotally, I'm not actually sure when this distinction started appearing in the guidelines, but a few years back (around 3.0 / 3.5) the general naming trend in class libraries went from ID to Id.

A:

The most important rule to follow in these cases is consistency: Do as everyone else does.
For instance, look at your language's XML APIs to see how they do it.
Java names classes like SAXParser and DOMException, .NET names classes like XmlDocument.
Based on that, I'd say "ID" in Java, "Id" in C#.
However, I've seen that Java EE 6 has an annotation named @Id (see documentation), so it seems Java considers "Id" to be just a normal word.

