Pair programming is not about taking turns using the computer or being someone else’s typist. It’s about engaging two minds on the same problem so that a solution can be developed more quickly and with higher quality than if one person was working on it alone.
The two roles in pair programming are referred to as driver and navigator. The driver is the one with hands on the keyboard, It’s the driver’s job to get ideas into the computer and deal with the minutiae of typing. But the driver’s main goal is to trust and support the navigator. As the driver, I often think of myself as in service to the navigator. I still voice my opinion or challenge things if I have questions, but as the driver my hands are full, both literally and figuratively, so it’s hard for me to think several steps ahead. This requires being comfortable working with an incomplete understanding of the task, but that’s often a more efficient way to work.
The navigator, on the other hand, is free from the minutiae of having to type in code and so is able to see from a broader perspective. One of the main jobs of the navigator is to share information with the driver at the right level of abstraction. The overall goal is to present information so it’s easier for the driver to process. The navigator should give the driver the next instruction needed to implement just in time and at the correct level of abstraction so the driver can enter it most efficiently. The navigator is thinking about the problem at a higher level of abstraction so has a sense of the direction they want to go.
It’s the navigator that tells the driver what to do next, but what if the driver has an idea for what to do next? Simple, just pass the keyboard. This helps keep both pair partners in sync with each other.
There are several different kinds of configurations you can adopt when doing pair programming.
One of my favorite approaches to pair programming is what Llewellyn Falco calls “strong-style pair programming.” He defines strong style pair programming as follows “In order for an idea to go from your head into the computer, it must go through someone else’s hands.”
The best advice I can give both the driver and the navigator is to take a break and ask questions when you have them. When you ask questions of each other, you engage each other in meaningful conversation and you also help to understand each other.
These natural breaks are also ideal for passing the keyboard back and forth. We want to trade driver and navigator frequently throughout the day. Typically this is anywhere from just a few minutes to twenty or thirty minutes, though some purists would say that naturally trading the keyboard every two to six minutes is ideal.
When I see teams stuck in the roles of driver and navigator for more than an hour at a time I’ll sometimes introduce an external timer initially set for twenty-minute intervals so they have a reminder to trade off. Since timers can interrupt the workflow of a pair it isn’t ideal, but it helps form the habit of trading off frequently, which tends to boost overall productivity among the pair.
{2 Comments }
Previous Post: « Ping-Pong Pairing
Next Post: Buddy Programming »
It was great to see you both (David & Llewellyn) at AONW (AgileOpen Northwest) last week, and to sit in on 2 Mob (not pair) programming sessions. Having not written code for a while, it was intimidating to take the navigator or driver role, but one of the intended outcomes of pair (or mob) programming is shared learning. I certainly learned a lot. As a member of the mob, I heard great ideas fly by that I didn’t understand fully, but as a navigator or driver, the concept that someone else’s idea must flow through my mind (as a navigator) or through my hands (as the driver) meant that the rest of the mob had to communicate at *my* level. This created accelerated learning for me because they couldn’t move on until I understood what I was doing. This is an explicit Strong-Style Pairing, but an often unstated benefit is that the speaker gets a benefit from having to be an instructor. It’s well known that teaching an idea helps the “teacher” as much as the “student”.
Hi Michael,
Great seeing you as well. Yes, pairing and mobbing are always different than one would expect and usually much better than expected, in my experience. Strong-style pairing is a great way to start. When the driver is in service to the navigator by dealing with the details of coding and the navigator is in service to the driver by directing at the highest level of abstraction the driver can easily assimilate, then pairing (or mobbing) can be highly effective. When I ask pairs to do strong-style pairing they almost always fall into a natural collaboration without any additional instruction from me.
We still have so much to figure out about building good software and our best resource is each other. I learn so much whenever I pair or mob. That’s why I’m an advocate!
David.