Thoughts: Source Analysis for C#

Microsoft recently released a new tool called Microsoft Source Analysis for C#, AKA StyleCop. Richard Banks has a great overview of the tool and how to use it. To summarize, it looks at your C# source code (unlike FxCop, which looks at compiled binaries) and evaluates a set of rules over the code to help your team enforce coding standards.

You might be interested to hear of a product called SSW Code Auditor. Code Auditor has been around for years, and serves exactly the same role as Style Cop. Oh, and it works for VB.NET, HTML/ASP.NET, JavaScript, and any other kind of text file. And you can write your own rules using regular expressions or .NET code. But it’s not Made In Redmond. StyleCop is a direct competitor to Code Auditor, and what’s worse, it’s free.

I suppose I shouldn’t be mad that Microsoft would choose to compete with an ISV over this. I mean, it’s not like SSW are a Microsoft Gold Certified Partner. It’s not like their Chief Architect is a Regional Director. Why should Microsoft have any loyalty to them?

Next time the Visual Studio team is bored and want to release something, perhaps they could instead:

  • Fix the WPF designer
  • Fix the Silverlight designer
  • Decouple TFS from SharePoint
  • Make it so that when I install VS, it doesn’t install the compact framework and all the other mobile crap even though I’ve never used any of it in my life.

I thought it was bad enough that open source projects have to compete with Microsoft in their own ecosystem, but ISV’s too?

Full disclosure: I worked for SSW a couple of years ago, and I worked on Code Auditor myself. I’m not sure what their take on this product is. I’m sure it’s not the only non-Microsoft product in this space either.

Technorati Tags:

2 Responses to “Thoughts: Source Analysis for C#”

  1. Hi Paul,
    I agree that MS still follows its observe/re-extend policy! You’e right as StyleCop has the same idea as CodeAuditor, but does it mean MS has duplicated CodeAuditor? Have you checked more details of StyleCop? and do you think CodeAuditor is enough to replace StyleCop in real-world projects without going trough those customisations?

    Hey I found few great ideas in CodeAuditor, congrats! :)

  2. StyleCop was developed internally by developers at Microsoft as a tool to help other Microsoft developers. It was never an official project of the developer division, but it proved to be useful to other .NET developers at MS, so its creators continued to develop it. It has never been mandated internally, but it proved to be so useful that they chose to release it to the community at large in hopes that it would be useful to others as well. I fail to see how that in any way qualifies as “evil” or “disloyal”.

    You can read more about the history of StyleCop at http://blogs.msdn.com/sourceanalysis/archive/2008/05/25/a-difference-of-style.aspx.

Leave a Reply