Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET naming convention for "ID" (anything identification: Capitalization)

I am in the process of unifying these inconsistent naming conventions and this one problem has been a bit driving me crazy lately.

In the code base I am working with has no convention regarding "ID"; "ID", "Id" and even "iD" are used inconsistently.

****Question**: In .NET, how do you guys capitalize "ID"? For an example, nodeID, nodeId? FolderID or FolderId?

****Edit**: How about plural cases? then should I do "NodeIDs" or "NodeIds"?

Thanks

like image 315
dance2die Avatar asked Feb 27 '09 18:02

dance2die


People also ask

Is ID supposed to be capitalized?

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.

Should acronyms be capitalized C#?

DO capitalize both characters on two-character acronyms, except the first word of a camel-cased identifier. DO capitalize only the first character of acronyms with three or more characters, except the first word of a camel-cased identifier.

What is the convention called for capitalization in variable names?

Pascal case -- or PascalCase -- is a programming naming convention where the first letter of each compound word in a variable is capitalized. The use of descriptive variable names is a software development best practice.


1 Answers

Capitalization is for 2 letters acronyms. UI, IP, etc.

"Id" is an abbreviation for Identifier, so it should stay pascal cased.

like image 179
Romain Verdier Avatar answered Oct 13 '22 22:10

Romain Verdier