C# Gotcha

I've just spent 10 minutes blankly staring at my screen trying to figure out why the heck an ultra simple piece of C# didn't work... Suppose you create the following and compile it into an assembly called JSL.HelloWorld.dll
namespace JSL.HelloWorld
{
    public class Example
    {
        //...
    }
}
And then you write a test for it...
namespace Tests.JSL.HelloWorld
{
    using JSL.HelloWorld;
    using NUnit.Framework;

    [TestFixture]
    public class ExampleTest
    {
        [Test]
        public void Eg()
        {
            Example puzzle = new Example();
            //...
        }
    }
}
Looks fine. Yet when you compile the test csc complains that "the type or namespace name 'Example' could not be found...". Ten minutes blank staring follows. The problem is there are two namespaces called JSL.HelloWorld. There's one that's global that contains the class called Example we're after. And there's another one inside the namespace called Tests (called Tests.JSL.HelloWorld). So the compiler tries to resolve Example in Tests.JSL.HelloWorld but not in JSL.HelloWorld. One solution is as follows:
namespace Tests.JSL.HelloWorld
{
    using global::JSL.HelloWorld;
    using NUnit.Framework;

    [TestFixture]
    public class ExampleTest
    {
        //...
    }
}

BCS SPA 5th Jan 2005

Immo Hüneke has mercilessly bullied me into speaking at a BCS SPA meeting in central London. It'll be essentially the same talk I gave to the North East branch - a hotch potch of interesting quotes and various related topics loosely knitted together into something vaguely resembling a presentation.

The End of Certainty

is the title of an excellent book by Ilya Prigogine. It's subtitled Time, Chaos, and the New Laws of Nature and I reckon at least two of those three apply to software. Prigogine is a Nobel Prize winner (in Chemistry) and has worked on problems of non-equilibrium, complexity, self-organization, entropy, etc, for over four decades. Rather than writing an extensive review I'm going to open the book at a few random pages...
A nonequilibrium system may evolve spontaneously to a state of increased complexity.
Bifurcations are a source of symmetry breaking...Bifurcations are the manifestation of an intrinsic differentiation between parts of the system and its environment.
Once we have dissipative structures we can speak on self-organization.
...order can only be maintained by self-organization.
...constraints do not eliminate creativity, they provoke it.
...our position is that classical mechanics is incomplete because it does not include irreversible processes associated with an increase in entropy.
There is a necessary trade off between certainty at a given time for continuity through time.

I've won something!

I'm chuffed to learn one of my articles has won best Overload article for the year (the year in question being 2003). Writing unpaid articles isn't as altruistic as it appears. You learn a great deal by writing. If you're a developer your job is writing descriptions. Writing matters. Richard Gabriel's advice to developers is to learn poetry. And Dijkstra said that the best indicator of a developers skill was mastery of their native tongue. One of Michael Jackson's lexicon entries is called simply 'Descriptions'.

ACCU 2005 Conference

I'll be speaking at the ACCU conference held 20th to 23rd April 2005 (with an additional pre-conference tutorial day on the 19th). These are always great developer focused conferences. Confirmed speakers include Bjarne Stroustrup, Jim Coplien, and Kevlin Henney. More details.