Le Carnet
Pour la gloire de Dieu et le salut du monde.

Don't Abuse Pair-Programming

Published on .
by Hubert Behaghel

One excellent thing that comes with the agile methodologies is the set of practices and ceremonies it has popularised if not standardised. Those practices have all one common prime goal: “to heal the divide between business and development1. It is a good thing to meditate as we could easily believe the main goal in Agile is code quality or developer empowerment. Hell no, it is about trust. Tell me how much your stakeholders trust you, I’ll tell you how agile you are.

How does pair-programming create trust? Well, I guess at first sight it doesn’t. At first sight it doubles the cost. That is not the best way to build trust. But trust is not something you make out of nothing, it’s a chain, it’s a web. For the business to trust the delivery team, the team has to trust itself, its processes, its skills, its tools and technologies and last but not least its solutions. Pair-programming addresses those concerns. Like everything in our professional life of engineers, it is a trade-off: engineering resources vs trust in the engineering. By pair-programming, we trust more our code. Each line is double-checked, each decision is debated. The whole codebase is more consistent and well understood back-to-back by the entire team.

Mind you, this doesn’t double the cost, far from it actually. Brains are like threads and even if Amdahl’s law applies, you still get a significant boost in productivity by having a pool of 2 vs 1. For me, the biggest benefit happens on debugging and focusing. Debugging requires challenging assumptions, looking at the issue from different angles. That parallelises well. Keeping focus while coding can be a challenge; I know it is the case for me. First it is intense for the brain. Mine tends to stay away from any prolonged effort… Second, coding often implies learning. Wikipedia, Stackoverflow, GitHub are good friends …as well as terrible distractions! Third, the process of coding is utterly preemptible with lots of IO: run that test, compile that code, deploy that project, restart that thing. The brain keeps going from 100% utilisation to 0%2. Hardcore. The pair is impressively efficient at keeping the task on track.

Therefore pair-programming drives trust by increasing quality and improving focus. But it has its downsides. To name a few:

All I am saying here is that if you’re pairing 100% of the time, you’re doing it wrong. It’s a wonderful practice but it comes with trade-offs. It’s no silver bullet, so don’t be a fundamentalist and acknowledge it is Individuals over Processes.

In other news, winter is coming.


  1. as stated by Kent Beck when opening the summit that produced the famous Manifesto. Watch Uncle Bob reminding us how it started here (tip: skip straight to 930, thanks Leon for the link). [return]
  2. ok, ok, 5% or we will lose the patient. [return]
  3. Not the Machine Learning branch ;-) [return]
  4. γνῶθι σεαυτόν, may be a good idea to have a mentor. I may blog about this later. Ping me if you’re interested, I’ll start working on it. [return]