Pair Programming in CS111*
*Much of the content in this page is adapted from the National Center for Women and Information Technology site.
Pair programming basics
When working on programming assignments, whether in lab or elsewhere, you will often use the “Pair Programming” approach. In pair programming, two programmers share one computer. One student 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 about every 20 minutes. Working in pairs should make you much better at programming than would working alone. The resulting work of pair programming nearly always outshines that of the solitary programmer, with pairs producing better code in less time.
Work usually gets done twice as fast when partner programming than when working alone, because generally you have to agree that the idea is a good one before you move forward with it.
-- Spring '16 CS111 student
Working with a partner
Problem set tasks are labeled either as Individual tasks or Partner tasks, and working with a partner may be either required or recommended (see the The CS111 Problem Set Guide for details).
In Spring 2019, most problem sets will have one or more partner-recommended tasks, but some tasks may be partner-required. If a partner is required, and if it is absolutely infeasible for you to work with a partner, contact your instructor. If your instructor determines that there is no other option, they may give you permission to work alone; this is rarely allowed.
For a partner task, the teams can have exactly two members. Teams with three or more members are not allowed.
When you work with a partner, will need to arrange times to meet outside of class. Two important rules of pair programming are that (1) Both partners are in the same physical place -- Facetime/Skyping are not permitted and (2) Code is written in real time together (e.g., partner A's individually-written code cannot be passed onto partner B, instead both partners write code together). We expect everyone to be flexible and professional in arranging meeting times as necessary; if your schedule is highly constrained, explore possible meeting times with your prospective partner before you commit to the partnership.
How to pick your partner
You should try to pick a partner whose experience and skill level with programming is similar to your own. This may not always be possible and it is sometimes hard to compare skill levels, but students tell us (and other data support) that pairs are most productive when the partners start at about the same level. Still, people often pair up with another whose skills are different. This happens more often than not, as no two people have an identical skill set. The differences may be great or small, 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. Students bring different strengths to the process, regardless of how much experience they have had with programming. Both experienced and inexperienced students will need to draw on their reasoning and problem solving skills. A more experienced partner may sometimes feel frustrated or slowed down by a less experienced partner, but the experienced partner still benefits from the teamwork in many ways. The less experienced partner’s requests for clarification often uncover flaws in an approach or solution; the exercise of providing a clear explanation solidifies and deepens the explainer’s own understanding and the teamwork and communication skills they gain have great value in both the academic realm and the job market.
Sometimes my partner would come up with an idea to solve a bug that I'd never thought of, and sometimes it was the other way around, and it made me notice which areas were my areas of weakness. Discussing with a partner to find solutions was central in my understanding, and I enjoyed it more than individual tasks. Having someone else to enhance your learning and to supplement some gaps in knowledge was a great experience.
-- Spring 16 CS111 student
The less experienced 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 alone. It is each partner’s job to understand the whole task; that means asking questions when necessary and answering them when possible.
Dealing with differences
If you believe your partner is not participating appropriately in pair programming (e.g., she or he often does not come to lab, does not keep in touch, or does not come to lab prepared to work) please first address your concerns to your partner, and try to agree on what should be done to make the pair programming experience work well for both of you. If that approach is not successful, explain the issues to one of your instructors, who will work with you and your partner to improve the situation.
How pair programming affects your grade
Failure to participate fully and cooperatively with your partner on an assignment will count against you; after an initial grace period, you could receive deductions in your total course points. Since there are multiple pairings during the course, your total point reduction could add up.
Watch this short video (< 3 min): Pair Programming (Code.org)
The video explains the important roles of "driver" and "navigator" -- you and your partner should switch these roles often.
Pair programming is shown to help, not hinder, your successful completion of the introductory course. It is important that you understand the processes and expectations up front so you can gain the most benefit. If you are unsure of any of the aspects of pair programming and how it is implemented in the course, see your instructor right away.