Using StyleCop

I’ve been using StyleCop for a few weeks now and after I got over the initial shock, I actually like using it now. In the long run, the big thing about using it is that your code looks consistent. Of course, in a small company it’s easy to get everyone to move to StyleCop, things may be a tad more difficult convincing a bigger group of people to do so.

Some of the rules may seem odd. For example, StyleCop will warn you if you do :


You need to put braces around it as :


Funnily I used to do this till a few years ago, then I started omitting the braces for single-line if-blocks because that’s what my colleagues did too. And now I’ve gone back to using braces. And yes the same rule applies for the else statement too.

I’ll be blogging more stuff on my StyleCop experiences. This post was just a quick something to break the bloggers-block that’s infected me the past few months.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s