C# naming convention for constants?

The recommended naming and capitalization convention is to use PascalCasing for constants (Microsoft has a tool named StyleCop that documents all the preferred conventions and can check your source for compliance – though it is a little bit too anally retentive for many people’s tastes). e.g.

private const int TheAnswer = 42;

The Pascal capitalization convention is also documented in Microsoft’s Framework Design Guidelines.

Leave a Comment