Are There Any Suggestions for Developing a C# Coding Standards/Best Practices Document

Are there any suggestions for developing a C# coding standards / best practices document?

We start with

  • Microsoft's .NET guidelines: http://msdn.microsoft.com/en-us/library/ms229042.aspx (link updated for .NET 4.5)
  • Microsoft's C# guidelines: http://blogs.msdn.com/brada/articles/361363.aspx.

and then document the differences from and additions to that baseline.

Do you have any good advice/links to a set of coding standards or best practices to follow?

Google has a posted style guide for C++ here which I consult sometimes. Just reading through the explanations and reasoning, despite whether you end up agreeing with some of the styles or not, may teach you some things you might not have thought about.

Coding guidelines + Best Practices?

Coding Guidelines for CSharp 3.0 and 4.0

IDesign Coding Standards

Lance Hunt's C# Coding Standards

Brad Abrams' Internal Coding Guidelines

Unsurprisingly, I just found a SO question: C# Coding standard / Best practices

Link to Microsoft coding standard/ best practices documentation?

Design Guidelines for Developing Class Libraries on MSDN

If you want something you can take with you, then I suggest The Hardcover Edition.

Coding standards for VB.NET

I'd suggest following the ones provided by Microsoft if possible. It should make your code and the CLR seem the same.

General Naming Conventions

I am looking for an advice for best practice in developing coding skills in C#

If you want to make a purchase, for your C# fundamentals, you couldn't do better than Head First C#. (Reminder: with this or any technical book, as soon as you get it, go to the book's official website, print out the errata, and keep that with the book.)

C# fundamentals for free: check out C# Station's C# Tutorial. It's pretty good but their section on polymorphism is weak. Also, haunt C# questions on Stack Overflow and see how other people use it.

For WPF, check out Sacha Barber's "WPF: A Beginner's Guide." Here is Sacha's article listing. The organization is lacking so just search that page for "WPF: A Beginner's Guide" to find each successive part.

Coding standards and best programming practices for C#

refer to this article already answered: )

Are there any suggestions for developing a C# coding standards / best practices document?

Also in PDF Form here: http://weblogs.asp.net/lhunt/pages/CSharp-Coding-Standards-document.aspx

For MVC I suggest reading some of Scotts Guthirie Blog, as well as Scott Hanselman

http://weblogs.asp.net/scottgu
www.hanselman.com

Quite the advocates for the good standards in MVC. Their book MVC2 is very good as well

What are the best resources to learn writing idiomatic c#?

You might want to try Effective C# and More Effective C#, both by Bill Wagner.

I haven't read either of them properly (must get round to doing so some time) but I've heard good things.

Assuming you're using C# 3, I would try to make sure you're familiar with:

  • Generics and what type inference on generic methods can do with you
  • IEnumerable<T> and iterator blocks
  • LINQ in general, and LINQ to Objects in particular (other LINQ flavours are useful in some places - LINQ to Objects is useful almost everywhere)
  • Delegates, particularly lambda expressions and anonymous methods
  • Object and collection initializers
  • Extension methods - be aware of them, and consider them for utility methods. In particular they're handy if you want to add your own LINQ operators


Related Topics



Leave a reply



Submit