3 Tips for Better Pair Programming
How to be a good partner
Pair programming is a methodology that puts two or more developers into a relationship of continuous coding and peer-review. It's a method of building peer-checking into the development process, rather than tacking it on at the end with a code review. Companies’ adoption of this method ranges from “not at all” to “all day every day,” and I’ve been on both ends of the spectrum.
Like any human relationship, pair programming can be challenging, often encountering miscommunication, misunderstanding, and struggles for control, among other issues. But, on the other hand, it can be rewarding, fulfilling, and enjoyable!
Those who exercise open communication, humility, and gratitude will experience the best things that pair programming has to offer.
Open Communication
The most important thing to your partner is that they feel heard.
If you have an idea that your partner disagrees with, then give them a chance to explain and convince you. Be open to feedback and don’t take their criticisms personally. You may defend your idea, but you must not become defensive. If you argue, it can be bad for the relationship; if you win the argument, you really lose the good will of your partner. If you can’t get them on board, don’t be discouraged; the only thing that really matters is that you two figure out something to deliver value.
If your partner has an idea that you disagree with, it is important to hear them out without interruption. If they end up evolving their idea through the process, or if they’ve convinced you that it’s a good idea, then great! If not; then try to pull any good elements from their idea, and make sure the application is functional and tested, and move on.
If your partner appears to be getting anxious, they might just feel unheard. Try to give them more agency. Make it clear that you’re listening by asking them follow-up questions and implementing their ideas.
Humility
Humility in pairing is putting the quality of the code ahead of your own ego. If you become attached to the code you write, you may become blind to issues in it. If your partner finds issues, your ego may become closed-off to them.
Don’t try to be the best programmer in the pair. No one wins in that contest.
Give credit to your partner for everything they contribute. If you can’t tell who exactly did what, then you’re probably overestimating your own contribution, so be sure to credit them gratuitously.
Don’t keep a mental record of all of the times you think your partner messed-up. Odds are, they are already doing that to themselves. They need your encouragement more than they need your criticism. Consider each day as a clean slate and do your best to build them up.
Gratitude
In your heart, learn to truly value your partner. Don’t be thankful only at a surface level. The more you cultivate your gratitude toward them, the more you will notice their strengths, the easier it will be for you to work with them. They may return the favor and help you develop your strengths as well!
Your partner spends many hours dealing with you and all your quirks. That’s not easy, so give them some credit for that!
Bonus - frequent breaks
If it feels like it's hard to have open communication, humility, or gratitude then it's past time for a short break!
Stepping away can also lead to individuals being able to reflect on the problem without being the driver or navigator. It gives them time to think through or research the problem, not just the minutia of the current step, and think more holistically about the problem and the issues at hand.
Take time away so that you can be fully present when you are working together. Nothing is worse than a pair that is distracted or isn't trying to contribute!
Conclusion
It turns out that a successful pair programming relationship is similar to a marriage! They’re both based on respect, communication, humility, and gratitude (and varying mileage with the bit about breaks!) Who would have thought that treating your co-worker like your spouse would be a good idea?