jenswinter.com
Software Development 24/7

Formatting Object Initializers

September 25, 2007 22:15 by Jens

I'm currently playing around with the Orcas Beta 2 and C# 3.0. As I'm experimenting with the new object initialization feature in C#, I'm wondering which coding style will be applicable and will prevail.

So here is the style from the C# 3.0 specification:

Project project = new Project { VersioningType = "SqlServerVersionsTable", DatabaseType = "SqlServer" };

But I'm not sure if this will be the best choice most of the time. So here some other styles to vote for:

Project project = new Project
{
    VersioningType = "SqlServerVersionsTable", DatabaseType = "SqlServer"
};

or

Project project = new Project
{
    VersioningType = "SqlServerVersionsTable",
    DatabaseType = "SqlServer"
};

or (my favorite for now)

Project project = new Project
    {
        VersioningType = "SqlServerVersionsTable",
        DatabaseType = "SqlServer"
    };

The time will tell which version really will be used by the majority of the developers.


Tags:
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

xUnit.net released

September 22, 2007 22:14 by Jens
James Newkirk released a new unit-testing framework called xUnit.net. While I have a lot og respect for the the developers James and Brad, I can't see the real motivation for building another .NET testing framework.

Here is a list of the included features:
  • Single Object instance per Test Method
  • No [SetUp] or [TearDown]
  • No [ExpectedException]
  • Aspect-Like Functionality
  • Reducing the Number of Custom Attributes
  • Use of Generics
  • Anonymous Delegates
  • Assert extensibility
  • Test method extensibility
  • Test class extensibility
I recently switched from NUnit to mbUnit in my projects. It turned out to be a non-event and I'm pretty happy with mbUnit and the additional features it provides. Anyway, I can't see any reasons to switch to another testing framework.

Castle Project 1.0 RC 3 released

September 21, 2007 22:13 by Jens
Congratulations and many thanks to Hammett and all the guys who contribute to the Castle Project. Great work!

Read the announcement here and the change log here.