Partager via


StyleCop released

The static analysis tool FXCop, and its later relation Visual Studio Code Analysis, have been well known as static analysis tools which help improve the quality and resilience of your code.  I'm a big fan of this tool's ability to catch bugs and potential performance or security issues sooner in the development process.

A lesser known tool named StyleCop, which was only available internally at Microsoft up until now, analyses the source code and checks that it conforms to suggested styling guidelines.  People often have their own preferred way of styling code, which is fine for a single-man project but can make it harder to work collaboratively.

The first time I was encouraged to use StyleCop I initally found it irritating, but you soon learn to appreciate the benefit of consistent styling across a large body of code.  Certainly the goal here isn't to preach a religious viewpoint on the One True Way of utilising curly braces, but rather ensuring that you can quickly and easily read any part of the codebase; it's surprising how much difference consistency can make to this.  It also provides further checks on code documentation such as suitable headers, which isn't covered by the other tools.

Read more about it on the Source Analysis blog.

Comments