Getting things done with Agile and pens
2008-03-07 / 16:42 / dave
Maybe when pair programming works it works because when you schedule a pair programming session with your buddy, you force each other to get started.
Joel Spolsky Fire And Motion
Agile is all about
- Just get started
- Build for change
Joel says pair programming encourages the former. Test driven development is about the latter: unit tests make it easier to change your code in the future. If you always write tests first, you’ll have 100% coverage. Since you’re writing tests first, you’re also designing the interface you’d like to use. Finally, since you want to test components in isolation, TDD promotes loosely coupled code.
Brilliant! Well, when it works.
For awhile I was doing (fairly) strict TDD. I’d immediately write a test, watch it fail, then code until it passed. But sometimes, 2 hours later, I’d be down a rat hole. I’d coded myself into an interface dead end; all I could do was back up, burning the trusses on the way out. Occasionally I’d find that I’d gone down a rat hole in another house and was solving the completely wrong problem. Or, worst of all, that there was no problem in the first place. Like I was standing right next to a solution but said “Hey, let me go dig some holes in the basement of that haunted house in the middle of the ghetto! What could go wrong?” (answer: lots)
Clearly something was not working. So I grabbed a new tool: a pen.
Now I start out with a pad of paper covered with notes and arrows, sort of a verbose mind map. Writing things down organizes my thoughts so that I start coding with a clear idea of what the final code will look like. It changes along the way, of course, but I don’t have so many “oh shit” moments.
2 types of agile
I’m not saying you should go get make yourself a nice shiny pen, just that it worked for me. This is agile, or at least the small ‘a’ kind. I still think big ‘A’ Agile is the best methodology going, but only if you avoid getting ideological.
In other words, feel free to abandon “Agile”… but “agile” is forever.
(Just to be clear, this distinction has been pointed out by many people in many places, I just don’t have links.)
