Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
181 views
in Technique[技术] by (71.8m points)

.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

question from:https://stackoverflow.com/questions/596062/net-naming-convention-for-id-anything-identification-capitalization

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...