# Pair Programming

> Two people write the same code together. One types and one checks.

**Field:** Software Development  
**Category:** Programming Concepts  
**Also known as:** Pairing, Pair Coding, Driver and Navigator

## Think of it like

Think of it like a rally car with a driver and a map reader. One steers. The other looks ahead.

## Definition

Pair programming is two developers working on the same code at one screen. One person, the driver, types. The other, the navigator, reviews each line and thinks about the bigger picture. They swap roles often, every 15 to 30 minutes. It catches mistakes as they are made and spreads knowledge across the team.

## Example

Jack is new to the payment code, so he pairs with Lucy for a week. By Friday he can change it alone, and they found two bugs on the way.

## Why it matters

Bugs found while typing are the cheapest bugs there are. And no part of the code is known by just one person.

## Common mistake

Letting one person type all day while the other just watches. Swap often, or the helper stops paying heed.

## Three principles

- **Driver and navigator.** One types, one guides.
- **Swap often.** Every 15 to 30 minutes.
- **Share what you know.** Knowledge spreads.

## Related terms

- [Code Review](https://learn.benibix.com/term/development/code-review)
- [Software Development Life Cycle (SDLC)](https://learn.benibix.com/term/development/software-development-life-cycle)
- [Clean Code](https://learn.benibix.com/term/development/clean-code)
- [Bug](https://learn.benibix.com/term/development/bug)
- [Extreme Programming (XP)](https://learn.benibix.com/term/business/extreme-programming)
- [Rubber Duck Debugging](https://learn.benibix.com/term/development/rubber-duck-debugging)

## Told apart from

- [Pair Programming vs Code Review](https://learn.benibix.com/compare/pair-programming-vs-code-review): Pair programming and code review both put a second pair of eyes on code, but at different times. In pair programming, two people write the code together. Mistakes are caught as they are typed. In a code review, one person writes it and another reads it later, before it is merged. Pairing gives quick feedback; review suits teams that work apart.

## Taught in

- [Clean Code and Naming](https://learn.benibix.com/learn/development-concepts/clean-code-and-naming): Programming Basics, 17/18

---

Source: https://learn.benibix.com/term/development/pair-programming
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
