Feeds:
Posts
Comments

Archive for November, 2008

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 :

if(someCondition)
    DoSomething();

You need to put braces around it as :

if(someCondition)
{
    DoSomething();
}

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.

Read Full Post »

Follow

Get every new post delivered to your Inbox.