The Psychology of Pair Programming

Behaviours and skills exhibited by the very best pair programmers.

Chris Cooney
May 15 · 6 min read
I know this is serious business but this pair are off the chart cute.

Dr. Sallyann Freudenberg is a software engineer and psychologist who has spent some serious time observing the behaviours of high performing software teams. Her blogs contain a wealth of information for any software professional looking to sharpen their skills.

As an engineer with no psychology background whatsoever, I couldn’t help but think — this is some really, really good stuff. It’s accessible, easy to understand and clear. I thought… perhaps I’ve picked up the wrong career? Maybe I’m a psychologist! So I read a little Freud and oh my god the horror, so I’m definitely still an engineer and have no interest in psychology any more. Also I can’t look my mother in the eye.

Anyway, after many hours of repetitive strain injury-inducing labour, here is what I have produced. A collection of tips, based on the work of Dr. Freudenberg. My hope is that you’ll use this as a primer, an appetiser if you will, before diving into Dr. Freudenberg’s work and developing a more full understanding. Let’s get started.

Take Regular Breaks

Regular breaks are well understood in psychology. In the context of pair programming, they:

  • Prevent context from building up too much. Breaks break things up.
  • Lower the cognitive load and enable longer overall pair programming sessions.
  • Make you happier!

Of all the basic sins I see, this is the most common. Five hour meetings with no time budgeted for breaks. “Powering through” isn’t always the answer. Sometimes, going for a coffee or a beer (depending on how stuck you are) can provide the answer too. If you’re interested, there is a brilliant book about slack time that gives a much fuller answer to this topic.

Push the keyboard, don’t take it

The Driver — learn when to pull over.

Example 1 (Anna is navigating, Ben is driving):

Anna: “If you…..go to….”

Ben: (sliding the keyboard over to her) “(You) drive….it’s easier”.

The driver is aware of the most effective way to communicate and is happy to relinquish control when needed. Don’t let your ego cling to the keys. Hand it over when necessary.

The Navigator — don’t disempower.

The driver is often seen as the position of power in the pair, but the navigator has the ability to derail the whole exercise by hijacking the keyboard when things get tricky. With great power comes great responsibility.

Have somewhere to draw.

In Dr. Freudenberg’s research, a key finding was the use of scribbled on diagrams in high performing pairs. The creative act of writing the diagram sparks thoughts and jogs memories. They were far more powerful than pre-existing diagrams, which seemed to be more useful when seeking a holistic view of multiple teams and systems.

Sometimes things are difficult to convey without a hastily drawn picture. If you don’t have a whiteboard, use a notepad. In one example, Dr. Freudenberg observed someone tracing a diagram with their finger. Drawing sparks joy people!

Invite spontaneous outside help

Then… Bill from the payments team leans over and asks you about something you just said.

Oh my GOD Bill

But Bill has got a good point.

Interruptions are going to happen, especially when you’re building the wrong stuff. The truth is, Bill just saved your bacon. In Dr. Freudenberg’s research, this kind of open communication was welcomed by high performing pairs. It increased knowledge transfer and made for a much more efficient pairing.

So go apologise to Bill. He just saved you a bunch of time and fresh grey hairs.

Preserve Context

That complex clockwork of context in your minds eye is only available in your living room. In the workplace, you’re gonna need to talk and not always on your own terms. Dr. Freudenberg explains that software engineers need to operate at multiple levels of abstraction at the same time, constantly flitting in and out of levels of detail. This creates problems when building up large, complex images in your mind. How do the high performing pairs deal with this?

Lists, you silly goose

The next time James from HR comes in to tell you to stop high fiving strangers in the lobby, your context won’t be obliterated. You might be slowed down for a moment, but glance down at those sweet lists. You’re back in the matrix.

And one more thing about lists

Share the burden with tag team pairing.

Coffee number seven. This damn test won’t go green, no matter what you try. You decided to swap when it did, so you’ve been driving for well over an hour. You’re tired, your partner is bored and progress has all but stopped. Soon, you’ll go home and drink whiskey like any 90s American action hero.

We’ve seen this a thousand times. Individuals investing too heavily in the problem and refusing to review their goals. Often it’s pride, sometimes it’s sheer belligerence. To combat this, Dr. Freudenberg found that as well as specified goal points, high performing pairs would “tag” one another in.

Avoid steroids… but other than that, these guys provide some good pairing role models.

This makes intuitive sense, right? In the ring, if Stone Cold Steve Austin is growing tired, you know he is gonna tag The Rock in (my wrestling knowledge is pretty out of date). If you’re running out of juice, it should be a legitimate reason to change drivers. Don’t trip and fall into the death march.

Follow Dr. Freudenberg on Twitter! I do and you should too. Also, the source material for this article (including all relevant academic sources) is available on Sal’s wonderful blog.

While you’re at it, follow me on twitter. I’m regularly blogging about the work of other, smarter people.

This is no longer updated. Go to instead

Chris Cooney

Written by

Depending on my mood, I either break things or make things.

This is no longer updated. Go to instead

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade