Pair Programming

Based on CS 106A's Pair Programming Guide, distributed with permission.

As the syllabus mentions, several of the assignments in this course allow you to optionally work in a pair with a partner. Some common questions and tips on working on assignments with a partner are listed below.

What is pair programming?

Pair programming is a particular method of distributing a programming task between two people. In each pair, one person is designated the driver and the other person is the navigator. The driver is responsible for composing code on the computer, whilst the navigator reviews each bit of code as it's being typed in. The driver and the navigator swap roles after a short period of time.

Why are we doing pair programming?

Pair programming serves two purposes. The first is that pair programming has potential benefits to students. Working with a partner can give you someone to talk to when you're stuck, or help you learn different ways of approaching the same problem.

The second is to ensure a high quality of service from our course staff. Pair programming helps reduce the grading workload so the course staff can spend more time supporting you and helping you be successful in CS 61A.

What is the best way to collaborate?

The exact work style you use with your partner is up to you. There are several ways that pairs can work together. Here are some possible strategies, along with our opinion about the effectiveness of each:

Write the code together

Strongly recommended.

In this work style, you would sit next to each other at the same computer and collaborate to write the code. One person would type for a while, then the other, and back again. You can decide the interval for switching who controls the computer (the "driver"). Some people recommend switching roughly every 15-20 minutes, to make sure that each person gets to drive. Even if one of you is a faster typer, letting both people drive for equal time is good to avoid having one person dominate the work.

Work together using online tools

Recommended.

In this work style, the two of you would be physically apart but would collaborate by sharing code using online tools. For example, you can share your code and video chat with the Collab tool.

Do the assignment individually, and then compare solutions

Somewhat recommended, but we suggest one of the others above instead.

In this work style, each of you would complete the assignment on your own, then the two of you would have a meeting and compare solutions. You would then merge the solution into a best combined solution that you would submit together. This work style doesn't have as many benefits as working on the solution together, but it is still good to see how another student solved the problem and learn from each others' programs' strengths and weaknesses.

There are some work styles that we do NOT recommend because we do not think they follow the spirit of working in pairs, and do not allow both students to effectively learn the material. For example:

  • Splitting up the parts of the assignment: In this work style, each of you would complete parts of the assignment individually, then submit them together. For example, if the assignment has a "Part A" and a "Part B", one of you would do Part A and the other would do Part B. We do not recommend doing this because each of you will only learn part of the material for that assignment. This will leave you less prepared on exams and future assignments.
  • Taking turns on assignments: In this work style, in a pair of students named A and B, student A would do Homework X, then B would do Homework X+1, A would do Homework X+2, and so on. You should not do this, since each partner is expected to make a significant contribution toward solving the assignment. You should not claim to be part of a pair submission if you did not contribute significantly to help solve that problem. Moreover, your section leaders may ask you to explain aspects of the submission during lab check-offs. By doing this each of you will only learn half of the course material in detail. The assignments are by far the best vehicle for you to learn how to program effectively and truly come to understand the course material. Only completing half of them will leave you much less prepared to do well on exams and future assignments.
  • One person does all of the work: You should not do this, since each partner is expected to make a significant contribution toward solving the assignment. You should not claim to be part of a pair submission if you did not contribute significantly to help solve that problem. Moreover, your section leader may ask you to explain aspects of the submission during lab check-offs. By doing this the other person will not learn the material well and will be grossly underprepared to do well on exams and future assignments. The assignments are by far the best vehicle for you to learn how to program effectively and truly come to understand the course material.

Logistics

Is every assignment going to be a pair assignment?

No; some assignments, such as the first lab and first few projects, will be individual. Each assignment will clearly label whether it is an individual or pair assignment. Please follow each assignment's instructions properly, and if a given assignment is an individual assignment, please submit your own work and do not share code with a partner.

Are there any constraints about whom I can work with?

No, but we strongly suggest working with another student in your section who is taking the course for the same grading basis (e.g. letter grade, P/NP).

How can I find a partner?

Your TA may provide time in section for you to find a partner if needed. You may also contact your TA if you need help finding someone else in your section to partner with.

Do I have to have the same partner for the whole class?

No; if you want to change partners, you may do so. Your TA may encourage you to meet different students in the first couple weeks so you can find someone who works well with you.

How do we submit/get grades as a pair?

Only ONE of you should needs to submit the assignment to Ok. Once the assignment has been submitted, you must then add your partner by inviting them by email. Make sure to accept the invitation or the partnership won't be official. See Using Ok for more information.

My partner was a bad partner...

They didn't do any work, or didn't do their share of the work, or didn't communicate or meet with me, etc. What can I do?

Have you tried speaking to your partner to let them know that you expect them to do more? Remind your partner what the course info handout says about expectations of each member of a pair. Many group issues can be resolved by better communication and setting expectations.

If talking to your partner does not resolve the situation, speak to your TA and explain the details of what has happened. We will try to help you resolve the issue. If it is an ongoing problem, your TA can help you find you a partner, or you can dissolve your partnership and submit individually. We will provide a way for you to give feedback about your partner in case there is any complaint you would like to bring to our attention.

NOTE: If you agree verbally (or via email) to work with a given partner on a given assignment, you are expected to work through that assignment with that partner to completion. You can't abandon your partner in the middle of an assignment unless the decision to unpair is mutual for both of you. Please be considerate for your partner and don't leave them hanging without an easy way to find a new partner in mid-assignment. If you are planning to end your partnership and do the next assignment alone, please tell your partner this as soon as possible when the assignment is given out, so that they can make other arrangements.

Not because they didn't do enough work; they did too much! They hogged the keyboard, or they did the whole assignment without waiting for me, or they didn't communicate with me, etc. I feel that I didn't get a real chance to help in writing the code and solving the assignment. What can I do?

The answer is similar to the previous question. Have you tried speaking to your partner to let them know that you expect them to let you contribute? Remind your partner what the course info handout says about expectations of each member of a pair. Many group issues can be resolved by better communication and setting expectations.

If talking to your partner does not resolve the situation, speak to your TA and explain the details of what has happened. We will try to help you resolve the issue. If it is an ongoing problem, your TA can help you find you a partner, or you can dissolve your partnership and submit individually. We will provide a way for you to give feedback about your partner in case there is any complaint you would like to bring to our attention.

How do we get help if our pair is stuck on an assignment?

You can go ask for help from the course staff in office hours. Keeping in mind that a big reason for implementing pairs is to help reduce staff workload, we request that if both of you are in office hours, that only one of you will enqueue for help at a time. That is, please don't try to "double up" by enqueuing both of your names in the line. If we find that a group is doing this, we will remove both of their names and move one of them to the very back of the queue. Thank you for your cooperation.

Don't forget to talk to each other plenty during the assignment along the way. One benefit of working in pairs is that each member of the pair can help the other improve his/her understanding of the material and help figure out how to solve the assignment.