Source Analysis (aka StyleCop)

Like many people I’ve been waiting for this one for a long time. Last week Microsoft released Source Analysis (aka StyleCop). Source Analysis is a free utility for analysing C# source code (Source Analysis does for source code what FxCop does for assemblies). It ensures consistency of code style throughout a project (and across all developers on a team). Source Analysis has approximately 200 rules covering all those niggley bits like whether to include spaces, whether to use spaces or tabs, where curly braces should be used, how comments should be used etc. etc. Imagine anything you have ever argued about with other developers on your team with regard to ’good style’ and Source Analysis has a rule for it. Of course, like FxCop the first time you use it Source Analysis will throw up hundreds of errors but also like FxCop you can disable any of the rules and if you don’t have time to fix them all you can disable the whole lot and then enable them progressively as you can spare 10 minutes here and there. You can even write your own StyleCop rules but this isn’t officially supported in this release.

You can download it from http://code.msdn.microsoft.com/sourceanalysis. You can read the Source Analysis blog at http://blogs.msdn.com/sourceanalysis. After installing Source Analysis you will notice that the current release is 4.2 which will seem odd given that this is the first public release. The explanation is that Microsoft have been using this tool internally across most teams that use C# for years. Consequently this is a very mature product that has had many of its rough edges knocked off already.

Another Source Analysis feature that I really like is that apart from the fact that it can be integrated into the Visual Studio IDE and the build process you can set Source Analysis to treat its warnings as errors - so for those who are particularly strict on coding standards you can set Source Analysis so that any code style deviation breaks the build.

It’s worth pointing out though it’s just for C# - no Visual Basic support here. Although it can be argued that to some extent Visual Basic doesn’t need Source Analysis because the editor ensures code style consistency without additional help and this is a feature that Visual Basic developers have enjoyed for years.

And in the next version of Source Analysis there will be the option to automatically fix errors.

Thanks for releasing this one, Microsoft, it will make a big difference - not to mention the initial flush of religious code style wars that we will be part of over the next year.

Technorati Tag: Source Analysis, StyleCop, FxCop

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Friday, May 30, 2008 at 9:54 PM
Categories: Miscellaneous - Technical
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Fest 08

The NxtGen crew are back again for their second annual shin-dig at TVP in Reading. It’s a day of tech sessions on subjects like F# and Dynamic Data plus pizza and the inevitable swag fixation that goes with NxtGen like pitta and kebabs. So if you’re not doing anything on Thursday 12th June 2008 and either you’re a NxtGen member or you’ve got £49.99 handy give it a go.

Technorati Tags: NxtGen, Fest 08

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Friday, May 30, 2008 at 6:41 PM
Categories: Events
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

SQLBits III Date Is Set

The third incarnation of the free, one day SQL DDD-lookalike event, SQLBits, will be held on Saturday 13th September 2008. Martin Bell, Simon Sabin and company will be doing their best to top their previous two successes.

Technorati Tags: SQLBits, Martin Bell, Simon Sabin, DDD

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Monday, May 12, 2008 at 8:11 PM
Categories: Events
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

DDD Scotland: ADO.NET Data Services

The second of this year’s regional DDD events is coming from Scotland. One week after DDD Ireland, the Scottish incarnation of DDD will be held in Glasgow this Saturday 10th May 2008. Colin Angus Mackay and John Thompson have organised the whole event and I’m expecting good things from this event based on the quality organisation and attention to detail so far.

I’m doing my current standard, ADO.NET Data Services, which I did in Edinburgh 8 months ago but Rangers were playing at home that night so the Scottish .NET community had to choose between seeing Rangers start their long, long European journey or else watch some bloke from Bristol wobbling on about data and why it’s so important. That night I lost. Next week we’ll find out whether Rangers should have given up that night and saved themselves 8 months of grief.

If you’re coming along to DDD Scotland be prepared for what I think will be a fantastic event.

See you there.

Technorati Tags: DDD, DDD Scotland, Colin Angus Mackay, John Thompson, ADO.NET Data Services

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Thursday, May 08, 2008 at 9:54 PM
Categories: Events
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (4) | Post RSSRSS comment feed