Pair Programming Guidelines


"Two heads are better than one," according to the old saying. This even applies to writing programs: a pair of programmers (working as described here) nearly always beats the stereotypical solitary loner. The pair produces more high-quality code in less time, by far more than two-to-one.

In pair programming, two programmers share one computer. One is the "driver," who controls the keyboard and mouse. The other is the "navigator," who observes, asks questions, suggests solutions, and thinks about slightly longer-term strategies. The two programmers switch roles frequently--every 15 minutes is a good interval, though the timing is flexible. Even the activities of the driver and navigator are flexible (except for who does the typing); the goal is to work collaboratively, each partner assisting the other as needed, to produce the best joint result possible. It is not pair programming if one person does all the work or if the partners just split up the work and each does half independently.

That's the basic idea: in labs you will be working with your partner, one of you as driver and the other as navigator, switching regularly. The pair of you will complete a single assignment on a single computer. Every week you will switch partners so that you are able to work with a variety of other students.

What about individual differences? People new to pair programming often ask what happens if the members of the pair have different abilities. The differences may be great or small, one member may have more strengths than the other, but this is exactly like most real-world working situations. Part of accomplishing a task is to get the most out of each member and make each member stronger and more productive on subsequent tasks.

A clearly stronger partner may feel frustrated or slowed down by the other partner, but the stronger partner still benefits from the teamwork in many ways: The other partner's requests for clarification often point out flaws in the approach or solution, the teamwork skills gained have great value in the job market (no matter in what field), and the exercise of providing a clear explanation solidifies and deepens the explainer's own understanding.

The less strong partner may feel that questions hold the other partner back or that there is no benefit to participating actively, but pair programming studies show that paired work is consistently better than work the stronger partner does individually. It is part of each partner's job to understand the whole task; that means asking questions when necessary and answering them when possible.

You will choose a different partner for every lab, so your partners' skill levels are certain to vary from week to week. Still, when you have a choice, you should try to pick a partner whose skill level is close to your own. This won't always be possible, and it's sometimes hard to compare skill levels at all, but we find that pairs are most productive when the partners are at about the same level--there's a more balanced give-and-take.

How does this affect my grade? Participation in pair programming won't be the cause of any low grades. (Failure to participate fully and cooperatively, on the other hand, could be a problem). On lab assignments, each pair will submit one solution, marked with both partners' names. (For electronic submissions, just one member of the pair should submit the solution, which should still contain both partners' names at the top of the file; we'll keep track of who's in what pair, so long as you keep us informed of your pairings in the first place). Each pair will receive a single score on the assignment.

Note that for each paired assignment, each student individually will submit a brief partner evaluation form through Moodle, which will ask these questions:

Filling out the evaluation is required of each student for each assignment; forgetting the evaluation will lower your individual score on the assignment. We will tally these evaluation scores and use them in computing your final grade on lab assignments (taking care that nobody's score is hurt by a single bad partnership or a selection of partners that happen to give low scores).

Additional information: Pair programming is one aspect of the trendily-named programming methodology Extreme Programming. A search for "pair programming" or "extreme programming" on the Web will yield many references. A few examples: