In my last post, I had collated a list of seven must read, free EBooks for .NET Developers, and a number of people found the list to be useful. Encouraged by this, I have put together a similar list of standard guidelines/checklists for .NET /C# developers.
While it may not be a huge stretch in coming up with such a document, the key lies in implementing these standards using internal trainings, peer reviews, check in policies, automated code review tools etc. You can take a look at FxCop and StyleCop for automating the review process, and you can customize the rules based on your requirements.
So here we go. The order is not significant.
1 – IDesign C# Coding Standards
IDesign C# coding standards is a pretty good and compact (27 pages!) coding standards document. It covers naming conventions, best practices, and framework specific guidelines.
Example:
![image_thumb[8] image_thumb[8]](http://www.marlabsblogs.com/wp-content/uploads/2011/06/image_thumb8.png)
The document even has guidelines for project settings, build configuration, versioning etc.
Download IDesign C# Coding Standards
2 – Encodo C# Handbook
Encodo C# handbook is more recent and has 72 pages of guidelines on structure, formatting, and naming. It also has a ‘patterns and best practices’ section, which is a must read for any .NET/C# developer.
![image_thumb[14] image_thumb[14]](http://www.marlabsblogs.com/wp-content/uploads/2011/06/image_thumb14.png)
You can download the handbook here:
Download Encodo C# Handbook
3 – Microsoft Framework Design Guidelines
MSDN has a section on guidelines for designing class libraries, which covers a set of best practices related to type design, member design etc. You can find it here:
Read the Design Guidelines for Developing Class Libraries
4 – Dennis’ C# Coding Standards Document
Dennis created an initial version of C# coding standards, which was published as the Philips Health Care C# coding standards document (~70 pages). The document categorizes guidelines for areas such as naming, exception handling, control flow etc.
- Update: The Initial Version I have linked here has now been superseded by the Coding Guidelines for C# 3.0 and C# 4.0. Paul Jansen of Tiobe will update his site soon with the new version. In the meantime, you can download the guidelines and a few companion documents here:
http://csharpguidelines.codeplex.com/
5 – Microsoft’s All-In-One Code Framework Coding Guideline
Microsoft’s All In One Code framework has a coding style guideline document. The Microsoft All-In-One Code Framework is a free, centralized code sample library provided by the Microsoft community team. It has typical code samples for all Microsoft development technologies along with a guideline document on code styles.
Download All In One Code Framework Guideline Document
6 – Brad’s Quick Post on Microsoft Internal Coding Guidelines
Brad had a post on Microsoft Internal coding standards. It is a short post that delves into styling and naming conventions.
Read Microsoft Internal Coding Guidelines Post
7 – Mike’s C# Coding Style Guide
Mike Kruger (Sharpdevelop) has published a 13 page C# Coding Style guide. Again, the focus is on casing, naming conventions, declaration style etc.
Download C# Coding Style Guide