views:

815

answers:

9

Which is the best book for .NET coding guidelines?

+11  A: 

Microsoft's Framework Design Guidelines, by Krzysztof Cwalina and Brad Abrams. It has a nice chapter on C# coding conventions. You can get it in the MSDN library.

TraumaPony
+2  A: 
mattruma
+2  A: 

I consider the book my Krzysztof Cwalina and Brad Abrams mentioned above by TraumaPony to be the definitive .NET guidelines book. In fact I tend to refer to is as "the bible" and use it to wave at people whenever they try to make a case for alternative approaches.

There is a second edition either out now or soon so worth checking that one out.

Shaun Austin
+1 There's also a 9 page digest free online. http://code.msdn.microsoft.com/fds/Release/ProjectReleases.aspx?ReleaseId=873
MarkJ
A: 

+1 for Practical Guidelines and Best Practices. I've also gotten some mileage out of Enterprise Solution Patterns for Microsoft .net framework. (Bonus: it's free)

tom.dietrich
+2  A: 

Forget books, just use FxCop.

FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements. Many of the issues concern violations of the programming and design rules set forth in the Design Guidelines for Class Library Developers, which are the Microsoft guidelines for writing robust and easily maintainable code by using the .NET Framework.

It's based upon the Design Guidelines for Class Library Developers. You could just print those out if you want a book.

Frank Krueger
+1  A: 

How about SubMain's coding standards. They're available as a free download from the sponsored link at the right there.

gbjbaanb
+1  A: 
Seb Nilsson
+1  A: 

You can consider using StyleCop (http://blogs.msdn.com/sourceanalysis/)

starec
A: 

The best guidelines book is the one that all your teammates have read and wholeheartedly agreed with.

Constantin