i’ve moved my code

My website, kevinrutherford.co.uk used to be implemented using the Drupal CMS. I did that because I wanted to host various code samples and suchlike, but in the end it was rubbish. So this week I killed it and replaced it with the much simpler 1-page site you can see there now. As a consequence I’ve moved all of my old code samples to repositories on github. All much easier for me to maintain.

The one downside to all this is that I no longer have somewhere to host my simulation of coin tossing. Well, that’s a shame, but not the end of the world. If you want to try it you can clone the github repository; or you can simply look at the three sample outputs I’ve posted here, here and here. Not a live simulation, I know, but possibly the next best thing for now.

red, green, refactor … commit

As time passes I find myself getting more and more nervous about the amount of time between passing tests, and between commits to the source code repository. So when Neil asked me today where I put the “commit” step in my TDD practice, I said:

red
green
   commit
refactor
   commit

That extra “commit” at the green bar captures the safe state, in case I get distracted by the kids or forget to take my medication. It also shares that working code with the rest of the team, which in turn makes sure I get feedback on whether it builds. And that also makes sure those tests get run more frequently and outside of my environment sooner.

Recently I’ve been learning to use Git (which I like a lot, although some of the differences from Subversion stil baffle me a little). Anyroadup, with Git I can get even more safety from the process:

red
   commit
green
   commit
   push
refactor
   commit
   push

The extra “commit” at the red bar is local to my repository. It means I can “stop on a red bar”, as used to be recommended in the early days of TDD, and yet still have all my code checked in.

I wonder whether I’m becoming more paranoid as Old Age now has me in its grip…