Pair programming
Description
Code developed by programmers working in pairs is shorter and of higher quality than what they would produce individually, because the observer role allows for ongoing reconsideration and continuous improvement of the strategy and of the code the driver is writing. The continuous conversation between the two roles also speeds up error detection and design decision-making.
It is a core practice of Extreme Programming and part of the set of practices known as technical agility. In the Scrum Master 5.0 curriculum from Scrum Manager, it is referred to as "pair work"—a term that highlights how the concept extends beyond programming: it applies to any task where the quality of the outcome depends primarily on the knowledge of the person performing it.
The manual cites non-technological examples of the same logic: trains operate with an engineer and an assistant when technology cannot entirely prevent human error, and aircraft cockpits have two pilots for the same reason.
When it is especially valuable
- When the task requires a high level of concentration and a mistake could have significant consequences.
- When working on legacy code or on a part of the system the driver knows little about: the navigator can provide context.
- For onboarding new team members: pair programming with an experienced developer is one of the most effective ways to transfer tacit knowledge.
- When working with TDD: the red-green-refactor cycle works especially well in pairs, alternating who writes the test and who writes the code that makes it pass.
Pair programming with AI tools
The integration of AI assistants has given rise to a new kind of partnership, in which the AI produces content and the human provides oversight. While this analogy is useful, it has a significant limitation: in a human-AI partnership, the oversight must always come from the human, as the AI cannot take responsibility for the outcome, nor can it reliably detect its own errors. The person working with the AI remains an active supervisor—reading carefully, questioning the AI’s suggestions, and verifying the data—rather than simply accepting whatever appears on the screen.
Common mistake
Forcing pair programming on every task. Pair programming delivers its greatest value on complex, critical, or highly uncertain tasks. On routine or well-understood tasks, it can reduce productivity without a proportional gain in quality. The decision to work in pairs should rest with the team and focus on the tasks where the practice adds the most value. It should not be a bureaucratic rule applied indiscriminately.
Resources
📄 Scrum Master v.4.0 [in Spanish] — Section: technical practicesFree download · Scrum Manager
See also
Want to advance in agility? You can search for course and exam calls or go at your own pace by becoming a member of the Agile Club. This membership includes exclusive resources, e-learning classrooms, and access to Skill Arena: a space to practice and measure your agile skills at your own pace.