Pair programming is one of the technical practices from Extreme Programming (XP). I have observed that pair programming works best when either member of the pair are in discovery mode. If there is little discovery going on, by either of the developers, there is little point in pairing.
pair programming works best with a large uncertain search space of problems and solutions. the closer to a solved problem, the less it helps
@KentBeck, 4 Oct 2012
Kent Beck is the author of the original XP book, so he clearly knows a thing or two about pair programming. Kent tweeted last year that pair programming is best with large uncertain problem spaces.
I would go even further. From my observations of teams using pair programming, pairing works best when either member of the pair are in discovery mode. In other words, at least one of the pair are dealing with a large number of unknowns, whether that is to do with the business domain or the technology.
Common examples of where at least one of the pair are in discovery mode are when:
- A pair of established team members are exploring a new area of the product
- A pair of juniors are trying to solve, together, what might be a straight forward problem for a senior
- An existing team member is pairing with a newbie to bring the new comer up to speed on the technology and/or domain
In the first two cases both partners are operating in discovery mode. But in the third example only the new comer is operating in the unknown. Pairing is still very useful here as it significantly increases the ability of the team to ramp up.
If the problem is well understood and so the solution fairly obvious then pairing is of relatively less value.
There is however another reason to use pair programming … people might just prefer operating like that. 🙂