tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

ID or Id?

18 Apr 2012 2 mins .NET, C#, Programming in general

Looks like there are two groups of developers. One writing ID and one writing Id. I’m in the first one, and I’m even not 100% sure why (except because my feelings are saying me, it’s “more” correct). But it looks like there’s no conclusion.

More and more I see the other option being used often (DbContext or HttpApplication to name a few), especially if you take into account properties like URL and so on. It even looks this is more common inside .NET Framework, but still, i.e. DBNull or System.Web.UI is an exception. Who knows…

Anyway, I’d like to ask you. What are your habits? Have you find some good pros (or cons) for one or the other? Or articles/papers/… about this naming? Share your thoughts in comments.

Update: In ”Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries (2nd Edition)“ I’ve found (link):

Two other terms that are in common usage are in a category by themselves, because they are common slang abbreviations. The two words Ok and Id (and they should be cased as shown) are the exceptions to the guideline that no abbreviations should be used in names.

Solved. On the other hand the DbContext and DBNull is still weird inconsistency.

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.