24

I'm a programmer and I often see the abbreviation ID (capitalized) in technical documents and code. Is this correct, or should it be id?

4
  • 3
    Capitalization (in code) is specific to the conventions of the programming language, not the language used for naming the variables (usually English). In C#, you'd encounter Id for a public property, id for a local variable, _id for a private property, and ID for a constant value. For technical documentation, it varies: if you're referring to a code variable/property/const, then you should use the same capitalization. – Flater Oct 13 '17 at 9:27
  • 2
    @Flater - If you want to see real fireworks, migrate this to a programming Stack Exchange. I bet it would engender passionate responses. – iMerchant Oct 13 '17 at 9:44
  • 1
    @iMerchant: Regardless, those passionate responses would all be advocating the use of different capitalizations for different circumstances (even if they can't agree on which to use where). – Flater Oct 13 '17 at 10:05
  • Agreed. Ideally the OP would clarify which language he is using. But since his question is nearly five years old and he’s only accumulated 61 rep points in the meantime, it’s safe to assume he is long gone and any of our comments/answers are moot at this point. But hey, it’s still fun to comment regardless. As for the fireworks, who doesn’t like watching fireworks? – iMerchant Oct 13 '17 at 10:17
27

In English, both letters should be capitalized ("ID"). The lower case word "id" has a specific meaning that does not invoke the meaning "identifier," or "identification." In documentation it should be spelled out (ID abbreviates two different words, after all), or be in all caps.

However, programming languages are not exactly English. Styles vary widely. The de facto standard nowadays seems to be CamelCase, in which even identifiers such as acronyms capitalize the first letter only:

Id, myId, aSpecificId

But the whole question is prone to "religious wars" in the programming world, and there is no definitive answer. Some insist that the first letter always be capitalized, some the first letter only of following words (sometimes known as "camelCase" to distinguish from "PascalCase").

11
  • 4
    ID abbreviates identification. Which other word? Indonesia? – Synesso Jul 24 '15 at 2:04
  • 5
    In terms of programming capitalising both seems odd to me. It's not usually NOT an acronym for "identity document" or similar in these contexts, it's simply an abbreviation of "identifier" as it's usually a number or string. I think this is why it's very commonly camel-cased. – Thor84no Aug 19 '16 at 8:54
  • 2
    Yes, as @Synesso asks, what is the other word in included in the so-called acronym? In English we have many homonyms, and we don't artificially capitalise one variant to differentiate it from other variants. Although, I must admit I'm a software developer, and the all upper case version annoys the crap out of me, and interferes with word separation in longish class,property, function, etc. names. – ProfK Sep 13 '16 at 2:51
  • 1
    The de facto standard nowadays seems to be CamelCase. More often than not, there are different capitalizations (in the same language) based on what sort of variable you're trying to name. In C#, you'd encounter Id for a public property, id for a local variable, _id for a private property, and ID for a constant value. – Flater Oct 13 '17 at 9:30
  • 1
    Re. English language: 1. "id" meaning "part of the mind" should not be capitalized. 2. "ID" meaning abbreviation for "identifier" or acronym for "identifier document" should be capitalized... – Tom Oct 17 '18 at 22:11
8

I agree common usage is ID. This is because ID is an abbreviation for identity document. So when ID is used for identifier it has an understood meaning. Language does evolve in this way.

On proper English. Identifier is only one word so I choose to use Id. Such as PhD, Mr, Ms, SciFi, Jr, Sr, Lt, Lt Col, and Prof. I'm sure more examples can be found.

The only counter example I can find is TV and even then I wouldn't be surprised if it evolved as well from a hyphen or two words.

If you're programming, as most people searching for this are, the way you spell it in code is determined by the coding standards put forth by your architect or lead.

Edit: Changed word acronym to abbreviation. The content still maintains such as in GMO, genetically modified organism. If anyone doesn't believe Identity Document is a thing, https://en.wikipedia.org/wiki/Identity_document where it will show that ID is used as an abbreviation for Identity Document.

4
  • You should probably edit to account for the fact that "ID" actually "Identity Document"? There's an edit link below the question. – Solomon Ucko May 22 '18 at 23:47
  • "Identifier" and "identity document" aren't the same thing. However this great answer does service to both usages. – Jirka Hanika Jul 11 '18 at 15:54
  • 1
    I'd add that "identifier" is a technical term, plenty of industry standards use it (frequently written as "id" or "ID", I wasn't able to find a standard capitalizing as "Id"), and one can often locate the closest applicable standard and follow its practice in similar cases. Furthermore, be sensitive to whether the context is actually English prose, table heading, a programming language with its own capitalization rules, etc. – Jirka Hanika Jul 11 '18 at 15:54
  • 1
    Although "ID" certainly can stand for "Identity Document", it is not correct to say that it always does so: in "GUID", the "ID" stands simply for "identifier". It may be that the "Identity Document" usage is the original, and other uses came from there, but I've not yet seen a reference proving that. – IMSoP Jan 29 at 13:20
3

In common English, ID is used from common practice. In programming, though, it's sometimes id. The reason it's capitalized for common English is that there's no period at the end of the abbreviation, unlike abbreviations like tsp., lb., or abbr. Abbreviations also see demotion from capitalization by common use. Capitalization in programming isn't dictated by capitalization in common English but instead by the group of programmers. PascalCase or camelCase or snake_case, it comes down to preference and convention in the language.

8
  • 3
    I am a programmer, and have been for decades, but I have never once used id. Not even in source code, let alone in the documentation. It's always ID. Same for my colleagues. So I'd like to see your statement backed up with actual data. Otherwise it's just your anecdotal evidence vs. my anecdotal evidence. – RegDwigнt Jan 23 '13 at 21:16
  • Hard thing to find. It must be just anecdotal evidence. I'd never seen id capitalized ID before, but almost all of my experience in programming has been academic, either research programming or otherwise academic programming. It may be one of those academic vs corporate coding differences I seem to discover all the time. – calben Jan 23 '13 at 22:40
  • 2
    I don't think you're going to get much anything other than anecdotal 'evidence' on this one though. The answer to the original question is that it can be either. I've seen more of id in my programming experience. – calben Jan 23 '13 at 22:43
  • The Java libraries (which became something of a de facto standard) use mixed case even for acronyms that are usually all caps. So: transactionId, cf. siteUrl. C and C++ programmers not influenced by Java would have transactionID or transaction_id, or, for the hard core, x. My preference is for the all caps version even in Java. Outside source code I would always set in all caps, to avoid confusion with the Freudian construct. – Andrew Lazarus Jan 24 '13 at 21:29
  • 2
    my id says Id use id, ID, id, id., Id or even iD and most readers will discern the proper meaning – Kirby Aug 23 '16 at 4:02
0
  1. In English: ID has been arbitrarily chosen to be uppercase, only for convenience, only to distinguish it from the other meanings of the word "id". It is not an acronym like SQL, ASCII or NASA. (Strictly speaking it is incorrect, but now it is the convention.)

  2. In programming, if the convention for your specific programming language is requiring camelCase or PascalCase, then you should simply use id or Id (eg: shopId, ShopId), and iD and ID are incorrect. Just like for SQL you should use sql or Sql.

6
  • I'd say "ID" is an initialism for "Identity Document". It's not an acronym, no, but neither is SQL in my book. NASA and ASCII are acronyms though, as far as I am concerned. If the word being abbreviated is "identifier", I'd use lower case "id" as a starting point, then let the capitalization convention of the language and project take second effect. – Victor Nov 4 '19 at 12:47
  • 2
    @victor, ID is more far more commonly an abbreviation of "identifier" (or "identification"), not Identity Document. I've worked in several industries and have not encountered the latter. It's likely scoped to legal fields, etc. – isherwood Jan 6 '20 at 15:41
  • @isherwood but your use of capitalized "ID" implies it's an initialism. As far as I'm concerned, abbreviations aren't capitalized. So "ID" is different from "id." or "id". – Victor Jan 6 '20 at 16:12
  • It's not my use, as most of the answers on this page indicate. – isherwood Jan 6 '20 at 16:12
  • 2
    @Victor you seem to rely on the notion that an initialism must be formed from the initials of multiple words, which is not the case. While that is where the word "initialism" comes from, it is not a hard and fast requirement. Initialisms are abbreviations that are pronounced one letter at a time. For example, ECG is an initialism, even though "electrocardiogram" is one word. Similarly, ID is an initialism and can correctly be capitalized even if it derives from "identity" or "identifier" – Flater Jan 29 at 13:48
-1

Although it might be logical to treat "id." as a straight-forward abbreviation for "identity" or "identifier", common usage is to both write and pronounce it as the two separate letters "I" and "D".

See for instance Lexico (based on Oxford dictionaries), the Guardian Style Guide (UK), Chambers, Merriam-Webster (note that some of these feature multiple terms spelled with variants of "id", "Id", etc, but all show "identity" abbreviated to "ID").

I can think of a few reasons why this might be, but have been unable to find evidence for any of them:

  • It may have originated as an abbreviation of "Identity Document", and then became applied more generally - for instance, the phrase "show me your ID" may well be referring to a document, while "make a positive ID" certainly does not, but may be a later usage.
  • The word "id" does have at least one established meaning, although one not used all that commonly outside philosophy, so it's influence is likely to have been small.
  • The first sound in "identity" is the long vowel used when saying the letter "I", not the short vowel which would naturally be read from the spelling "id". A single syllable pronunciation with a long vowel would probably be written "ide.", and would be the same as the very common word "I'd" (abbreviating "I had").

Whatever the reason, "ID" is the common spelling, and in that sense "correct".

As ever, there are exceptions to the rule:

  • When combined into a longer abbreviation that is pronounceable, that abbreviation might come to be spelled as such in some style guides, e.g. you might decide to accept "Guid" (pronounced "goo-id") for "GUID".
  • In some contexts, such as the "camelCase" names often used in programming, it might be considered inconvenient or ugly to have multiple capital letters in a row, e.g. you might decide to use "userId" rather than "userID".
1
  • @Flater I have now added two references for the spelling itself, which is more than any of the other answers on this page. I haven't been able to find any references to the etymology behind that spelling, which is why I included multiple possibilities. – IMSoP Jan 29 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.