Pair Programming

Successful pair programming -- two partners sitting side-by-side and working on a single screen -- requires practice, patience and commitment.

The advantages of pair programming include:

  1. You learn faster when a partner is helping you avoid small, time-consuming errors.
    • Two sets of eyes are more likely to notice errors than one set.

  2. You learn better when a partner is helping you understand and you are challenging your partner to master the material.
Pair programming is a real-life technique, part of the disciplined methods called Extreme Programming.

However, problems can arise unless both partners (let's call them Sally and Wanda) are committed to pair programming. These problems include:

  1. Sally dominates the project and does not let Wanda do half the work.

  2. Sally decides that Wandy cannot write code and so assigns everything else beside the code to Wanda and completes the code-writing by herself.

  3. Sally is passive and plays a "keep the other person company" role until the project is finished.

  4. Sally misses class without alerting Wanda or the professor.

  5. Sally is unavailable outside of class.

  6. Sally believes that Wanda's performance will hurt Sally's grade.

We are committed to pair programming in this course. Your grade will be affected negatively if you are unable to make your partnerships effective.

At all times during pair programming:

  1. Both partners should sit behind a single computer. Put your other computer away.
    • Exception: Some partnerships find that they can use the second computer effectively for reading these instructions and responding to the questions therein.
    • But at any given time, both partners must be looking at the same computer screen.

  2. Share the typing duties.
    • Intially this will mean alternating at specified points in the project.
    • Later it should mean that whoever wants to type at a given time should, but with the overall time spent typing shared equally between partners.

  3. Both partners think! Both partners solve the problem!
    • When you are not typing, think about what your partner should be typing (and watch that your partner is not making an error).

  4. Do not complete any work unless both partners understand it completely. In particular:
    • If one partner does not understand the code that the other partner is typing, stop at that point and discuss the code until both partners understand it.
    • If both partners are confused about the work that they are doing, ask an assistant for help.
    • If the partners disagree about a portion of the project, ask an assistant for help.

  5. It is:
    • good to show your partner some things that you understand and that your partner does not.
    • not good to spend the entire session teaching your partner things that your partner should already know.

  6. It is generally best to work with a partner whose comfort-level and skills relevant to the project are similar to your own, so that the pace of problem solving is consistent.

Additionally, when you are to work on a project outside of class:

  1. When you are in class:
    • Identify times when you can meet face to face.
    • Schedule a specific time and place to work outside of class.
    • Identify ways to get in touch with the other easily (email, instant messenger, phone, etc).

  2. Do not waste your partner's time.
    • Show up on time for scheduled meetings.
    • Stay focused on the task during the meeting.

  3. Do not work on the project without your partner.
    • Pair programming is not team programming.