The universe conspires for us

As anyone who knows me understands, I’ve faced some challenges over the last couple of years. One or two I’ve mentioned on this blog, most I haven’t.

Throughout though, I’ve maintained faith in one thing. Recently my former colleague. JR, put it better than I ever have – the universe conspires for us, and not against us.

The last few days have seen a sequence of events happen, and things have fallen into place ‘just so’, to support such a faith. Is this faith in a god, or humanity, or luck? None of them really, but what exactly this faith is targetted towards is actually of little consequence. How I choose to live is what is important, and living as though the universe conspires for me has this strange knack of becoming a self-fulfilling prophecy. At the moment, with the little understanding I have of this world in which we live, that is enough for me.

And when I have weekends like I have just had, I say ‘thanks’ to the universe, and continue walking my path.

JCB vs Astramax? You decide

Apparently the world has a new fastest diesel vehicle – the JCB DIESELMAX. I’m not convinced. Everyone knows the fastest diesel, on the motorway at least, is the Astramax van. I should know, I drove one for a couple of years. Mine wasn’t white, but I was still a fully paid-up resident of the outside lane. Oh, those heady days….

Cliffs, Colorado, and cameras

Short post this one – in the last couple of weeks I went to Fort Tyron Park in New York and Crested Butte in Colorado, and of course took photos. One new thing though, these photos were taken with my new Nikon D50 Digital SLR camera. Now I just have to figure out how to take good looking photos without just cheating and using the automatic modes.

Minuit – The Guards Themselves

One of the things I enjoyed about my time living in New Zealand was the music scene there. Since NZ is so isolated (geographically at least) from the rest of the world, they have a somewhat alternative way of doing things when it comes to bands. People there have this quaint thought (!) that its actually quite nice to go and see your favourite bands play live, and not have to be a million rows back in the crowd, or have to ring Ticketmaster like crazy at 9am on the day the tickets come out, or have to go cap in hand to a less than celubrious chap shouting ‘Buying! Selling!’ outside the venue on the night of the gig. Add this to the fact that not that many international bands come a-visiting, and its not surprising that you find NZ makes its own music scene.

Most kiwis (native New Zealanders) that have some interest in popular music will be fully aware of the latest goings on of 10 or 20 different home-grown bands that the rest of the world has probably never heard of. These bands put out great records, put on 500 person shows, love their fans and their fans love them. How civilised. 🙂 Occasionally these bands will even ‘break’ overseas – The Datsuns, OMC (ok, for one hit), and of course Split Enz / Crowded House are notable examples.

One such band that I brought back home in my heart were Minuit. Minuit are ‘breakbeat’ (i.e. mostly electronic-based and interesting drum rythms) with a great female vocalist (not dissimilar to Moloko’s Roisin Murphy.) I managed to pick up their debut The 88 in my time down under. Its not quite as polished as mega-budget northern hemisphere productions, sure, but I have this unnerving knack of playing it at regular intervals and whenever I do it gets me dancing around my apartment while putting a smile on my face.

I was pretty excited when Minuit released their second album, The Guards Themselves earlier this year. The one slight problem is they don’t have an international distributor, so what with moving country and Amazon taking 2 months to deliver from NZ (!!) I only just received my copy today. But it was worth the wait – mostly more of the same retro synth, nod-your-head breaks and get-under-skin vocals from Ruth but with a little more confidence.

Like any self-respecting interweb-aware band of our times, Minuit have a Myspace Page where you can listen to tunes, watch videos, and make yourself a ‘friend’ of the band (I’m a bit of a luddite and only discovered what Myspace was a couple of month’s ago when Wired had an article on it.) Myspace is taking the music industry by storm, completely changing how people find out more about the bands they like, and find new bands like them. Its with this breaking-down of geographical boundaries that New Zealand bands might be more easily able to break overseas, and if Minuit ever manage to make it to New York, I’ll be first on the TicketMaster phone line..

The power of a fast build

When I build the project I currently work on, I smile every time I see the last 2 lines:

BUILD SUCCEEDED

Total time: 9.5 seconds.

And before you start doubting, yes we do have a pretty comprehensive test suite! So comprehensive in fact that I’m quite happy making medium – large size refactorings rapidly. In fact, in the space of just over an hour I’ve been able to check in 4 such changes.

The secret to this? No out-of-process communication. All of these tests run within the code. The application communicates with a message bus and we test the actual message objects produced by the application and generate the actual messages consumed by the application, but we never actually hit the network thanks to some appropriate stubbing of the middleware vendor’s Transport API.

The only problem? At some point in the future I’ll end up on a project again with a 15+ minute build and I’ll be pulling my hair out…

Team City vs. CruiseControl.NET

I’m a big fan of JetBrains. Their IntelliJ IDEA Java IDE, which I first used 5 years ago, I think was the biggest step forward in code-editting productivity since the Smalltalk browser, and they continue to innovate on this idea while adding similar products in the .NET world with ReSharper.

Last year I was talking to a couple of the guys from JetBrains and they mentioned they were working on a Build Server product. That has now materialized in the form of TeamCity. You don’t need to look at the TeamCity web page for very long before realising that it’s JetBrains’ own version of CruiseControl or CruiseControl.NET. In fact they even compare against these projects here.

Clearly the comparison is a little biased (there’s only 1 feature in CCNet’s Web UI that they actually include in their list for example) but I’m probably biased in saying that. 🙂

There’s a lot of lessons I’ve learned along the way being one of the CCNet project leads, the biggest being that a huge chunk of our time and effort is spent purely on integrating with all the different source control tools we talk to (14 at the last count) and that’s with a fairly limited Source Control interface and no UI configuration. The only reason we’ve been able to do this is through community involvement in the project and I’ll be interested to see if Jetbrains introduce a fairly open API for plugging in custom sourcecontrol bridges.

I think one of the other key benefits to CCNet is how customisable it is through plugins generically, along a number of axes. The Web Dashboard for example can be customised through adding your own XSL stylesheets or actually adding your own code-implemented plugins. The build server does similarly. If Jetbrains can get this customisation part right, I think both CruiseControl and CruiseControl.NET will see their user bases shrink dramatically.

Which will leave me to work on all those other open source projects I’m interested in. 🙂

Careful with those member variables, Eugene

OOP (Object oriented programming,) or just OO, is a wonderful way of programming. I’m quite happy to say that since I’ll be honest and say I didn’t really get it properly until 2 or 3 years ago. Sure, I’ve been programming with Java and C# since 1998, but that doesn’t really mean I was doing OO all that time. A lot of people use Java or C# to write ‘object procedural’ or ‘class oriented’ programming. If you understand OO, you probably know already what I’m talking about, and if you don’t…. well I’ll try and explain.

There are a few pointers that code has not been written in the spirit of OO, and I’m going to talk about just one such small smell here. This smell is what I like to call ‘member variable madness’.

OO is to a large extent about encapsulating state. The state in OO is held in the member fields of objects. Those fields may be encapsulated data, or references to other objects. Member fields are used so that the object can keep track of data, or references, between calls to its public methods. Member fields consist of member constants (readonly in C# and final in Java) and member variables (i.e. not a constant.) Member constants are used when a piece of member data is immutable, or when a reference is a constructor-initialised dependency on another object.

Member variables are not meant to be a temporary scratchpad between public and private methods. This is not state that exists between externally stimulated method calls. What’s bad about using member variables as an internal scratchpad? I think there are at least a couple of reasons:

  • Clarity. When I look at a class for the first time, I look at its member fields. This tells me what the object is encapsulating as part of the whole program. If there are a bunch of scratchpad variables here that confuses this concept.
  • Correctness. Everytime you introduce a new member variable to a class, you are introducing another ‘degree of freedom’ of all the objects of that class. This means to be sure you haven’t broken anything you have more testing to do. Correctness can be broken in at least 2 ways:
    • Thread safety / interference. If you have 2 concurrent threads accessing one object, they will share the member variables of that object. There is a big chance they could interfere with each other leading to hard-to-find bugs
    • Initial value. If you use local variables, you know you need to initialise it every time you define it (otherwise the compiler will complain). However, with a member variable you need to only initialise it once, somewhere in the class. How do other usages know it has been initialised? Do they need to re-initialise? Might that actually break the required behaviour?

Thankfully, this smell is an easy one to fix. Simply replace the member variable with a local variable in the scope where it is initialised, then pass the variable as an argument to any other methods that require it. You may find that you now have methods with long parameter lists, but this may suggest that you need to introduce new classes to encapsulate such groups of variables anyway.

If you’re interested more in this area I recommend Ivan Moore’s ‘Programming in the Small’ series on his blog . Pair-programming with Ivan taught me more about OO programming than any other time in my career.

Sun X4500 – Taking the phrase 'disk space is cheap' to the next level

I love it when big old-school technology companies do something that surprises me. Sun’s new X4500 server does just that. It takes 48 (yes, 48) standard hard disks and puts them in a 4U server. With the 500GB hard disks available today that’s 24 terabytes in one server. That’s a frak load of disk space. To put it another way, in a 48 U rack (and the mother of all air conditioning units) that’s … umm my head can’t cope … 288 TB … What comes after ‘Terra’? When 1TB disks come out later this year, 1 rack will be over half way there.

Oh, its got 2 dual-core CPUs and (I love this bit too – very old school!) 4 gigabit ethernet ports. Reminds me of the old happy-meal cards (anyone get that?)

So what do you do with that amount of storage in just 1 server? Well apart from hosting the world’s most impressive mp3 collection, I can think of a few things:

  1. Data Warehousing gets darn cheap. Lets all start doing it! Lets never actually delete anything, just archive it to a different table. If its good enough for GMail, it should be good enough for our apps.
  2. Put your source control server on it, and check your continuous integration builds into revision control, and never have to worry about filling up the disk. Actually, scratch that one, I forgot about weblogic.jar being 17.5 GB by itself… Seriously though, this would make a great cross-department source control beast that would last for years.
  3. Give everyone huge shared and personal networked folders to work with. Turn off the quotas!
  4. Any application which is data heavy but CPU light and has separate application and database tiers could use this machine to host both tiers – no network traffic!

I’m interested to see what people do actually use it for. Such big advances can lead to interesting possibilities.

3 shells of Agile

As an agile software consultant, I’ve now been involved with quite a few clients who are either trying out, or transitioning to, agile methods to deliver software within their organization. Some of the following types of questions are frequently raised:

Do we have to be completely agile for it to work at all?

How do we start being agile?

How do we work with parts of the organization that aren’t agile?

The organization already has a strict programme management methodology – how does agile work in that environment?

In trying to answer these questions, I think it can be helpful to think of agile software development to be made of 3 shells:

Agile Shells

What this diagram shows is that we can think of breaking up all the different agile practices into 3 groups:

Agile Programming includes the development practices typically found in eXtreme Programming: evolutionary design, continuous integration, test-driven development, pair programming, domain-driven design.

Agile Projects / teams includes the agile project management and whole-team practices: short iterations, planning games, daily status meetings, information radioators, retrospectives, on-site customer proxy, acceptance-test driven requirements.

Agile Programs / organizations is referring to what happens when an agile project acts in an agile way with the bigger environment: frequent delivery to production hardware, on-site customer, frequent stake-holder meetings, agile support (e.g. from the IT operations dept.)

What I think is important is that there is strong requirement relationship looking inward, but a weaker requirement relationship looking outward. For example, if a whole program of work is going to be agile, its internal teams can’t be acting like mini waterfall projects. Similarly, the programmers on a 4 person team might well be able to practice agile programming techniques even if they don’t have an iterative development cycle.

I think breaking up agile in this way helps to answer the type of question we started out with. Some organizations might want to start with some of the more inward practices before pushing them further out. A classic example of this might be not being able to get a real on-site customer (an agile organization thing to do) but making do just with a customer proxy (which is what you’d have if you were trying to have an agile team.) Similarly, people might be willing for the team to deliver internally every iteration (maybe to UAT) but just aren’t setup to deliver to production more than once every 2 or 3 months.

Breaking up the practices in this way also helps you focus what you want to do first – it’s important to realise you might not need to be ‘completely agile‘ in one shell to support the next one out. As a first start to using agile, you might try having stake-holder meetings as part of an agile organization every iteration; have 2-week sprints, planning games, and daily status meetings as an agile team; and kick-off some technical practices like continuous integration to start out with. After a couple of iterations you’d probably find you’d need to add some more technical practices to support your iterations, and that you might need a designated customer proxy to better support the stake-holder community.

The final point to consider is how an agile project can work in the context of non-agile environmental constraints – this issue comes up frequently when introducing agile into businesses with large, dedicated IT organizations and management structures. By defining what we mean by an agile team or project, we are better able to define a strong interface between the agile team and the rest of the IT organisation. The team might need to produce relevant documentation, they might need to provide upfront requirements to other non-agile development teams. But the point is if they can’t work as part of an agile organization they can still look introspectively and find how they want to work as a team, and what technical practices they want to follow.

In closing, expecting an organization to become agile overnight is obviously unrealistic. A little analysis of breaking up the agile practices into broad areas can help transition an organization in a more controlled way.

July 7th – 1 year on

Today is the first anniversary of the London Bombings. As I blogged a year ago I was on one of the trains that was bombed, and being involved with this event has unsurprisingly had quite an effect on me and my family.

For the first few months, I tried to put the horrible things I had seen, and the fact that I had been so close to being killed or seriously injured, out of my mind as much as possible. I didn’t have nightmares or panic attacks, and I carried on pretty much as normal. I did start using the Underground again, but living in central London allowed me to use busses, or walk, much more than I had done previously. Throughout the rest of my time living in London I did go somewhat out of my way to avoid the Tube.

In November I was visiting New York and found myself on a Subway train that was stuck in a station, and the doors didn’t open. I started to feel uncomfortable, and then after a couple of minutes the doors opened and I could get off of the train. Almost immediately I started to shake violently, and felt I was going to be sick – I was having a panic attack. The feeling lasted about 5 minutes and then gradually faded, but it made me realise that I had been effected by my experiences that summer’s day in July.

I didn’t really know what to do about it though, but I did look up the London Recovers website setup by Peter Zimonjic (thanks Peter!). One of the things that came out of that was groups of survivors from each of the trains had started arranging informal self-help meetings. I went along to one of the Aldgate meetings in January and found it very useful. One feeling I had had was that I was alone – my family and friends were extremely supportive, but I didn’t feel able to share completely my experiences with people I cared about. Furthermore I had so many unanswered questions about that day. Meeting up with some of the other people on the train allowed me to talk about stuff I didn’t want to share with anyone else, and also allowed me to get a better picture in my mind of what had happened.

One particularly interesting thing I learned that day was that the ‘4 month delay’ feeling I had had was very typical. I talked to one gentleman who had actually been physically injured by the blast. For the first 4 months he had felt euphoric with the relief of being alive, but then suddenly one day his emotions had crashed. When I spoke to him in January he was getting better, but still was massively emotionally effected by his experiences.

After January, life didn’t really lend itself to doing anything more than that one meeting with the travelling I was doing. I continued to feel uncomfortable travelling on the tube, I was noticeably ‘hyper-sensitive’ to loud noises, and got very upset when I heard helicopters (due to all the choppers circling around in London after the bombs went off.) These are all classic symptoms of post-traumatic stress (PTSD), as I have since learned.

In April though I moved to New York, and one of the things a very good friend of mine made me do when getting here was to go to see a therapist – New York having suffered its own tragic events of 9/11 has a significant number of people who can help with PTSD. I’m really glad to have done this, its helped me look analytically at my feelings and thoughts. I’m now pretty much fine with the New York subway (which I use every day) and I noticed the other day that helicopters no longer seem the carriers of evil I was associating them with previously.

Today itself though has obviously been hard. I managed to take the Subway this morning (despite originally planning on walking) and it was harder than normal. A smell of burning in the office later in the morning made me pretty anxious, but it soon passed. I know today has been hard for my family too – they know how close they were to losing me last year.

Looking forward, I know that I will never forget my experience and it will have an effect on me for the rest of my life, but I know that I’m dealing with it a lot better than I did last year.

My only frustration is that we still don’t really know what happened. I know these things take time, but part of me feels there should be more publically available information to explain how and why the 4 bombers did what they did.

But to finish on a positive note, I’m incredibally pleased that in a lot of ways London didn’t change because of last year. It continues to be a thriving multi-cultural centre of the world. I hope in the years to come that Londoners remember July 7th, but as much as they can that they can live their lives as though it never happened.