Dec 112012
 
 December 11, 2012  Posted by at 11:32 pm Not So Stupid Questions, Uncategorized Tagged with: , , , , , ,  Add comments

[To celebrate my first year of programming I will ask a ‘stupid’ questions daily on my blog for a year, to make sure I learn at least 365 new things during my second year as a developer]

Recommendations, standards or rules to live by?

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 under Design 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

  9 Responses to “Stupid Question 101: Are there any coding standards documents for .Net?”

  1. http://www.amazon.com/Framework-Design-Guidelines-Conventions-Libraries/dp/0321545613/ref=dp_ob_title_bk

    Is really the only book you’ll need in your bookshelf regarding the topic 🙂

    –larsw

    • Thank you, that is excellent advice! I’ll see if I can get a hold of a copy and review it 🙂

      • 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”.

  2. I concur – The Framework Design Guidelines book is the bible on the matter.

    /Michael

  3. This is also pretty widely used:

    “The IDesign C# Coding Standard, development guidelines, and best practices”
    http://www.idesign.net/Downloads/GetDownload/1985

    /Emil

  4. 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

    • Very true. Should be required reading for any developer! Rapid Development, also from Steve McConnell is also very worth reading – very eye opening stuff.

  5. Yes – you gotta love the Framework Design Guidelines. Quite possibly the best .NET book there ever written!

  6. StyleCop – http://stylecop.codeplex.com/

    Works great with JetBrains ReSharper

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

What is 12 + 11 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)