What is pair programming and how does it relate to Agile?
Answer
Pair programming is an Extreme Programming (XP) practice where two developers work together at one computer — one "drives" (types code) and one "navigates" (reviews, thinks strategically). They switch roles regularly. Benefits: (1) Higher quality code — continuous review catches bugs immediately; (2) Knowledge transfer — junior/senior pairing builds skills faster than any training; (3) Reduced debugging time — fewer bugs produced means less time fixing later; (4) Better design — two people thinking through design produces better solutions; (5) Onboarding — new team members learn codebase faster through pairing. Relation to Agile: pairs directly embodies Agile values of individuals and interactions, self-organizing teams, and technical excellence. Contrary to intuition, studies show pairing increases productivity (despite using 2 people for one task) because quality improvements and bug reduction more than compensate. Not all tasks benefit equally — repetitive/simple tasks may not need pairing. Mob programming (whole team, one screen) is the extreme extension.
Previous
What is a cumulative flow diagram?
Next
What is Test-Driven Development (TDD) in an Agile context?