How I Learned to Love (or at Least Like) Pair Programming

Some people are naturally inclined to pair. Not me. My brain is all over the place when I code, so it’s difficult to focus energy on solving the problem at hand while explaining my reasoning and approaches to my pair.

This thing is, pair programming is a highly-regarded and widely-practiced convention here at Atomic. When I started here, I had never paired before. And I was quite surprised to see both how effective it was for others, and how difficult it was for me.

Part of that was due to being a new developer, but another factor was, simply put, stage fright. I got caught up in trying to “prove myself” to my new coworkers, and I found it difficult to concentrate on the work in front of me.

It was a challenge at first, but over time, it became much easier, until eventually, it was…fun. Below are some practices that I found to be very useful.

1. Remember That Your Pair Isn’t Out to Get You.

As I mentioned, I struggled with this thought as a new developer fresh out of school. I imagined that every time I missed a test case or struggled with a bit of logic, my pair would run and tell everyone that I was incapable of development. This couldn’t have been further from the case, as all of my teammates and pairs have been more than helpful and understanding. Still, it seemed real in my head, and I had to constantly remind myself that I was making something out of nothing.

2. Don’t Get Wrapped Up in Your Own Mind.

Verbalizing your thoughts while pairing is critical. Not only does it keep your pair engaged; it also helps you keep yourself on target. If your mind is anything like mine and travels in a hundred directions while coding, practicing this ensures that you won’t get off track. It also indicates to your pair that you’re open for discussion and feedback, which is a key reason to pair in the first place.

3. Learn How to Receive Feedback.

This can be tough for someone new to pair programming, as a comment or question about a decision may make you feel like your partner is insulting your methods or doubting your skill. Remember that everyone makes mistakes, and take this opportunity to learn. If you disagree, explain your reasoning to your pair and start a discussion. Likewise, learn to give feedback. Don’t be quick to point fingers. Instead, offer advice and solutions, rather than a passive-aggressive comment.

4. Communicate with Your Pair.

Let your pair know how you prefer to work as soon as possible. Are you the type of person who thinks best while walking around? Do you find yourself getting water or a snack every so often? Will you be out of the office in the afternoon? Tell these things to your pair, so you can utilize your time together most effectively. Communication is crucial for sustaining a good relationship with them over the long run, as they might not immediately understand how you work.

5. Have Fun.

This sounds terribly cliché, but it really is something to keep in mind. At first, pairing might be stressful and frustrating, but in time, you can learn to love it. It’s rewarding to solve problems with someone else, and it’s almost always more fun than sitting in a cubicle with headphones on. Believe me–I’ve done both, and I know what I’ll choose to do when given the choice.

I’m still learning how to be a great pair, and I’m sure there’s always room for improvement. The points I discussed above are some of the major things that I focused on while learning how to pair program, but by no means is this a comprehensive list. If you have any thoughts on the subject, please share your comments.