You may have heard the term ‘pair programming’ before and thought, ‘sure, two kids working together on coding, got it.’ Having students work in pairs is pretty common in the classroom, so pair programming might seem like nothing special. With limited resources (including the teacher’s time to bounce among students as they work) pairing kids up makes sense for all types of school subjects – so why not coding too?
Every educator knows that if you just tell your students to ‘pair up’ you inevitably have some duos where one person does all the work, others where the two fight the whole time, and some pairs where the kids might be next to each other, but they aren’t actually working together. Luckily, actual pair programming doesn’t allow for these issues. In fact, done right, pair programming can lead to greater educational outcomes for students far beyond the ability to write code.
Believe it or not, pair programming is actually a technique used in professional software development! Pair programming is an agile software development technique where two programmers work together at one workstation. One programmer, the driver, writes code while the other, known as the navigator, reviews each line of code as it is typed in.
The two programmers switch roles frequently.
In the classroom, pair programming works basically the same way: two students share a computer, taking turns as the driver and navigator, switching roles regularly.
At first glance, it might seem that pair programming is inefficient, at least in the commercial environment. Why would a company pay two people to do what a single programmer would have done on their own?
Simply put: the resulting code is better.
Companies that use pair programming report that the resulting output is remarkably improved compared to what individual programmers create, with final programs containing fewer bugs and having more optimised thinking.
What about for students? The goal here is to learn, not to generate more ‘perfect’ code, so why use pair programming?
Here are five key reasons to try pair programming in your classroom:
When students are paired up in this way, they are more likely to talk through problems they encounter with each other. This discussion can lead to fewer roadblocks (and fewer hands in the air waiting for an instructor to come help) as students will often work out issues together. Working with a partner can also lead to more creativity and better problem-solving, both major parts of coding, not to mention it provides fantastic opportunities to practice communication and collaboration.
By switching roles frequently, pair programming helps both students stay engaged as it forces them to keep coming at the task in different ways. The driver can concentrate on moving the mouse and typing at the keyboard while the navigator keeps an eye on the big picture, focusing on the problem to be solved. Changing roles gives each person a brain-break while also creating a natural platform for knowledge sharing and increased information flow between the partners.
For students learning text-based programming, pair programming can help reduce frustrations when it comes to syntax (the rules of the language). Having a second pair of eyes looking over the code means issues such as typos are more likely to be spotted as they happen, reducing the amount of debugging needed later. The navigator can also help make sure that coding conventions (including things like proper formatting and commenting) are being followed, making for more readable and better functioning code.
Perhaps the most impressive benefit of pair programming is its role in helping students move beyond the ‘what’ they are learning to the ‘how’ they are learning it.
It’s important to remember that coding (and computer science more broadly) is more about learning how to learn than it is about anything else. Indeed, a key benefit of coding is that it is a brilliant tool for teaching computational thinking. In order to program, students must use cognitive and metacognitive strategies that are linked to computational thinking, such as thinking sequentially, decomposition and cause-and-effect.
Coding makes all this thinking visible. And in pair programming, the thinking becomes visible to both partners. Students naturally converse about both what they are doing and why. To answer their partner’s question of ‘why did you do that?’ a student needs to be able to articulate their thinking process: a great exercise in metacognition.
Seeing how others think can also help students develop their metacognitive awareness by comparing how their partner thinks to how they themselves think. Students who are struggling with concepts also benefit from seeing a peer partner model their thinking in this way.
While it’s not exactly an effect of pair programming, partnering students together has the advantage of allowing them to share, or rather pool, resources. Some of the coolest things you can do with physical computing and robots require more than one device. Pairing students allows them to work with multiple devices to tackle more creative and complex projects. And students can tackle these projects using pair programming as their coding technique, tapping into all its benefits.
“ its actually a technique used in professional software! its an agile software technique where two programmers work together at one workstation. ”