Pair Programming
A collaborative practice in which two developers work on the same problem together, continuously reviewing and shaping the code.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/pair-programming/
01What it means
Pair programming places two developers at one active workstation or shared development session. One person, often called the driver, handles the immediate mechanics of editing and running code. The other, often called the navigator, considers intent, design, risks, and next steps. Both remain engaged and exchange roles regularly; it is joint development rather than one person coding while another passively observes.[1][2]
- DriverWorks at the keyboard on the immediate step
- Keeps the implementation visible and explains local choices
- NavigatorReviews continuously and considers the wider direction
- Anticipates design, tests, risks, and the next step
- Role rotationSwitches attention and control frequently
- Prevents fatigue and preserves shared ownership
- Shared outcomeOne jointly understood, tested change
- Knowledge and review happen during construction
Pairing is collaborative design and review, not one person dictating while another types; role rotation and psychological safety distribute participation and learning.
02Why it matters
Pairing shortens the distance between proposing an idea and receiving review. It can spread system knowledge, reveal assumptions, support onboarding, and help developers solve unfamiliar or difficult problems. The continuous conversation may improve design decisions and reduce handoff loss, although outcomes depend on the people, task, and working conditions.
03When to use it
Use pairing for complex changes, incident diagnosis, risky code, unfamiliar areas, onboarding, or work where rapid shared understanding is valuable. It can be in person or remote with suitable tools. Not every routine task requires two people, and sustained pairing should include breaks and allow participants to opt out or rotate.
04How it works
- Agree on the problem, a near-term goal, and how the pair will communicate and rotate.
- Set up a shared environment in which both participants can see, discuss, and control the work.
- Let the driver implement the next small step while explaining decisions and uncertainties.
- Let the navigator review continuously, consider broader consequences, and suggest experiments rather than dictate keystrokes.
- Switch roles frequently enough to preserve participation and shared ownership.
- Pause to test, summarize learning, and decide whether continued pairing remains worthwhile.
05A practical example
A new engineer pairs with a service maintainer to add an idempotency key. The newcomer drives while the maintainer explains failure modes and asks questions about duplicate requests. They alternate after writing each test, discover an undocumented retry path, and leave both the implementation and system documentation stronger.
06Where it breaks
Pairing consumes two people's attention at once and can be exhausting when used without breaks. Skill, power, communication style, accessibility needs, time zones, and tool latency affect whether participation is equitable. It can also spread a mistaken assumption quickly, so pairs still need tests, external review for high-risk changes, and independent thinking.
Common mistakes
- Allowing the more experienced participant to keep control and turn the session into observation.
- Pairing continuously without breaks, rotation, or attention to cognitive fatigue.
- Using pairing as surveillance or as a substitute for supportive onboarding.
- Assuming two participants eliminate the need for automated verification.
07Sources
- Pair Programming: Does It Really Work?Agile Alliance · Professional practice guidePair Programming: Does It Really Work?
- Pair Programming vs. Mob ProgrammingAgile Alliance · Professional comparison guidePair Programming vs. Mob Programming