Thursday 16 October 2008

Visual Studio 2008 Colour Schemes

In the past year, the trend to modify your Visual Studio colour theme has gained momentum. Yes it's a trendy bandwagon, but it's not without merit. After using Oren Ellenbogen's Dark Scheme (via Scott Hanselman) for a while, I now find the default Visual Studio colours a trifle harsh.

The key is having a very dark, rather than black background. I have also adopted this for my desktop backgound using 56,56,56 rgb.

Here is Oren Ellenbogen's theme updated for Visual Studio 2008 transformed using Tomas Restrepo's xlst.




To save you the trouble of the transform, you can download my version of the Visual Studio 2008 theme here. It includes a couple of minor tweaks for ReSharper.

Here's to not all looking like Mr Magoo by the time we're 45.

Tuesday 7 October 2008

Comments Anti-Pattern

Code comments. They are good right? Well yes. However you can fall into the trap of thinking if commenting is good, more comments are better. Comments all 'round. Comments for everyone! The Milkybar comments are on me.

This is the common anti-pattern:
/// <summary>
/// Tests if an order can be prepared for printing.
/// </summary>
[Test]
public void PrepareOrder()
{
...
}
If you multiply that by every public method and or test it can make the class files look a bit jumbled.

So why not refactor by renaming the method and lose the comment?
[Test]
public void OrderCanBePreparedForPrinting()
{
...
}
or even
[Test]
public void Order_Can_Be_Prepared_For_Printing()
{
...
}
I find this far easier on the eye.