How do you decide when to pair program?

At the XpDay 08 conference today, I participated in a workshop on pair programming organised by Matt Wynne and Laura Plonka. The participants were spit into several groups, discussing various challenges for the adoption and implementation of pair programming. I was in a group which was given a task to come up with the answer of when pair programming is appropriate.

The discussion that followed turned out to be very indecisive. Some people thought that pair programming is appropriate for all the tasks, whenever a line of code was added, removed or changed. Most people argued that pair programming is not always justified, for example for mundane tasks or for simple tasks where the second pair of eyes does not really bring any benefit. We tried to define it more precise, but every time someone came up with an example when pair programming should not be applied, someone else presented a different view. We ended up agreeing that code refactoring and cleanup is something that pairs should do in all cases, but for any other tasks we did not have a general agreement. Drawing a precise line when to apply it and when not turned out to be virtually impossible.

On the end, we came up with a proposal to start pairing on all tasks, and then five or ten minutes later decide whether the task actually justifies having two people to work on it together or not. That way we turned the question upside down. We concluded that we should not really think of deciding when to pair program, but splitting the pair temporarily if they both agree that for a particular task there is no benefit.

see more news from xpday 08