Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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

share|improve this answer
    
Thanks. I'm not concerned with the programming world so much, but proper English usage. (BTW -- most C/C++ libraries do NOT use camel case style, so I would not say this is NOT the de facto style standard...) :-) –  Jeremyx Jan 23 '13 at 20:15
    
The "C-style" programming style is to lower-case the first character of variable names, upper-case the first character of class names. (Of course, Microsoft does not follow this de-facto industry standard, but pretty much everyone else does.) –  Hot Licks Feb 24 at 16:51
    
ID abbreviates identification. Which other word? Indonesia? –  Synesso Jul 24 at 2:04

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.

share|improve this answer
1  
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
1  
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
    
After trying many programming styles over the years, I finally settled on strict camel-case with making even abbreviations lower case (as in siteUrl). The reason is that I really like sticking to whatever the rules are for the first letter of an identifier being capitalized, and this makes it easier. For example, if I always use upper case abbreviations, but the style I'm following asks for lower case on the initial letter of method names, which wins? instance.URLHandler() or instance.urlHandler()? The former doesn't look as much like a method name anymore, while the latter does. –  David M. Brown Jun 21 '14 at 20:20

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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