Sie sind auf Seite 1von 2

Pair Programming

Pair programming really deserves its own book. It is a subtle skill, one that you can spend the rest

of your life getting good at. For the purposes of this chapter, we'll just look at why it works for XP.

First, a couple of words about what pair programming isn't. It isn't one person programming while

another person watches. Just watching someone program is about as interesting as watching

grass die in a desert. Pair programming is a dialog between two people trying to simultaneously

program (and analyze and design and test) and understand together how to program better. It is a

conversation at many levels, assisted by and focused on a computer.

Pair programming is also not a tutoring session. Sometimes pairs contain one partner with much

more experience than the other partner. When this is true, the first few sessions will look a lot like

tutoring. The junior partner will ask lots of questions, and type very little. Very quickly, though, the

junior partner will start catching stupid little mistakes, like unbalanced parentheses. The senior

partner will notice the help. After a few more weeks, the junior partner will start picking up the

larger patterns that the senior partner is using, and notice deviations from those patterns.

In a couple of months, typically, the gap between the partners is not nearly so noticeable as it was

at first. The junior partner is typing more regularly. The pair notices that each of them has

strengths and weaknesses. Productivity, quality, and satisfaction rise.

Pair programming is not about being joined at the hip. If you look at Chapter 2, A Development

Episode, you will notice that the first thing I did was ask for help. Sometimes you are looking for a

particular partner when you start a task. More commonly, though, you just find someone who is

available. And, if you both have tasks to do, you agree to work the morning on one task and the

afternoon on the other.

What if two people just don't get along? They don't have to pair. Two people who can't pair make

arranging the rest of the pairings more awkward. If the interpersonal problem is bad enough, a few

moments shuffling pairs is better than a fist fight.

What if someone refuses to pair? They can choose to learn to work like the rest of the team, or

they can choose to look for work outside of the team. XP is not for everybody, and not everybody
is for XP. You don't have to start pairing full-time the first day you work extreme, however. Like

everything else, you have to work toward it a little at a time. Try it for an hour. If it doesn't work, try

to figure out what went wrong and try it again for an hour.

Das könnte Ihnen auch gefallen