A beginner’s guide to Pair Programming

Graeme Chalmers
4 min readNov 25, 2020

--

https://philippe.bourgau.net/imgs/2019-03-18-10-pair-programming-questions-answers/how-do-we-pair.jpeg

3 months ago, I began my journey into the world of programming. Since then, I have learned a lot and been frustrated more than I thought humanly possible. I have also had some great breakthrough moments that really do make the frustrations worth it.

Early on in Bootcamp, we were introduced to the concept of pair-programming. Since we’re living in the time of Covid-19, I should mention that my Bootcamp experience has been remote-based learning. To that end, the implementation of pair programming has been a little bit unorthodox.

The concept has two people working together at the same desk with 1 computer with one person acting as “the driver” and the other as “the navigator”.The driver does the coding, while describing their thought process and the navigator oversees and reviews the code to check for typos, gives direction, and shares their thoughts. You then alternate between the roles every few minutes.

BUT WAIT!!

Due to Covid, most teams have switched to remote work, shifting the act of pair programming to a virtual environment. When we were introduced to pair programming, we were assigned virtual “desks” over Discord. Instead of having 2 people work from 1 computer, now both the driver and the navigator work from their own computers while working from a single Code Editor — such as VS Code Live Share.

For experienced or even junior programmers who have pair programming experience, this might have been a small hurdle. As someone completely new to the concept, this was a bit difficult as the lines between driver and navigator were really easily blurred. I can imagine pre-Covid, having to push your partner out of the way in order to be able to type in code, but now there is nothing stopping you when you’re pair programming virtually.

This may not have been an issue for everyone, but for me it was, I’m not going to lie! There were some hiccups for sure, but after a bit of time and practice (like most things in this field), I became more comfortable with it and started to see the benefits.

https://martinfowler.com/articles/on-pair-programming.html

WHY SHOULD YOU, AS A JR DEV, LEARN TO PAIR PROGRAM?

There are so many reasons to learn this practice. The biggest one, is the learning potential. Not only does it give you access to someone who (most likely) knows way more than you about programming, but it also allows you to pick up on their habits and style. This is huge! It’s like playing drop-in hockey with one of the Sedins! Ok that might be a bit of an exaggeration, but still, you can learn so much!

Another huge benefit (and this one would even be applicable if you were working with another junior) is the transferring of skill sets. Chances are your partner knows more about a topic where you may have gaps. This goes both ways too, and with this the chances of success are much greater. It’s like the adage says, “two heads are better than one”. This even ties into the previous example, as it’s another easy way to learn new things (see the trend here?).

It solidifies your knowledge base by forcing you to communicate your train of thought. Whether you’re in the driver’s seat or riding shotgun, you’re either vocalizing your thought process as you code away, or you’re explaining what you’re seeing on the screen, and adding your own input. By talking about your code and what is happening it helps you develop a better understanding of the overall topic.

WHAT NOT TO DO!!!!

Stay Silent! DO NOT DO THIS! Pair programming is interactive and even though you’re not sitting at the same desk as your partner, it doesn’t mean you can’t be engaging. If you’re struggling, let them know. If you need a break, let them know! Don’t be shy!

Don’t hog the keyboard! This is especially relevant in the remote world. Make sure you are switching between driver and navigator every few minutes. If one of the team members is less confident in their abilities, they may let the other partner take over, which diminishes the effectiveness of having two people working on the code. On the flip side, for the stronger coder, don’t take over and have a “watch the master” mentality. You’d be missing out on a great learning opportunity for both members this way.

MOVING FORWARD

As with most things during my bootcamp experience (especially routes), my first few experiences with pair-programming were not the smoothest. I struggled for sure, and I was the guy that lacked confidence and let my partners code away. And — like many other things I learned during bootcamp — the more I did it the better I got at it, and the more value I saw in it. There are quite a few different styles of pair programming (I’ll leave some links at the bottom of this post) but what matters is what works for you because this is a really useful tool, especially as someone who is new to coding.

SOME LINKS THAT I FIND HELPFUL

https://martinfowler.com/articles/on-pair-programming.html#Styles

https://stackify.com/pair-programming-advantages/

https://sundeepgupta.ca/post/160841104851/breaking-down-successful-pair-programming

https://collaboration.csc.ncsu.edu/laurie/Papers/dissertation.pdf

--

--

Graeme Chalmers
Graeme Chalmers

No responses yet