Pair Programming
debt(d7/e3/b5/t7)
Closest to 'only careful code review or runtime testing' (d7). The detection_hints confirm no automated detection is possible — the code pattern indicator is 'complex features developed in isolation without knowledge transfer,' which requires human observation of team process, not tooling. There is no linter, compiler, or SAST that flags absence of pairing.
Closest to 'simple parameterised fix' (e3). The quick_fix is straightforward: establish a role-switching rhythm (e.g. Pomodoro). Common mistakes like passive watching or role imbalance are corrected by process adjustments within the team, not architectural rework. It touches team habit and possibly tooling setup but stays within one component (the team's working practice).
Closest to 'persistent productivity tax' (b5). Pair programming applies across web and CLI contexts and shapes how all development work is structured day-to-day. Done poorly (never pairing, or pairing badly), it imposes a sustained productivity tax via knowledge silos and defect rates across many work streams. Done well it's a net positive, but the structural commitment to a pairing culture affects many ongoing decisions.
Closest to 'serious trap' (t7). The misconception field states the canonical wrong belief clearly: 'pair programming halves productivity because two people do one person's work.' This directly contradicts naive intuition and typical management metrics (lines of code, throughput), and it contradicts how solo development is commonly measured. A competent developer unfamiliar with the research will confidently guess the wrong thing about its cost-benefit, making it a serious cognitive trap.
Also Known As
TL;DR
Explanation
Pair programming (from Extreme Programming) has the driver write code while the navigator reviews, considers the bigger picture, and catches mistakes in real time. Pairs switch roles regularly. Benefits include: immediate code review, shared knowledge preventing silos, higher design quality from continuous discussion, and faster onboarding. Studies show it produces fewer defects at a modest productivity cost. Remote pairing tools (VS Code Live Share, JetBrains Code With Me) make it viable for distributed teams. Not all tasks benefit equally — exploratory or complex tasks see the most gain.
Common Misconception
Why It Matters
Common Mistakes
- One person driving while the other passively watches — both must be actively engaged.
- Not switching driver/navigator roles frequently enough — one person dominates.
- Pairing as a productivity metric tool — it is a quality and knowledge-sharing tool, not an output maximiser.
- Never pairing — lone developer silos cause knowledge concentration and missed design opportunities.
Code Examples
// Pairing anti-pattern — one person types, other watches:
Developer A: [typing intensely]
Developer B: [watching YouTube on phone]
// No knowledge transfer, no second perspective, no benefit
// Productive pairing:
Developer A (navigator): 'We should validate the email before saving'
Developer B (driver): [typing validation] 'Good catch — should we also check uniqueness?'
Developer A: 'Yes, let's add that test first'
# Pair programming patterns for PHP teams
# Driver-Navigator:
# Driver: writes code
# Navigator: reviews in real-time, thinks ahead, spots issues
# Switch every 25 minutes (Pomodoro)
# Ping-Pong (TDD pairing):
# Dev A writes a failing test
# Dev B makes it pass, then writes next failing test
# Dev A makes it pass → repeat
# Tools for remote pairing:
# VS Code Live Share — shared editing, terminals, debugging
# JetBrains Code With Me — PhpStorm native
# tmux + Vim — terminal-based, ultra-low latency
# Benefits:
# - Knowledge transfer (no bus factor for critical paths)
# - Real-time code review (fewer PR back-and-forths)
# - Architecture decisions made together (fewer rewrites)
# Start with 20% of dev time — high-complexity or high-risk work