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?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
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:
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").
I agree common usage is ID. This is because ID is an acronym 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.
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.