TransWikia.com

How should the abbreviation for "identifier" be capitalized?

English Language & Usage Asked by Jeremyx on May 17, 2021

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?

5 Answers

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").

Answered by shipr on May 17, 2021

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.

Answered by calben on May 17, 2021

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.

Answered by BobbyJ on May 17, 2021

  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.

Answered by Ellis on May 17, 2021

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".

Answered by IMSoP on May 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP