by Marcus Gardiner

Want to be a developer? You should probably be Pair Programming.

When people think of software development, they understandably think of a lone wolf programmer shut off from the world, solving complex problems.

What if I told you this was hardly ever how software development truly works in the real world…and that pair programming could be your answer to learning to code faster, preparing yourself for the real world of software development, and maybe having more fun in the process?

A lone wolf software developer in action (Gifs courtesy of Giphy)

Sounds good. So how do software developers really work?

What may be more accurate is a team of software developers, shutting themselves off from the world sometimes, connecting themselves to the world at other times, and still solving complex problems (but together).

The lone-wolf scenario may be true in certain situations, such as completing a side project or freelance work. More often than not, however, software development for products of any meaningful scale is done by a fully-fledged software team, likely with a mix of different development strengths (see below image from the DSDM Agile Framework). This software team will be plugged into a broader business and commercial team (we can’t forget our end user :) )

DSDM® Agile Project Framework

What does this mean for us software developers that are learning the trade? It means that while learning to code often starts as a lone wolf game, we want it to (as soon as possible) grow into the team sport of software development that is prevalent in most organizations.

Beyond the coding content itself, it is essential to building the collaboration and team-working skills that will help you thrive in a software development team. Having external support from others to stretch you is also a fantastic (maybe the best) way to learn, even if the natural temptation is to battle through tricky coding problems alone.

Finding a team to learn and grow with may not be a practical solution. Finding one other person to pair program with is a much more realistic starting point.

Ok, I am intrigued…

For the uninitiated: what is pair programming?

Thankfully, Wikipedia can help us here:

“Pair programming is an agile software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer or navigator, reviews each line of code as it is typed in. The two programmers switch roles frequently.”

How does this change the mindsets of the two people approaching the code?

“While reviewing, the observer also considers the “strategic” direction of the work, coming up with ideas for improvements and likely future problems to address. This frees the driver to focus all of their attention on the “tactical” aspects of completing the current task, using the observer as a safety net and guide.”

Ok cool. But isn’t this pair programming thing going to be highly uncomfortable?

You may be skeptical of pair programming — I certainly was skeptical myself. Your first thoughts may be that the idea sounds like an uncomfortable one. Will it be like this?

Pairing may seem like an uncomfortable idea (Source)

To soothe your reasonable skepticism, let’s talk about some of the advantages of pair programming, applied with a particular focus on those near the start of their coding journey.

Three core advantages of pair programming, tailored to someone who is learning to code:

(1) Pair programming is a fantastic way to learn from another coder.

In no other environment will you be on the same exact point of a coding challenge, struggling through the exact same problem, and trying to solve it together. You will laugh, you will cry, and you will ultimately learn.

Importantly, you will have accrued different knowledge bases as you have learned to code, and you’ll be able to pick up new content from your pair. More importantly, good programming is ultimately about applying your best problem-solving process, not just having lots of content knowledge (see this post). Pair programming will enable you to learn from another developer’s process, as well as give you an opportunity to receive feedback on your own coding process (more on feedback below).

Bonus benefit of having this perspective on your coding process and having to explain it to your pair: Rubber-ducking is a fantastic way to debug code. In a nutshell, it involves explaining what you are trying to solve to a ‘rubber duck’ or another inanimate object, so that you get perspective on the issue. Why not explain to a real-life coder that you can bounce ideas off instead?

Rubber ducks! (from BBC Blue Planet)

(2) Pairing is a great environment to practice the team skills that are central to good software development.

We established earlier that software is a team sport. By taking your coding practice outside of your own head by pairing, you will naturally be building the soft team skills that are so vital to working in a larger software development team.

Coding interviews can often involve talking your interviewer through your thought process as you code or pseudo-code. With pairing practice, you will be able to clearly articulate your coding thoughts and give yourself the best chance you can in these pair-style interviews.

(3) The benefits of pair programming are even greater for (relatively) new software developers.

As supported by the research complied by Laurie Williams, pair coding works best when (i) the pair work on complex tasks and (ii) individuals are at similar levels of programming knowledge (see pair-programming research compiled by Laurie Williams).

As a newly-minted coder stretching your way to greatness, a lot of the tasks you undertake will be naturally complex, because you don’t yet have that base of experience and knowledge that can make specific coding tasks easy. Your pair that is also learning to code is more likely to be at a similar level to you in a variety of coding knowledge areas, even if one of you is stronger in a specific area.

Beyond hardcore research, you can also take solace from the fact that the majority of prestigious coding bootcamps (designed to take people from newbie coders to junior developers in around 3 months) rely heavily on pair programming as a way for programmers to go from zero to hero as fast as possible.

The fact that these intensive code-teaching bootcamps using pairing so much is a clear indicator that there is definitely a nugget of gold in using it to learn and learn fast. I myself discovered the glories of using pairing to learn at the coding bootcamp I attended, Makers Academy.

If you are still skeptical, I challenge you to try pair coding. I could go on listing its benefits, but this will pale in comparison to trying it out, seeing its powers in practice, and ultimately deciding if it is a great a way to learn for you.

The magical powers of pair programming

OK I am convinced to give it a go, how do I start?

First, find your pair (ideally a person that is of a similar skill level and also learning to code). This could be a friend you know who is learning to code or someone you meet along your coding journey.

In-person pairing is ideal, but remote pairing is also great and can be a more convenient solution (for which you could use screen-sharing software such as Skype or Mikogo). In the workplace, pairing is frequently conducted between senior and junior developers, so that the junior can rapidly learn from the senior developer.

If you don’t currently have someone obvious you can pair with, it is time to start building your developer community.

Knowing other developers is such an important aspect of learning to code in itself. You can bounce thoughts off people, develop ideas together, and learn from people with a range of backgrounds and strengths. This makes it worthwhile to pursue joining these communities just to meet other devs, finding someone to pair with is a tasty bonus.

If you are a new coder, I suggest two sure-fire routes to meeting other developers:

(1) Join a coding community where people come together to code/ learn to code. For example in London, you could join ‘London Hackspace

(2) Attend coding community events, particularly those for new coders. A good route is attending an event run by a current bootcamp. Other coders checking out the bootcamp will be in a similar position to you.

An example event to meet other developers in training

Once you find a potential pair (or several!), try different pair programming techniques to find one you like:

Below are two examples of pair programming techniques:

(1) Pomodoro pairing. A timer is set for 25 minutes, where one person is the driver and the other the navigator. Every 25 minutes, you have a short break and switch roles. There is a great chrome extension for this here.

(2) Ping-pong pairing. The driver writes a failing test, then passes the driver role (and the keyboard) to the other person. The new driver writes the code to make that test pass, refactors the code, and writes a failing test for the other person to drive through. (To understand Test-Driven-Development, read point 1 here)

Source: Jim Shore’ 2007 book ‘The Art of Agile Development

For more pair programming techniques, watch:

To end: balancing the view on pair programming

Hopefully, you now feel inspired to add pair programming as a powerful tool to your learning toolbox. It really is very useful, and I hope you now have enough info to get started.

To balance the above: pair programming is, of course, not always easy. Learning to explain and externalize your coding process can be tough. Working with others can be difficult in general, and certain scenarios can reduce the value pair programming provides (for example if the skills or goals of the pair are mismatched).

“Difficult things aren’t easy, but they’re worth it”
Mia love

Fundamentally though, if you’re learning to code and learning to work in a software development team, I haven’t found anything more helpful than hours upon hours of pair programming with a wide range of people with different backgrounds and talents.

When it comes down to it, most things in code (and life) come down to working well with others. The added bonus? Working with others has the excitement of heading in directions you may not expect, the rigor of ensuring high-quality code through disagreement and discussion, and maybe, just maybe, it will simply be a lot more fun!

A visual representation of pure FUN

Looking for more coding secrets?

This is the fifth post in a series that focuses on the secret meta-learnings I have picked up as I have learned to code at Makers Academy: the approaches, tools, and mindsets to make the breakthroughs you need to be a kick-ass coder.

Click here for my previous post: 5 ways to unstick yourself from sticky, tricky coding problems

If you enjoyed this blog post and would like to read more like it, please click ‘Follow’ and give me a few Claps by clicking the Medium claps button below ?