Key practice in effective product development culture.
Pair programming is two programmers working together on the same problem at the same time.
NOTE: Although the Agile Alliance includes sharing a single workstation as part of the definition, I don’t consider this required. For example, remote pairing and head-to-head pairing (pairs face each other on their own machines).
Whole Team programming (aka mobbing or ensemble) is a team of people working together on the same problem at the same time.
What problems does pair (or whole team) programming solve?
The constraint is not typing speed
Typical sequence for programming:
- Understand the problem;
- Understand the existing code;
- Design the change;
- Type it in;
- Validate that the change works;
- Clean up;
Most of the constraint in programming speed tends to be around understanding and designing, not typing. Adding additional brains can help accelerate understanding and designing.
Typical sequence for asynchronous code review:
- Write code;
- Submit code for peer review;
- Wait for a reviewer to respond (sometimes days);
- Reviewer adds comments — asynchronous back-and-forth (sometimes days);
- Fix code if necessary
Typical sequence for synchronous, continuous review when pair (or whole team) programming:
- Write code and review it immediately.
Balancing peaks and troughs
Energy levels naturally ebb and flow when programming. When, when one programmer’s energy levels ebb, the pair can pick up the slack and vice versa.