Thursday, May 25, 2006

Pair Programming Anti-Patterns

Pair programming is hard. Previous to working at ThoughtWorks I had a manager who requested that the team do pair programming. The idea failed miserably, but it wasn't pair programming that was flawed, it was our approach. Below is a short list of the mistakes I've witnessed, but it's by no means a complete list.
  • People who don't care. This is the biggest pair programming killer. If your employees are only there for the paycheck they will make pair programming fail. Getting two employees on the same schedule is hard. Once two employees get on the same schedule one will daydream while the other works. This is very boring, but to people who don't care, it's better than working.
  • Strong code ownership. It's often very hard to motivate people to care about code they aren't responsible for. For more info on code ownership see Martin's bliki entry.
  • Inconsistent workstation setup. People like to work in their own environment. Unfortunately, when pairing you are unlikely to find two people who agree on what an environment should be. The solution is to provide pairing stations with standard setups. Instead of trying to learn multiple environments, the team can work on one shared setup.
  • Small work area. People like to be comfortable. Putting two chairs in one cube where one person's view is obstructed is very unlikely to produce good results. On the ThoughtWorks projects I've been staffed on we always have a project room that has enough room to sit side by side, two monitors that mirror the desktop, two mice, and two keyboards. This allows either person to take control when necessary.

1 comment:

  1. Anonymous4:17 PM

    Good insight! Pair programming IS hard but its even harder convincing others of its usefulness in appropriate situations.

    I agree that a flawed approach to PP leads to disasterous results. I also believe that although it is beneficial to some, the idea may not be a thing for all. When instituted in the right setting and with the right pair, Pair Programming will be advantageous. I have a few other views on this controversial subject on my blog. Please feel free to check it out:

    http://www.testearly.com/2006/05/25/are-two-heads-really-better-than-one/

    ReplyDelete

Note: Only a member of this blog may post a comment.