Pair programming and mob programming (also called ensemble programming) are collaborative development practices where two or more developers work together at a single workstation or shared codebase. These techniques originated in Extreme Programming (XP) and have evolved significantly, especially with AI assistants and remote work. The fundamental insight is that continuous code review during development often produces higher quality code faster than working solo and reviewing later. While pair programming focuses on two people (a driver and a navigator), mob programming extends the model to the entire team working simultaneously on the same task, creating what practitioners call "continuous integration of ideas."
What This Cheat Sheet Covers
This topic spans 11 focused tables and 75 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Pair Programming Roles
| Role | Example | Description |
|---|---|---|
Types code while navigator provides direction: function calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0);} | • Person at the keyboard writing the actual code • focuses on tactical implementation while following navigator's strategic guidance | |
Reviews code in real-time: "Let's add validation for empty arrays before the reduce" | • Person observing and thinking ahead • spots bugs, suggests refactorings, considers edge cases, asks questions • stays zoomed out while driver stays zoomed in | |
Navigator: "Extract the price calculation into a separate function" Driver implements without adding own ideas | • Navigator provides specific instructions at the highest level of abstraction the driver can understand • driver acts as "smart keyboard" typing only what navigator directs | |
Switch roles every 10–15 minutes using a timer | • Regular role swapping prevents fatigue and ensures both partners stay engaged • typical intervals are 10–20 minutes, adjusted based on task complexity |