top of page

Pair Programming That Helps — Mentoring Engineers, Part 2

Shift Quality Editorial
Oct 2
7 min read

Updated: Oct 4

Mentoring Engineers · Part 2

A staff engineer pairs with a new junior engineer every afternoon for three weeks. The sessions feel productive. The staff engineer drives, talks through what they're doing, and the junior nods along and asks good questions. Then the staff engineer goes on leave for a week. The junior picks up a bug in the same service and spends two days on something the pair would have fixed in an hour, because every decision that mattered had happened in the staff engineer's head and come out of their hands.


The pairing wasn't lazy. It was the most common kind of senior–junior pairing: a demonstration with commentary. The junior watched a skilled person work. Watching is a weak way to learn a skill, and narration only carries the parts of the reasoning the narrator thinks to say out loud.


The working claim for this part: pairing teaches when the junior's hands carry the senior's reasoning, and the reasoning gets said before the code gets typed. The research on pair programming mostly measures output, not mentoring, so it's worth being clear about what it does and doesn't tell you before deciding how to pair.


Before you start


  • Pick the work you'll pair on this week and write down why it's worth pairing on (Step 1 gives the test).

  • Agree a stop time before you start. Pairing is tiring, and the last hour of a long session teaches very little.

  • If you're remote, check you can both drive: shared editor or remote control, and a reliable way to hand over in seconds.


Step 1: Pair on work where the junior can't yet see the decisions (10 min)


The research gives a useful steer on when pairing pays. Hannay et al.'s 2009 meta-analysis of pair programming experiments found a small positive effect on quality, a medium positive effect on duration and a medium negative effect on effort: pairs finish sooner but spend more combined hours. The detail matters more than the averages. Pairing came out faster on simple tasks, and produced better solutions on complex ones. Arisholm et al. (2007), a large study with 295 professional consultants, found junior pairs were more likely to produce correct solutions on a complex system, but not on a simple one.


Those studies measure pairs as producers, not as mentoring relationships. But the pattern carries over: the value is highest where the work hides its decisions. Pair on the unfamiliar part of the codebase, the risky migration, the first design for a new feature. Don't pair on a well-understood CRUD endpoint; let them do that alone and review it.


Test you can run: for the task you've picked, list three decisions the junior would have to make that they couldn't make well today. If you can't name three, it's a review task, not a pairing task.


Step 2: Use strong-style pairing for knowledge transfer (15 min)


Böckeler and Siessegger's guide to pairing (2020) describes a technique built for this: strong-style pairing, where "for an idea to go from your head into the computer it MUST go through someone else's hands." The experienced person navigates. The junior drives, and types only what they've been told or have proposed and had agreed.


It feels slow for the first session. That's the point. Every decision now has to be said out loud before it happens, which forces the senior to explain things they normally do without thinking, like why they're checking the caller before changing a function signature. The junior is encouraged to be comfortable with incomplete understanding during the session, and to ask "why" afterwards rather than stopping every line.


Test you can run: record (or just tally) a 30-minute session. Count how often the senior took the keyboard. More than twice means you've slipped back into demonstration.


Step 3: Say the reasoning before the action (10 min)


Narration ("now I'm adding a test") describes what is happening. Reasoning ("I want a failing test first because I'm not sure the bug is in this function") is what the junior can reuse next time. Ask the navigator to lead with the why, and the driver to restate it in their own words before typing.


Test you can run: after a session, ask the junior to write down the two most important decisions you made together and why. Compare with your own list. If the "why" column doesn't match, the reasoning never transferred.


Step 4: Rotate roles as competence grows (10 min)


Strong style is a starting point, not a permanent arrangement. As the junior begins proposing the next step before you say it, hand them the navigator role for parts of the session and drive yourself. Being navigated by someone junior is the clearest signal of where their model of the system is wrong, because they have to say their plan before you act on it.


Stage

Who navigates

What the senior is doing

Weeks 1–2

Senior

Making decisions explicit; the junior builds a model

Weeks 3–4

Mixed, swap every 25 minutes

Checking the junior's plans before they're executed

After that

Mostly the junior

Asking questions; stepping in only on real risk


Test you can run: in week three, let the junior navigate for 20 minutes. Note every time you would have chosen differently. Each one is a teaching point for the debrief, and the count should fall week on week.


Step 5: Let them be wrong when it's cheap (10 min)


If the junior proposes something that won't work, and finding out costs ten minutes in a local environment, let them find out. Then talk about what told you it wouldn't work. That conversation teaches the signal, not just the answer. Step in immediately only when being wrong is expensive: data loss, production, security, or an hour of rework.


Test you can run: after each session, count how many times you corrected the junior before they'd had a chance to see the problem themselves. If it's most of the corrections, you're protecting the code at the cost of their learning.


Step 6: Keep sessions short and end with a debrief (10 min)


Pairing in 60–90 minute blocks with breaks works better than a full day. End each block with five minutes: what did we decide, what surprised you, what would you do alone next time? The debrief is where "comfortable with incomplete understanding" gets resolved.


Test you can run: ask the junior, a day later, to explain one thing from the session to someone else on the team. If they can't, the debrief was skipped or too shallow.


Remote pairing changes the mechanics more than the method. Both people need to be able to drive without fuss, so a shared editor beats screen sharing with "can you scroll up?". Cameras on helps the navigator see hesitation, which is often the earliest sign the driver is lost. And breaks matter more, because a video call is more tiring than sitting side by side.


Step 7: Plan the taper (5 min)


The goal of mentoring pairing is that they stop needing it for this kind of work. Agree the exit at the start: "We'll pair on the payments service until you've shipped two changes there, then you'll do the third and I'll review." Pairing with no end becomes dependency, for both of you.


Test you can run: check your calendar for the last month. If you're pairing with the same person on the same kind of work as four weeks ago, the taper hasn't happened.


Worked example: the reconciliation job (composite scenario)


A senior engineer at a logistics company was pairing with a junior on a nightly reconciliation job that matched shipments against invoices. For two weeks the senior drove. The junior could describe the job's structure but couldn't change it.


They switched to strong style. The first session was painful: 90 minutes for a change the senior could have made in 20. But it surfaced something the senior had never said out loud: they always ran the job against a copy of the previous night's data before touching the matching rules, because the rules had edge cases no test covered. That habit lived nowhere except in the senior's routine.


By week four, the junior was navigating. In one session they proposed adding a new matching rule directly. The senior asked what would tell them it was safe. The junior paused, then said "run it against last night's data first", unprompted. The senior took that as the real milestone. The junior hadn't just learned the code; they'd picked up the habit that protected it. Two weeks later the junior shipped a rule change alone, with the dry run in the pull request description.


Trade-offs to make deliberately


Choice

You gain

You risk

Strong-style pairing

Reasoning has to be explicit; real transfer

Slow early sessions; senior frustration

Senior drives with narration

Speed; less awkward

The junior watches and learns little they can repeat

Daily pairing

Fast context transfer

Fatigue; the junior never builds solo confidence

Pair, then review

The junior works alone, with feedback after

Slower to catch misunderstandings early


Common failure modes


  • The senior drives the whole time. The junior watches a skill instead of practising it.

  • Narrating actions, not reasons. The junior learns what you did, not when to do it.

  • Taking the keyboard at the first snag. The junior never resolves a problem themselves.

  • Pairing on routine work. It costs two people's time for something a review would cover.

  • No exit plan. Pairing turns into dependency.


Final takeaway


Pairing transfers judgment only when the junior's hands carry the senior's reasoning, and the reasoning is said before the code is typed. Strong-style sessions, short blocks, a debrief and a planned taper turn an afternoon of watching into an afternoon of practice. Your next action: in your next pairing session, hand over the keyboard and don't take it back for 30 minutes. Write down every decision you had to say out loud that you'd normally have just made.


Sources


  • Hannay, J. E., Dybå, T., Arisholm, E. and Sjøberg, D. I. K. (2009). The effectiveness of pair programming: A meta-analysis. Information and Software Technology, 51(7), 1110–1122.

  • Arisholm, E., Gallis, H., Dybå, T. and Sjøberg, D. I. K. (2007). Evaluating Pair Programming with Respect to System Complexity and Programmer Expertise. IEEE Transactions on Software Engineering, 33(2), 65–86.

  • Böckeler, B. and Siessegger, N. (2020). On Pair Programming. martinfowler.com, 15 January 2020.



Continue the Mentoring Engineers path



Part of the Mentoring Engineers learning path. Related: Pair Programming: When It Works and When It Doesn't · Code Review That Teaches.

bottom of page