Nguyen Le Phong

Pair Programming: Love It or Hate It?

What studies found about pairing, which work is worth two people's attention, and how to run sessions (in person or remote) that don't leave everyone drained.

Two chairs, one monitor, and the cursor hasn't moved in ten seconds. One person is working through what happens when the refund amount is zero. The other is squinting at the test name: test_refund_works. "Works how, though?" From the hallway this looks slow. At the desk, a wrong assumption just died before it ever reached a pull request.

Two engineers sit close to one monitor, both paused while they think through an edge case.
Good pairing can look slow from across the room. Up close, two people are catching a mistake while it's still cheap to fix.

Few practices split a team like pairing does. Some engineers love the shared focus. Others find it draining, exposing or just slower. Both camps are usually describing something real, which is why "should we pair?" is a less useful question than "which work is worth two people's attention?" This post looks at what the research actually found, where pairing earns its cost, and how to keep a session from turning into a long, awkward screen share.

What the research found

The early numbers come from a 1999 experiment at the University of Utah, written up by Alistair Cockburn and Laurie Williams in The Costs and Benefits of Pair Programming. Advanced undergraduates in a software engineering course were split between solo work and pairs. After a first assignment to settle in, the pairs spent about 15% more total time than individuals, and their code had about 15% fewer defects. The paper also reports better design quality, better team communication and more enjoyment. Keep in mind these were students on class projects, not a product team with deadlines and on-call.

A later meta-analysis by Hannay, Dybå, Arisholm and Sjøberg pooled 18 studies (The effectiveness of pair programming, 2009). Overall they found a small positive effect on quality, a medium positive effect on duration (pairs finish sooner on the calendar) and a medium negative effect on effort (more person-hours in total). The detail is more useful than the averages:

  • On simple tasks, pairs were faster, but the quality was noticeably lower.
  • On complex tasks, pairs produced higher-quality solutions, at the price of considerably more effort.

The authors also flag large differences between studies and signs of publication bias, and their conclusion is to pay more attention to the factors that change the outcome. So the evidence doesn't say "always pair" or "never pair." It says the task matters, and that matches what most teams feel in their bones.

Where pairing pays for itself

Birgitta Böckeler and Nina Siessegger's long guide On Pair Programming lists the benefits teams report: knowledge sharing, reflection from explaining things out loud, staying on track, code review as you go, and collective ownership, since every line has been seen by at least two people. In practice, that value shows up most in a few kinds of work:

  • Changes that are expensive to get wrong: payments, data migrations, auth, anything touching permissions.
  • Bugs nobody understands yet. A second person asking "how do we know that?" saves a lot of wandering.
  • Code nobody really owns. Pairing on it leaves two people who know it instead of zero.
  • Onboarding. A new teammate picks up how the team names things, runs tests, moves around the codebase and recovers from a red build, all of which is hard to get from a wiki.
An experienced engineer and a newer teammate share a desk during an onboarding pairing session.
In onboarding, the newcomer picks up more than the code: naming habits, the trade-offs people argue about, how the team gets back on track after a mistake.

Routine, well-understood work is where the meta-analysis found pairing faster but sloppier, and it's also where most people would rather have their headphones on. Böckeler and Siessegger add a sharp twist: if a task feels too boring to pair on, that can be a smell of bad design, and pairing might help find the abstraction that makes the boring part go away. Worth a try before you write the same mapping code for the sixth time.

How to make a session work

The same article describes three common styles:

  • Driver and navigator: the driver types and focuses on the next small step, the navigator watches the bigger picture and reviews as the code appears. Switch often.
  • Ping-pong: one person writes a failing test, the other makes it pass, then they swap. It fits naturally with TDD and keeps both people busy.
  • Strong-style: Llewellyn Falco's rule is that "for an idea to go from your head into the computer it MUST go through someone else's hands." The person who knows less drives. The article calls it great for initial knowledge transfer, but warns it shouldn't be overused.

Whatever the style, rotate the keyboard. When one person drives for two hours, the other slowly turns into an audience and the pair loses half its value. A timer helps, and so do breaks. The article says plainly that pairing "can be an exhausting practice" and suggests Pomodoro-style blocks, with breaks spent away from the screen rather than catching up on Slack.

Watch the power dynamics

Böckeler and Siessegger call power dynamics "probably one of the hardest challenges" in pairing. A senior who grabs the keyboard, a junior who nods along, a suggestion brushed aside without discussion. Good pairs speak in small, low-stakes questions: "What behavior are we proving here?" "What happens if this comes back null?" "Want to write the failing test first?" Pairing puts half-formed thinking in front of another person. It only works if both people treat that with care.

Remote pairing without the fatigue

Remote pairing adds lag, notification noise and the odd feeling of staring at someone else's cursor. The article's practical tips: use tools that let both people control the keyboard, turn video on so you can see when your partner is confused, wear a decent headset, and switch whose machine hosts the session when the network gets laggy. Two more habits help a lot: set one narrow goal at the start, and leave a three-line note at the end covering what changed, what's left and what you decided. Without those, a remote session can drift into a long call where code happens now and then.

An engineer in a remote pairing session with a short handwritten note next to the keyboard.
Remote pairing holds up best with a narrow goal, a session short enough to keep energy up, and a short note left behind.

So, love it or hate it?

Pairing works well as a short, intense block of shared focus. For an hour, two people point their attention at one hard problem and keep each other honest. Then they split up and carry on alone, each with more context than before. That rhythm respects both the people who think best out loud and the people who think best alone, and software needs both kinds of thinking.

Try this week

  • Look at your board and mark the one ticket that's riskiest or least understood. Pair on that one, and nothing else.
  • Set a 25-minute timer and swap the keyboard every time it rings.
  • Try ping-pong on the next change that already has a clear test.
  • End the session with a three-line note: changed, left, decided.
What did you think?

Frequently asked questions

Does pair programming actually improve code quality?
Somewhat, and mostly on hard tasks. A 2009 meta-analysis of 18 studies by Hannay and colleagues found a small positive effect on quality overall. Pairs produced higher-quality solutions on complex tasks, though at considerably more effort, while on simple tasks they were faster but noticeably lower in quality.
Is pair programming twice as expensive?
Not in the studies we have. In a 1999 University of Utah experiment with advanced undergraduates, reported by Cockburn and Williams, pairs spent about 15% more total time than individuals and produced code with about 15% fewer defects. The 2009 meta-analysis found pairs finish sooner on the calendar but use more total effort.
When should a team pair, and when should people work alone?
Pair on work that is risky, poorly understood or new to someone: payments, migrations, auth, confusing bugs, code nobody owns and onboarding. Work alone on routine, well-understood tasks, where studies found pairing faster but sloppier and where focus time matters more.
What are the common pair programming styles?
Driver and navigator, where one person types and the other reviews and watches the bigger picture; ping-pong, where one writes a failing test and the other makes it pass; and strong-style, where ideas must go through the other person's hands, which suits onboarding. In every style, swap the keyboard regularly.
How do you make remote pair programming less tiring?
Use tools that let both people control the keyboard, keep video on, use a good headset and switch the host machine if the connection lags. Keep sessions short with breaks away from the screen, set one narrow goal at the start and finish with a short note on what changed, what's left and what you decided.