Skip to content
Joshua BallAugust 12, 20217 min read

Pair Programming in CS Education: An Implementation Guide

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 with 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.

Watch our Pair Programming On-Demand Webinar

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 spectrum

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).

What is an example of pair programming?

Pair programming is functionally appropriate in any coding scenario. For practical application, consider app development. While one programmer works on writing code, a second programmer follows behind, ensuring appropriate design decisions are made and that all code is correct.

This team effort is beneficial for multiple reasons, including preventing mistakes and reducing time spent on quality assurance, as well as bringing a varied approach to problem-solving.

What is the purpose of pair programming?

While pair programming does add to overall programming hours and budget, the process can actually support reduced costs, as it creates a built-in quality assurance process. In addition, it enables green programmers to learn from experts, as they follow behind or vice versa.

In addition, pair programming can result in more diverse outcomes. With a two-person approach, programmers are more likely to explore alternative solutions, designs, and processes. This leads to more innovative approaches that can often yield a positive outcome for the program as a whole. This two-person model also creates a dynamic approach to problems, since the pair may approach challenges in different ways. Essentially, this style of programming is conducive to problem-solving, as it brings varied approaches to a single challenge.

Is pair programming still a thing?

In short, yes, pair programming is still very much a thing. While this model saw its peak popularity decades ago, this practice has persisted well into the 21st century. As our technological capability sees, remote pair programming is gaining popularity, making the two-person process possible anywhere and everywhere.

And while not all programmers are fans of this method, the benefits of pair programming far outweigh the negatives. And while this process isn’t appropriate for every programming task, it can greatly benefit both companies and junior-level developers, as well as students in classrooms.

Where is pair programming used?

Pair programming can be used in any scenario that includes a challenge. From a particularly complex problem to a bottlenecked dependency, enacting in-person or remote pair monitoring can ensure clean code and thoughtful, unexpected answers to challenges.

Here are a few real-world examples in which pair programming can be extremely effective:

Complex tasks
Speeding completion of high-priority tasks
Training exchange of information
Solving common challenges

Since the above scenarios can occur at any time as your student move beyond the classroom and into the reality of programing, ensuring your students are equipped with the necessary tools to execute this skill gives them a competitive advantage.

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

  1. Pair students with similar skill levels
  2. Provide materials covering what is pair programming:
    1. 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.
    2. Suggestion for K12: https://youtu.be/vgkahOzFH2Q
  3. Go over the expectations of each role
    1. Source: Campe, S., Green, E. & Denner, J. (2019). K-12 Pair Programming Toolkit. ETR, Scotts Valley, CA
      pair-programming-venn
  4. Model what good driving and navigating looks like for the whole class
  5. Provide a clear workflow for troubleshooting common problems:
    1. Partner is unavailable
    2. Work feels inequitable
    3. Resolving disagreements
  6. Make sure you address the pair when providing help
    1. “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
  7. Train your TAs to support pair programming—it’s a lot more about soft skills than they are used to!

Avoiding Pitfalls:

Pair programming is a complex, nuanced pedagogy. There are a few common pitfalls to avoid.

Pair programming is challenging and students might resist 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”.

Pair Programming - Settings

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 feature 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.

Pair Programming - Chat Feature

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 - Starting a Call

Pair programming is now live in Codio and can be used within any course. Any user with an instructor account can bring pair programming to life for their students.

Create Free Instructor Account

References:

Deitrick, E., Shapiro, R. B., & Gravel, B. (2016). How do we assess equity in programming pairs?. Singapore: International Society of the Learning Sciences.

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.

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.

 

avatar

Joshua Ball

Joshua is Codio's Vice President of Marketing.