A Week of Pair Programming

by Matt Cholick

Monday marked my first day at my new job with Rally Software. Culturally the company is quite different from other places I've worked. The biggest cultural shift for me has been the extensive use of pair programming. Nearly all the code I've written this past week was done while paired with another developer. There are several different setups possible for pairing. The setup I've been part of had a computer with 2 keyboards, 2 mice, and 2 displays where the output is mirrored. I'd never practiced this type of development before this week and the experience has been very interesting.

The first thing that surprised me about this style of development is how much it helps to maintain focus. We're working in a temporary office space until next month and it's quite small, especially when everyone on the team is in the room. There have often been three separate conversations going. It's the noisiest environment I've ever done development in. Pairing, though, has really helped me focus on work. Development in this way requires a running discussion, which masks out the other things in the room. I think I would have trouble trying to write software by myself in such a distracting environment, but when writing with another person it just hasn't been an issue.

Another thing that has helped me to focus is the way that pairing limits email and other electronic distractions. I was always pretty prompt about taking care of messages as I saw them come in. I can't do that when paired though. There's no bouncing to email or Twitter on a recompile. I've even been ignoring text messages. Working closely with someone, sharing the same screen, tabbing to those other programs just doesn't work. And without them... wow. I've heard over and over how people are bad at multi-tasking, but I've always just done it anyway. It's really hard not to at work. I didn't realize how much this was destroying my productivity, though, until spending a week in an environment with hours of time focused on a single task. It makes an amazing difference.

Another benefit to pairing is how much I've learned. I feel like I've improved more as a developer in the past week than I did in the two months proceeding it. Programming in really close collaboration with another developer gives me a window onto their years of experience. They know different tools and techniques. More interesting, though, is how working really closely with someone to solve a problem in this way has given me different views onto how other people break down and approach development. I'm convinced this is going to greatly improve my own programming skills.

I'm also firmly convinced that the code produced by a pair of people developing is significantly better. Watching this process work over the past week, I've already seen numerous times where the developer not at the keyboard points out a mistake. Tests might have caught the bug before it was committed, but, then again, they might not. The general code quality is improved too. Code that is unclear and understood by only a single person will never make it to a commit. At least two developers will understand every line of code that goes into the product.

I've only spent a week doing this style of development, but the experience has been a very positive one. I wish I'd tried this earlier.