Want to keep learning?

This content is taken from the Raspberry Pi Foundation & National Centre for Computing Education's online course, Programming Pedagogy in Secondary Schools: Inspiring Computing Teaching. Join the course to learn more.
Two students working together. One is controlling the computer, while another reads from a sheet of paper

Pair Programming

Pair programming is a pedagogical approach that involves learners working together on a problem to develop programs. It was first used in industry because it helps to ensure rapid, flexible, and evolutionary software development. The idea soon came to education as the benefits became clear.

The tasks that learners have to complete are shared between them, reducing the cognitive load. This is known as the collective working memory effect. Philip Sands notes in a 2019 article that pair programming “separates tasks with low-level demands (typing, computer management, and navigation) from tasks with higher cognitive demands (syntax analysis, algorithm development, problem search)”. Poor communication between learners can, however, add a “cost” to cognitive load that could eliminate the benefits.

The quality of the programs produced by the learners is likely to be improved. The pairs support each other by debugging and spotting syntax errors as they occur, as well as making their code more elegant and efficient.

Evidence shows that learners working in pairs (particularly girls) have more confidence in tackling problems and become less frustrated throughout the process of writing their coded solution.

Although most studies conducted so far have been with university students, evidence suggests that it has its biggest impact with lower-ability learners and with those studying introductory programming courses.

This video by Code.org demonstrates how pair programming works.

The driver and the navigator

An essential part of making pair programming a success is to spend time ensuring learners have a good understanding of the roles that they will fulfil during the task. This will help to keep both learners engaged and ensure they are contributing equally to the task.

The driver

One learner will start with the job of being the driver who will control the keyboard, mouse, or pen, depending on the task. The driver will write the code and follow the instructions of their classmate. These tasks have a low-level cognitive demand, which allows the learner to concentrate on writing code accurately, rather than also having to focus on tasks such as problem solving and deciphering instructions.

The navigator

The second member of the pair will start as the navigator. The navigator’s role is to support the driver, watching for any errors being made. The navigator can also play a strategic role by thinking of alternative solutions to problems, reading the notes from the teacher, or even walking around the class to see what others are doing. These tasks have a higher cognitive demand than the tasks of the driver, but as the navigator hasn’t got the responsibility of writing the code, the extraneous load on each member of the pair is reduced.

Ask learners to allocate themselves an initial role and make sure that they swap roles regularly — about every five to ten minutes, depending on the activity. This will help ensure that everyone is playing an equal and active role, being encouraged to think in different ways, and taking ownership of the problem they are solving.

Pairing learners

There is no consensus from research on which ability pairings are most successful, so you should use your professional judgement based upon your learners and the educational setting in which you work. To avoid counterproductive pairings you could consider:

  • Pairing learners so that there isn’t a large gap in ability
  • Matching the personalities of the learners
  • Allowing learners to choose their pairings themselves, to ensure that they are in pairs that get along

Impact on girls

Although research shows that pair programming benefits all learners, there is some evidence that the technique has a greater impact with girls. In studies conducted on learners taking foundation higher-education programming courses, Werner et al. reported a significant increase in confidence levels reported by the women who were paired, compared with women who worked independently. Similar findings by Braught et al. showed that women who worked alone were more frustrated than women who worked in pairs. Evidence shows that while pair programming can particularly benefit girls, there is no evidence that shows it has a negative impact on boys.

Practical matters

There are some practical considerations when applying pair programming in the classroom. For example, do you need to teach learners how to work as a pair? How do you assess their work? What tasks is pair programming most suited to? The following suggestions are summarised from our upcoming quick read on pair programming:

  • Check pairs regularly to address issues and ensure both partners are contributing equally
  • Assess learners on both paired and individual work
  • Plan before the lesson to choose pairings (rotate regularly) and ensure that learners can sit next to each other with easy access to the keyboard and mouse

Discuss

How would you assess the contribution of each learner in a pair?

Share your answers in the comments section.

Share this article:

This article is from the free online course:

Programming Pedagogy in Secondary Schools: Inspiring Computing Teaching

Raspberry Pi Foundation

Get a taste of this course

Find out what this course is like by previewing some of the course steps before you join: