Welcome to MSDN Blogs Sign in | Join | Help

srinivi's blog

Experiments with Microsoft's new technologies
Microsoft Source Analysis for C# (stylecop)

Different teams in Microsoft use different coding styles and have their own standards.
The reason is largely historical. Some teams and products have been in existence for a very long time, with senior developers (used to coding in C++) and some migrating to managed code. There are many Microsoft products with both managed and unmanaged code.

Coding standards are very useful for projects/products with long life (and those which could go into sustenance mode).

Microsoft recently released Microsoft Source Analysis (internally was called StyleCop). This tool enforces a coding style for C# code. This tool can be integrated into an MSBuild based build environment too - http://blogs.msdn.com/sourceanalysis/pages/source-analysis-msbuild-integration.aspx

Microsoft Source Analysis blog

Why try and define your own coding standards when you could get the tool to enforce very well defined standards.

The tool currently supports only C# code and not ASP.NET.  Obviously its not easy to modify all your current C# code to pass the tool's verification, but you could use the tool on new code. This would be a great time to define coding standards for your team.  

NOTE: FxCop analyzes compiled .NET binaries, while StyleCop analyzes the original source code. This allows StyleCop to investigate issues in code that is thrown away by the compiler.

Posted: Friday, June 13, 2008 11:54 PM by srinivi

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker