I typed up the following in response to Bryan Liles’ recent Pair Programming Showdown. There are better pair programming lists out there, but this is mine for today.
positive:
- distractions are less common, it needs to be something that distracts both of you; get back into “the flow” faster (also a reason to do TDD); helps those among us with Attention Deficit be productive at *all* (this is an important one for me).
- higher bus number, more team ownership of code, less personal jurisdiction
- communication of design decisions is much easier/faster: “here, let me show you what I mean.”
- creative tension, generally leads to better design decisions, better names for variables/classes/etc, better quality. Automatic “code review” on all pair produced code, at the time when it’s easiest to enact suggestions.
- because you’ve cut the number of concurrent tasks your team can work on in half, you’ve made it easier to coordinate a larger team and juggle the team’s current tasks and priorities. In other words, pairing makes it easier to scale the team. Your team members are less likely to step on each other’s feet.
- team culture grows more quickly, quick tips (did you know how to do X in vim? see how inject makes this simpler?) spread through the team more quickly. This could be mentoring of junior developers, or new fresh ideas for senior developers, or peers balancing and pulling each other out. A pairing team tends to gravitate towards the *highest* common denominator, versus individuals working together, tend to be bottlenecked by the weakest link.
- pairing and TDD(BDD) go great together, even if you aren’t occasionally ping-pong pairing
- morale boost: team camaraderie grows faster.
difficult or negative:
- requires soft-skills, i.e. getting along with other devs, communicating, not being stubborn, etc.
- good pair programming is a learned skill, but often is treated like something that should Just Work (and is obviously no good if it goes poorly on the first try).
- the pairing experience can be spoiled by either person in the pair.
- programmers are overwhelmingly introverts, and we would much rather just work (and be) alone, even if it isn’t the best thing for the team.
- fewer tasks can be done concurrently. When you are being asked to finish 20 “highest priority” tasks by yesterday, even though it is probably faster to have four people pair on them, doing only two tasks at a time, our instincts are to divide and conquer (four tasks concurrently).
- either there is no music (no headphones) or you need to agree/compromise on what to listen to.
- it can be hard to replace the personal pride of “I did this” with the team pride of “we did this”, even if “We did this” really means “I did this and so-and-so helped out and it was better than if I did it alone.”
- pairing (done right) can be more exhausting than working alone. this is mostly because you aren’t getting distracted as much, you are forced to defend your (often bad) ideas, and you have gotten more done. but still, it’s more *work* than working alone.
- working with different editors is tricky. doable, but tricky. it slows you down and dampens some of the benefits.
- remote pairing is tricky. doable, but tricky. it slows you down and dampens some of the benefits.
- Awkward pairing:
- mindless routine tasks feel like a waste of time, and sometimes they are.
- research and spiking and experimentation are sometimes very appropriate for pairing, sometimes not at all, and it’s hard to tell when is which (very context sensitive).
- pairing without the cadence of TDD(BDD) often feels awkward. (ahem… perhaps you should start to TATFT then!)
- pairing done wrong (and sometimes even “done right”), might not *feel* very productive to one member of the pair. at that point, that person probably feels it is a waste of time, and the other person feels slightly guilty for wanting to pair. Note, this might be far more about emotions and perception than about logic and empirical reality.
In summary
Because of the above positives, pairing usually results in better code, done in less time, with more team members able to take ownership over it, than if the developers had worked on it individually. Programming isn’t constrained by typing speed but by thinking, and two heads are better than one.
The above negatives mean that (in my experience), even when an entire team agrees that pairing is a good thing (in the abstract or based on experience) and the team has agreed to pair some or most of the time, the team often pairs less often or gets less out of it than expected.
Unfortunately, although I’ve experienced all of the positive reasons for pairing, I tend to get far too influenced and disheartened by the negative. As a result, I usually pair far less often than I know I should, and both I and my team are less effective as a result. Any suggestions?
See also these posts: Obie Fernandez, responding to criticism of his pair programming comments, Mike Hill: How TDD and Pairing Increase Production.

