Last week I learned more about Pair Programming than I gained from all my previous years of working with developers. (As a Business Analyst, I have never paired for a significant amount of time, but I think I’ll be forcing that issue soon!) My team had an hour-long discussion about pair programming that filled me with new insights, although if you’re into programming and engineering you can follow this reverse engineering tutorial to know how programs work. Here’s a summary of my notes so you can gain some insight into this engineering practice.
Project Background: ThoughtWorks was hired to develop a set of branded websites for our Client. The team was a mix of ThoughtWorkers and Client developers, analysts, and project management. The first few months were pretty rough with a scope significantly bigger than the timeline. Worse, while we thought we could avoid the 15-year old legacy code and a myriad of systems, we couldn’t and it added significant roadblocks. The result is we struggled for a couple months in the middle of the project. We turned things around and were very happy with the end product, which was due to go live in two weeks. Except the project was cancelled!
The team history — struggling against the seemingly insurmountable scope and environment, turning the project around, and the sudden cancellation (for business reasons, nothing to do with the project itself) — built the environment for very open and honest discussions. Of the 25+ people on the project, almost 15 of us met to talk about Pair Programming. Most of the folks were developers, split evenly between the Client and ThoughtWorks. The Client developers were new to paired programming when they started with this project. Their total experience with pairing ranged from 1-7 months. The final third of the audience was spread among QA, BA, an iteration manager (think Scrum Master), and a Client program manager.
I kicked off the meeting by asking the Client devs if they had experience with paired programming before this, what they liked, and didn’t like about the experience. Starting off positive, they really liked the knowledge sharing and the cross-pollination of new ideas and information.
A month later I was exhausted, but I was completely on board.
Then we got honest and they said it was really awkward at first. “Do I touch the keyboard? Do I not touch the keyboard? I was pointing at the screen with my finger and the other person said they couldn’t see what I was pointing at.” Quickly, another Client dev jumped in and said, “It was intimidating. I don’t like to look stupid. When I work on my own it’s a process of doing stupid stuff, it doesn’t work, doing stupid stuff, it doesn’t work, and finally one day it works. It [paired programming] is like a test.”
“I thought the math meant we could do double,” said a third Client dev. “I was not on board and a month later I was exhausted, but I was completely on board. I would not go away from paired programming at all. You have fixed 10 things without even typing anything because you’re pair is catching things.” After a bit more discussion he came back and finished with, “It’s a different math, but I think the speed is double. It’s more efficient. When you’re with a pair, then you are not checking emails, you are not on YouTube. You are not doing any of that. You have almost no waste of time. It’s quite exhausting.”
From one of the ThoughtWorks devs with less than 2-years experience, the comment came “I learned paired programming and when I write code on my own it seems so much slower. If I could sit down with someone I could talk to it would go much faster.”
ThoughtWorks’ technical lead for the project had some interesting comments on using pair programming. For him, the largest benefits were for the project, not the particular piece of code developers were working on. “The only way to keep everyone marching to the same drumbeat is pairing and rotation. It only works when you have to work with everyone else. I’ve never found any other mechanism for keeping standards on a team.” Everyone was on board with the idea paired programming is about optimizing for the team, not the individual. Reinforcing this point, there are studies pointing to conditions where pairing is less effective, particularly on simple tasks and novice-novice pairing without enough mentoring.
Beyond the general statements about pairing, the team also discussed the best techniques for pairing. One Client dev said, “I found myself doing better where there was only 1 keyboard and we had to pass it back and forth.” They found it’s more engaging when you’re driving. And everyone agreed it is up to the more experienced of the pair to make the other person type.
There is no doubt the confidence of pairing developers is higher than those who work solo. This comes out in a couple ways. First, when giving a daily update on your progress that has been stalled by a bottleneck, it takes the pressure off when you can say, “We’re working on it.” Second, when you’re in an environment with siloed knowledge, after pairing for a couple days you are willing to say “I’ll try working on that.” On the other hand, if there’s a bottleneck and the key resource is out of the office, the tendency is to look the other way. The devs do not volunteer to help and everyone has to wait for the expert to come back.
The QA lead for the team said he didn’t track the numbers to prove it, but there was a better chance of the story passing a desk check. There is a lower chance of passing the desk check if just one person worked on the functionality.
The conversation went on for a bit more, covering topics such as pair switching, optimizing space and environments, gold plating, and even introduced new ideas like the Ping Pong Pattern. (Did you know using this method in some programming languages may result in switching every 60 seconds?!)
The evening after this meeting I read The Shame of Pair Programming, by Tom Howlett. It’s a great, short read about how bad pairing can be demoralizing. It’s takes both vulnerability and strength. I didn’t see where our team suffered this problem, but it’s something to be watched for. As we talked about in our meeting, it’s not about being an introvert or extrovert, it’s about you. You need to learn how to speak within the pair.
This project was quite the ride. And despite not going live, the closing retrospectives made this one of my favorite projects ever. I feel like I learned more from our ending conversations than on some of my much more successful engagements. Please, continue my learning by adding yours. Add your comments on how paired programming worked for you. This way I, and everyone else, can learn a bit more.
LATE ADDITION (Jan 2020): Here’s a nice post on how to pair by TW dev, Juntao Qiu: 7 Principles of Pair Programming Etiquette.