Four Keys to Effective Pair Programming

Pair programming has become popular as companies embrace the Agile approach, and everyone’s full of anecdotes and opinions about whether or not it works. But regardless of the efficacy of the practice in general, there are a few things we can all do to become better at pairing.

1. Learn to Read Your Pair

Trying to hit a fifty-fifty split between driving and observing isn’t ideal or worthwhile. Sometimes, your pair might be in the mood to observe more than to drive, or vice versa. Learning to read your pair and and adjust for the circumstances usually results in a more productive and enjoyable session than switching off artificially to achieve an even split.

I’d suggest that you switch off reactively rather than proactively. Switch off when you feel the energy flagging. If your pair is observing, look for fewer questions, more passivity, and an overall lower level of engagement. If your pair is driving, look for general signs of fatigue like longer amounts of time spent context switching or trouble remembering details of the system.

2. Plan a Switch Slightly in Advance

When you feel like it might be time for a switch, ask your pair if they want to switch off in 30 minutes or so. It allows plenty of time for them to wrap up tasks, and it gives you both time to prepare your minds for the opposite task. Forcefully suggesting an immediate switch can be jarring and might suggest a lack of confidence in your pair. 

3. Suggest Some Solo Time

If you come across a particularly novel or interesting problem, it can be productive to break out of the pair for a short period of time to work on a solution by yourselves, planning a time to get back together and compare. This short break will allow you to see your pair’s approach to the problem while also providing the concentrated solo time that you may need to solve a problem.

4. Be Civil

This should go without saying, but you can’t be impatient or disparaging with your pair or the work they do. The point is to help make each other better, so there’s no room for toxic attitudes. If you find your own or your pair’s attitude deteriorating, it’s time to take a break.

Pair programming can be a great tool to improve the quality of the work you’re doing. Understanding your pair and how to manage your time together will help your sessions become more productive and enjoyable.