Tuesday, June 26, 2007

Automated code formatting tools

I love automated code formatting tools. Anything that will help clean the layout of code, especially code that I've inherited, is a major productivity booster.

I've been a bit of an evangelist for ReSharper in every development team I've been a member of. If the only thing ReSharper provided was code formatting I would still recommend it. It provides a great deal more which I'll cover some other time. ReSharper has granular enough code-style rules tools that should satisfy almost any possible team standard for code layout. The rules can also be imported/exported which is a time saver when you work on several machines or in a team. ReSharper is one of the few tools I've bought out of my own pocket and will be happily upgrading my 1.x license to the new 3.0 version very soon.

A classic free tool is GhostDoc. It doesn't reformat your code, but it will clean up and generate the xml documentation for methods, constructors and properties. It's very handy when you are maintaining code that doesn't have any xml comments to select "Document This" from inside the method and have the template filled out for you.

A new tool that seems very promising is Regionerate. It will automatically organize your C# class properties, fields, constructors, events and methods into neat regions with nice labels that contain a count of the number of items in that region. Very slick.

Submit this story to DotNetKicks

Monday, June 25, 2007

The Play

The actors are assembled for the Writer's play. Some will play heroes, and some villains while most will walk through the scene forgotten and unheard. The Director moves the actors through the tragedy and comedy and the quiet moments in-between. When the script is done and the speaking stops the curtains draw and the all is ended. The cast is called to take a bow, is the villain still applauded? Or is he taken away and punished for his role? Is the hero to be knighted? The Writer wrote their deeds and they played their part as it was already decided. Who will be invited to the post-production party?

Submit this story to DotNetKicks

Friday, June 22, 2007

How would you unit test this?

if ( Jack.WorkQuantity == "All"
    && Jack.PlayQuantity == "No" )
{
    Jack.BoyType = BoyTypes.Dull;
}


It's a trick question, the answer is "Don't." Go outside, nerd.

Submit this story to DotNetKicks

Polish PM stands up to Germany

Germany is pushing for the votes of EU members to be based upon population. Which is not surprising considering that Germany has the highest population on the European continent, second only to Russia. Poland, in a welcome change of attitude to it's typically acquiescent nature, has unleashed a blitzkrieg* attack on the German argument.

The Polish PM has pointed out that the population of Poland was horrifically decimated by the Germans during WW2. The situation in Poland would be quite different as the fallout from the 1939 to 1945 war, which slaughtered over 6,000,000 in Poland alone, has left them in a weakened state that they have never fully recovered from.

I'd like to point out that the Soviet Russian occupation of Poland for decades after the war only further exacerbated the problem. Which is still to the point because it probable wouldn't have happened if it weren't for the original German aggression.

Quote from the thisislondon.co.uk article.

Poland has been fighting plans for the summit - being held in Germany - to change the EU's voting system to one based on population.

It would increase the influence of the host country, EU's largest with 82million people, at the expense of smaller members such as Poland, which has only 38million.

Mr Kaczynski stunned other EU leaders by claiming that Poland has 28million fewer people than it should have as a result of the slaughter inflicted by Germany between 1939 and 1945.

Area and population of European countries

*pun, somewhat intended. :-)

Submit this story to DotNetKicks

Friday, May 18, 2007

[Linky] HOW TO: Debug into a .NET XmlSerializer Generated Assembly

When using the xml serialization object to serialize and deserialize an object a temporary class file is generated. This article explains how to find the intermediary file and step into it with the VS.Net debugger.

Article by Scott Hanselman.

Submit this story to DotNetKicks