There is a wide spectrum of collaborative coding practices ranging from individual assignments, to divide-and-conquer programming (a student favorite) to pair programming.
Pair programming is the practice of two programmers sitting side-by-side on one computer—one acting as the “driver” who controls the mouse and keyboard and the other acting as the “navigator” who watches for errors and makes suggestions—switching roles regularly.
As you go from one end of the spectrum to the other, the amount of time spent actively collaborating increases—which is why pair programming, where you collaborate with a partner the entire time you’re programming, is at the far end.
Pair programming actually comes from a professional development style called extreme programming (XP) which has found many benefits of the practice, most notably in terms of code quality. “Pair programming was later adopted as a promising practice in higher education settings because of the benefits of increased retention of students continuing their study of computing, increases in programming confidence in students, and reductions in the ‘confidence gap’ between female and male students” (Simon, et al. 2019, p. 828).
Education Research supporting Pair Programming:
As this practice became more widely adopted in education settings, additional learning benefits were found. “Almost all studies from [systematic literature reviews] claim evidence that pair programming leads to success in beginning programming courses” (Simon, et al. 2019, p. 830). Also, students report “greater satisfaction and enjoyment when using pair programming” (ibid).
Some educators have concerns about pair programming allowing one student in the pair to not do the work—thus getting credit without learning the materials. However, research has found that “students’ individual performance on final exams is similar whether students are learning to program using pair programming or using solo programming… [strongly refuting] any concern about significantly larger numbers of students sliding by without learning the material when working with a partner versus solo” (Simon, et al. 2019, p. 830).
How to Implement Pair Programming:
Pair programming is not throwing two students into a group and telling them to program. Students need to understand that pair programming is not a divide-and-conquer strategy—so to prevent this teachers can:
- Pair students with similar skill levels
- Provide materials covering what is pair programming:
- Suggestion for Higher Education: Williams, L. A., & Kessler, R. R. (2000). All I really need to know about pair programming I learned in kindergarten. Communications of the ACM, 43(5), 108-114.
- Suggestion for K12: https://youtu.be/vgkahOzFH2Q
- Go over the expectations of each role
- Model what good driving and navigating looks like for the whole class
- Provide a clear workflow for troubleshooting common problems:
- Partner is unavailable
- Work feels inequitable
- Resolving disagreements
- Make sure you address the pair when providing help
- “When a student asks a question, make sure you address your answer to both of the students and take time to check that both students understand. If one student understands and the other student doesn’t, stay with the pair while one student explains it to the other one.” - csteachingtips.org
- Train your TAs to support pair programming—it’s a lot more about soft skills than they are used to!
Pair programming is a complex, nuanced pedagogy. There are a few common pitfalls to avoid.
Pair programming is hard and students might resist all the extra work of using soft skills at first. This often leads to instructors trying pair programming once, and after pushback from students, reverting to individual assignments. This pushback is normal and expected! “[M]ost programmers are long conditioned to performing solitary work and often resist the transition to pair programming. Ultimately, most triumphantly make this transition” (Williams & Kessler, 2000, p.109). Commit to pair programming for the entire semester—if you allow the class to revert back to solo programming, neither you nor your students will reach a skill level where the benefits become clear.
Do not assume that equal drive time or equal code lines mean equal contribution. “Because of the variance in how measures can quantify interactions, [teachers] must be careful to select equity measures that are appropriate to [their context]” (Deitrick, et al. 2016, p. 377).
Some instructors think they can’t implement pair programming because they don’t have face-to-face time to dedicate to pair programming activities. “Remote pair programming, also known as distributed pair programming, has been known to be comparable to co-located pair programming in regards to student performance, effective code quality and productivity” (Kuttal et al. 2019, p. 75). With Codio, you can seamlessly get the benefits of pair programming, even with a fully online course!
Pair programming in Codio:
As the instructor, you can easily toggle Pair Programming on for any given assignment. Codio will send both students into the same container when they work on the assignment and propagate any auto-grader results to all students within a group. Additionally, you can create a more co-located experience for remote students by “locking” the navigator’s view to the driver’s view by toggling on “Shared Focus”.
Teachers often worry about odd numbers—you can have more than 2 students in a group. This is often called “mob programming”—it has the same principles of 1 driver but with multiple navigators.
While we often describe how you can treat Codio as a coding GoogleDocs, our pair programming features is not “anarchy” mode where multiple students can type at the same time. Pair programming in Codio only allows there to be one driver as a purposeful scaffolding and support for good pair programming habits. Students can seamlessly transfer who is the driver on-demand by toggling the "Driver" button—or simply by waiting 15 seconds before the next driver starts typing.
Additionally, students don’t need a video conferencing service to pair program remotely in Codio. Just clicking on the phone icon in the top-right allows students to seamlessly communicate synchronously using video or audio within Codio. There is a Chat for students with limited bandwidth.
Pair programming is now live in Codio and can be used within any course. Any users with an instructor account can bring pair programming to life for their students.
Kuttal, S. K., Gerstner, K., & Bejarano, A. (2019, October). Remote Pair Programming in Online CS Education: Investigating through a Gender Lens. In 2019 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC) (pp. 75-85). IEEE.
Simon, B., Hundhausen, C., McDowell, C., Werner, L., Hu, H., & Kussmaul, C. (2019). Students as teachers and communicators. The Cambridge Handbook of Computing Education Research, 827-857.