Pair programming is an agile software development technique in which two programmers work together at one work station. One types in code while the other reviews each line of code as it is typed in. The person typing is called the driver. The person reviewing the code is called the observer (or navigator1). The two programmers switch roles frequently (possibly every 30 minutes or less).
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 his or her attention on the “tactical” aspects of completing the current task, using the observer as a safety net and guide.
- We’ve used Theo’s desk, composed of a Mac laptop and a Dell 22" screen in portrait mode.
- One keyboard one mouse.
- 2 chairs.
- Swapping every hour.
- 10 working days.
- 8/9 hours days.
- 1 break at lunch time + 2/3 little table football breaks while tests passing.
My pair programming experience
First of all, I probably had the most enjoyable 2 weeks programming from a long time!. Lot of work but a lot of fun as well, the kind of fun you can’t have alone in your computer, this was probably the best part of the experience. Next week I’ll pair with Jamie Dyer and I expect the same amount of fun with him!
Theo is a really smart guy, smart enough to makes complicate explanations looks simpler. That was a big plus while pairing on part that I’d never worked before like the Erlang world or the XMPP world.
We found ourselves more productive than usual while pairing. First of all you can’t cheat, you are no going to open your emails/facebook/twitter/another website while the other one is typing. Two people on one computer, and regular switching, there is no way to procrastinate. Secondly, on complex problems, it’s always good to have a second pair of eyes on the proposed solution. Maybe your teammate will find a better/simpler/quicker solution to the problem. And finally it’s always good to have someone spotting the nasty typo while writing – you know forgetting a comma, forgetting to migrate the database, misspelling a word … – this can save a lot of time. So that’s a big plus in terms of productivity.
But the other side of the coin is that I finished my day way more tired. Because your brain is constantly assailed by requests, when you’re typing you have to deal with the keyboard, the screen, the problem you’re solving + someone on your back watching you and talking to you. When you’re on the back you’ll try to spot this little typo that will cause problem, or find some help in doc/book, or try to imagine a better way to correct the problem … well, basically, at the end of the day your brain is fried and so you are.
Another problem had been the gears. I’m used to work on my Linux + Openbox powered laptop, using Vim to code. Moving to Mac Os + Textmate was a “painful” experience. You have to re-learn a lot of basic commands/shortcuts, your mouse is doing silly things with the windows, and you lost your markers … I’ve asked Theo to do one week on his machine one week on mine, but the response was a loudly “HELL NO” ;).
In a nutshell
So, the dark sides are that I was exhausted and I had to learn how to pilot a Mac Os. But the bright sides were finding myself more productive, less procrastinating and having more fun during the day. No need to mention that I’ll be really happy to renew the experience next week, and I found pair programming a really interesting way to work.
What about you, did you already tried pair programming? Did you enjoy it? Don’t hesitate to share your experience in comments.