Out of the box, Microsoft’s new code analysis tool (Style Cop) did not play with the firmly entrenched ReSharper in my Visual Studio IDE. However, a quick dash to CodePlex yielded a plug-in for ReSharper that had me back in business in minutes.

My first take on Style Cop was that it was a great deal of commenting and a new place for my using directives. Feeling a little affronted by the 199 warnings my ASP.NET MVC spike project generated on the first scan, I changed Studio to treat warnings and errors, made a cup of coffee and set about it.

I am pedantic. My wife is a saint as she lives with me and has yet to seriously hurt me and to my knowledge not on purpose, yet. This trait is either a symptom of my trade or a cause. There is a small amount of shame welling in me as I try to convey to you how much I adored the code I produced in the next couple of hours. It did not do anything different functionally (well some tiny bits) but it looked shiny. It was the type of code that I wish to encounter in projects that I work upon.

Style Cop is a winner with me! I heartily recommend trying it; if you have not already.

The senior technical lead in my department, Barry, has instructed me to add it to our build process. The way he put it, and I paraphrase was “I don’t agree with everything it suggests; but I’ll accept it for the standard of code it enforces others to produce.” I must concur!

Advertisements