Nice coding standard documents for C# (and VB.NET)
Coming back from a little break during Christmas I looked around on the ASP.NET web site (http://www.asp.net) and found a couple of interesting newly added things. Amongst stuff I took a look at the coding standards added by Clint Edmonson (http://www.notsotrivial.net) a couple of days before Christmas. They look really nice and may be a good start when implementing some kind of standards in an organization.
Where to find them
They are published by Clint Edmonson and can be downloaded from his blog, Holiday Goodie Bag: Free C# and VB Coding Standards Reference Documents.
First impression
I have only had a quick look at the C# standard since I never use VB.NET.
The C# standard covers most parts of the language and it is pretty straight forward. I’m happy that the Polish notation is not visible anywhere, prefixing names all over the place!
One thing I noticed was the use of this more often than really needed. First I didn’t like it, but after some time I changed my mind. It makes things really clear, identifying the true scope of a variable.
I also found the use of braces on single line scopes great, like a single line if-else statement. This is one thing that really improves readability, and I will try to use it myself. I’m pretty lazy when it comes to things like this, but it is a really good thing, even though the syntax is correct not using them.
Have a look at it on Clint Edmonson’s blog post!
Read more
There are lots of coding standards around, using different styles for naming, indenting etc. Just make a google search on “coding standard” or “programming style” and you will ge alot of hits.
Personally I like wikipedia and there’s a great page linking a bunch of standards for different languages here: http://en.wikipedia.org/wiki/Programming_style.
I like stuff like this. After a quick look a the C# document I too think it looks good. Most of it adheres to the style I personally use.
Gabriel Svennerberg
9 Jan 09 at 15:35
Thanks for linking to my blog post. I hope your readers enjoy the content.
From my experience, adding “this.” provides a great deal of clarity when reading code and when writing code, give you intellisense on the current class. You wouldn’t believe how many times I’ve seen duplicate methods written in a large class because the developer did not know a method already existed and added a new one next to the method he was working on.
Clint Edmonson
13 Jan 09 at 16:33