Be a better navigator
Have you ever noticed how tiring a full day of pair programming can be? It's bloody exhausting.
I used to pair for 7-8 hours a day with a guy called Nigel. Almost without fail, we'd both be absolutely knackered by 4.15 in the afternoon, at which point we'd crack out the tea and biscuits. We needed half an hour in the comfy chairs to recuperate.
Here's a picture of Nige, doing just that (though I'm not sure what he's done with the biscuits).
This wasn't slacking; our brains needed a rest. Why is pairing so much more tiring than working alone? Constant communication requires non stop concentration.
Pairing with Nige was a lot of fun, but we were working so hard that we had to find ways to reduce the mental overhead. We had to communicate more efficiently. Along the way we picked up the following tips for the "navigator" (the one who is observing, rather than driving).
Pick your moment
Imagine that you're working on a problem, and that you're driving. You're just in the middle of getting a tricky bit of code working, when your partner says "Oh! I've just spotted a bug in the foozle method we wrote yesterday... there's an off by one error in the outer most loop!"
It's no doubt a great spot, but do you need to hear that right now? No. The distraction has put you off your stride and -- worse still -- you've had to try and think about two things at once just to listen to (and understand) what they said. That's an overhead that you shouldn't have to deal with while working on a hard problem.
What your navigator should have done is quietly made a note on a written list of bugs, refactorings and tasks (we called this list "the stack") that the pair need to address during the current story. All you need is a piece of scrap paper or an index card. Writing these problems down guarantees that they won't be forgotten.
So it's not what you say, it's when you say it.
Of course, if your pair were to notice that you'd made a mistake in the code that you're currently typing, "right now" would be an appropriate time to mention it.
Or would it?
Keep your powder dry
Now imagine the roles are reversed, and that your partner has started driving. They've just missed out an important bracket, but have kept on going...
Just because your pair hasn't immediately corrected a typo, it doesn't mean they haven't noticed it.
Keep an eye out for how they usually deal with errors. Do they stop and fix them right away, or do they continue typing and clean up afterwards? Make sure that you don't say anything until you're sure that they've missed it. Telling them what they already know is unnecessary, and it's tiring for both of you.
Being constantly corrected when you know you've made a mistake can also be quite frustrating (just for the record, it drives me nuts). If in doubt, ask your partner how they'd like you to approach it. They'll appreciate the consideration.
Which brings me on to how to say it.
Shush, won't you?
Let's stick with this example of the typo for a bit longer. Once you're satisfied that it's an appropriate moment to mention it, it's time to bring the error to the typist's attention.
Do it in the simplest way possible.
- If two words will suffice, don't utter a full sentence.
- If the error is obvious, don't speak at all. Just point. If you think it'll help, say "bracket" while pointing at the right location.
Pointing at characters on screen is easier with the tip of a pen than your finger (and you should already be holding a pen so you can keep the stack up to date).
Being a good navigator involves being a good communicator, not a good talker.
I love feedback and questions — please get in touch on Twitter or leave a comment.