Stupid Question 101: Are there any coding standards documents for Net?
Recommendations, standards or rules to live by?
It does seem to me like most programmers follow a similar naming convention when working on the .Net platform, and when it comes to design- we do seem to agree (most of the time) on a higher level on at least a few things. But are there any coding standards documents most developers follow? Or do just continue doing what we have been taught by others forming our own standards based on what makes sense to us and the experiences we’ve had?
It probably is a combination- for me at least it is.
As for the question, are there any coding standards docuements for .Net? There are and they can be found underDesign Guidelines for Developing Class Libraries
It covers things such as:
Guidelines for Names
Type Design Guidelines
Member Design Guidelines
Designing for Extensibility
Design Guidelines for Exceptions
Usage Guidelines
And on a separate page covers asynchronous programming
Of course these are not the only coding standards documents that exist, but it does seem to be the recommended start for most developers. On Stackoverflow a user asked:
Are there any suggestions for developing a C# coding standards / best practices document? - and the Design Guidelines for Developing Class Libraries was recommended, as well as not trying to come up with your own coding standards. If you have some extra time I would recommend reading the replies as its a good read :)
Next question will be about StyleCop
Comments
Thank you, that is excellent advice! I'll see if I can get a hold of a copy and review it :)
I concur - The Framework Design Guidelines book is the bible on the matter. /Michael
This is also pretty widely used: "The IDesign C# Coding Standard, development guidelines, and best practices" http://www.idesign.net/Downloads/GetDownload/1985 /Emil
It's definitely worth taking a look at. From the back cover: "...the only definitive source of best practices for managed code API development, direct from the architects themselves".
Further to the last, 'Code Complete' by Steve McConnell is also a gem of a programming book. http://www.amazon.co.uk/Code-Complete-Practical-Handbook-Construction/dp/0735619670
Yes - you gotta love the Framework Design Guidelines. Quite possibly the best .NET book there ever written!
Very true. Should be required reading for any developer! Rapid Development, also from Steve McConnell is also very worth reading - very eye opening stuff.
StyleCop - http://stylecop.codeplex.com/ Works great with JetBrains ReSharper
Last modified on 2012-12-11