Pair Programming

icon
Google Docs

(share code privately online)
icon
CollabEdit

(share code privately online)

Q: Am I required to work with a partner?

A: No, but we want to strongly encourage most students to do so. Pairs and individual students have the same due dates and are graded the same way.

Q: What is the best strategy for working with a partner?

A: 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:

  • Sit together and 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 would put your code into CollabEdit or Google Docs (see links above) and talk to each other using a chat program like Google Hangouts, Skype, FaceTime, etc. This style can be effective for students who have different schedules or live far apart.
  • Both do the assignment individually, then compare/merge solutions: (Somewhat recommended.) 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 also some work styles that we do NOT recommend because we do not think they follow the spirit of working in pairs. For example:

  • Splitting up the parts of the assignment: (Not recommended.) In this work style, each of you would complete part 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: (Not recommended.) In this work style, in a pair of students named A and B, student A would do Homework 1, then B would do Homework 2, A would do Homework 3, so on. We do not recommend doing this because 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: (Strongly not recommended.) While we can't follow you around and monitor your work, it's conceivable that one person could just do all of the work, and the other person could do none of it. We do not want you to do this because the other person will not learn that material well and will be grossly underprepared to do well on exams and future assignments. This also violates the Honor Code, since you are putting your name on work to which did not contribute.

Whatever work style you and your partner choose to use, please keep in mind that every student must complete our exams individually. You are still responsible for learning all of the relevant course material so that you can do well on the exams. If you choose a pair work style that is not conducive to both members learning the material, you do so at your own risk.

Q: Is every assignment going to be a pair assignment?

A: No; some assignments, such as Homework 1, 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.

Q: Are there any constraints about whom I can work with?

A: No; you may work with any other student who is enrolled in the class.

Q: How can I find a partner to work with?

A: You can post on the class message forum to help find a partner if you like. Or you can stick around after a lecture to look for a partner.

Q: Can I be partners with someone who is not in the class? For example, someone who took it in a previous quarter?

A: No. Partners must be people who are both currently taking the course.

Q: Do I have to have the same partner for the whole quarter?

A: No; if you want to change partners, and can agree to a mutual partner swap, you may swap. But to do this, you have to find a swap that all people involved agree to. For example, suppose students (A, B) are partners and (C, D) are partners, but A and C want to work together. If A and C can get B and D to agree to the swap, the four can rearrange into groups (A, C) and (B, D). In general, due to the overhead of changing partners along the way, we encourage you to use the same partner unless there is a serious problem or reason not to.

Q: How do late days work with teams? What if I switch partners?

A: Each student has an individual personal counter of late days remaining. If your team turns in an assignment late, each individual student's penalty is based on that student's number of late days remaining.

Q: What if my partner drops the class?

A: Speak to your TA. We will try to find you a new partner, or in the meantime, you can submit individually.

Q: I've added the class late! Can I still find a partner?

A: Speak to your TA. We will try to find you a partner, or in the meantime, you can submit individually.

Q: I haven't found a partner yet! How can I find one?

A: One way to find a partner is to mingle during/after lecture or section and look for others who are interested. If that doesn't work, post on the class Piazza board; there should be a dedicated Partner Search thread.

Q: How do I share code with my partner online?

A: See the links above for recommended tools for sharing code. Please do NOT post shared partner code publicly on places like Pastebin or GitHub.

Q: I am retaking the class, or I dropped it in the past, so I already have written a solution to this assignment by myself. Now I want to work with a partner. Can my partner and I resubmit my old individually-written solution together this quarter?

A: No. This is not appropriate because you did not write the program as a pair; one person wrote the entire solution in a previous quarter. You should do one of the following two things instead: Either you two should work alone on this assignment and pair up on a future assignment instead, or you should discard your old individually-written solution (not looking at it at all!), and rewrite it from scratch as a pair.

Q: (Similar to previous question) I am retaking the class, or I dropped it in the past, and I already have written a solution to this assignment in a pair, with a partner from that past quarter. Now I want to work with a different partner who is taking the course with me currently this quarter. Can my partner and I resubmit my old different-pair-written solution together this quarter?

A: No. This is not appropriate because the current pair of you did not write the program together; a different person, someone who isn't even in the class any more, wrote the solution with you in a previous quarter. You should do one of the following two things instead: Either you two should work alone on this assignment and pair up on a future assignment instead, or you should discard your old solution (not looking at it at all!), and rewrite it from scratch as a pair.

Q: (Similar to previous two questions) My partner and I are BOTH retaking the class, or both dropped it in the past, and we already have a solution to this assignment that we wrote together as a pair that quarter. Can my partner and I resubmit our old solution together this quarter?

A: In this specific case, if you and that same partner wrote that same solution together in a prior quarter, and exactly that same pair of people is working together again this quarter, then yes, you can resubmit it this quarter as a pair. The general policy to be gleaned from these past 3 Q/As is: Once a solution is completely written (even if it has not yet been turned in), it should be considered "locked" in terms of who wrote it and who is permitted to submit it. If it was written by one person, that one person should submit it; not another individual person, and not a pair. If it was written by a pair of people, that exact pair should submit it; not an individual, and not some other non-identical pair.

Q: 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?

A: 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, the 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, and you do not submit any pair-written code individually. 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.

Q: My partner was a bad partner, but 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?

A: 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, and what this web page 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, the 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.

Q: How do we get help if our team is stuck on an assignment?

A: You can go ask for help from the TAs in office hours.

Please also feel free to come ask the instructor for help during office hours, as well as posting questions on the course message forum. Please try to coordinate with your partner so that you don't both redundantly post the same question.

Don't forget to talk to each other plenty during the assignment along the way. One benefit we are hoping to see from having students work 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.

This document and its content are copyright © Marty Stepp, 2017. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the authors' expressed written permission.