Yesterday I was cycling along the fancy new mountain bike track at McLeans Island (which is, incidentally, not an island anymore due to earthworks in the Waimakariri River to stop it flooding the city) and I was thinking about various things.
Often in moments like this I think about some code I'm working on from a new perspective. I realised that I needed to create a more thorough infrastructure for the forum application I am writing because even if in the first release users are unable to delete their messages, administrators will still need to do that. Often in writing code I start to cut corners like this then realise that I need to take the time to do things properly.
One other time on the Mount Somers Track I was pondering version handling in an application. There are many different ways you can approach the problem of retaining all different prior versions of an object for an indefinite time, and doing so in an efficient way. The right solution is the one that makes future requirements easier rather than harder to implement. Unless you consult standardised design patterns, this can be very much a gut instinct. Of course instinct is really the weight of experience. In this case I had made several starts on a solution but become uncomfortable with it and backtracked. I finally got it clear in my head when I was up in the hills. An environment like that forces you to think things through rather than simply launch into something.
I was just watching a Jack Johnson DVD. He said that when he wanted to write a song, sitting down with a pen and paper didn't work for him. Instead, he would go surfing, and the melody would come to him out there on a wave. Brains don't like to be forced.