Pair Programming
Pair programming is a collaborative software development technique in which two developers work together at one workstation, with one actively writing code (the driver) while the other reviews each line in real time and thinks ahead…
Definition
Pair programming is a collaborative software development technique in which two developers work together at one workstation, with one actively writing code (the driver) while the other reviews each line in real time and thinks ahead strategically (the navigator).
Overview
Rather than each developer writing code independently and reviewing it later through a pull request, pair programming has two people working on the same task simultaneously and continuously. The driver handles the keyboard, focusing on the immediate syntax and tactical implementation, while the navigator considers the bigger picture — spotting edge cases, thinking about design and architecture, and catching mistakes as they happen rather than after the fact. Pairs typically switch roles regularly, sometimes every few minutes using a timer, to keep both people actively engaged. The technique is a core practice in Extreme Programming (XP) and is widely used alongside other agile methods, on the premise that catching a bug or a design flaw during authoring is far cheaper than catching it during code review or, worse, in production. Studies and industry experience generally report that pairing reduces defect rates and knowledge silos — since both people fully understand the code that was written — at the cost of consuming two developers' time for one deliverable, which teams weigh against the reduced need for separate review cycles and rework. Remote-friendly variants have grown common, using shared editors like VS Code's Live Share or tmux-based terminal sharing so that pairs need not be physically co-located. A related but distinct practice, “mob programming,” extends the same idea to an entire team working together on one problem at once, useful for particularly complex or high-stakes changes where many perspectives add more value than they cost in coordination overhead. It is often mentioned alongside Test-Driven Development (TDD) in this space.
Key Concepts
- Two developers work together at one workstation on the same task
- One person drives (writes code), the other navigates (reviews and strategizes)
- Roles typically rotate regularly to keep both participants engaged
- Core practice within Extreme Programming (XP) and agile teams generally
- Catches bugs and design issues during authoring, not after the fact
- Spreads knowledge of the code across more than one person immediately
- Increasingly done remotely via shared editors and screen-sharing tools