☕ 2 min read
Pair-programming is two persons, coding on the same screen.
Why do we pair-program? I think the main reason is to communicatebetween developers of the same team.
Communication is a central part of our job: building software. To build a software that satisfies people’s needs, we must talk together to understand these needs. We must share this knowledge among the team to align everyone with a common goal. Thus, communication is key to ensure we are all sailing to the same objective. At the end, everyone’s code is going to be merged into the same codebase. Pair-programming helps us meet before our code does.
There are orher practices with the same benefits: technical retrospectives, code reviews or mob-programming for example. You can combine them.
“But we don’t need pair-programming, we do code reviews.”
Let’s talk about the specificities of pair-programming then.
First, we get real-time feedback during pair-programming. We do have feedback during code reviews too, but it happens later − often when the feature is considered “done”. When we pair with a co-worker, we get instant review of the code we write. Actually, we are thinking together.
Then, as we think together, pair-programming is a better filter against bad ideas or laziness. This can be true for code reviews done correctly − which will hardly happen if the pull-request is big. This is even more true during mob programming.
When we code alone, we put both our best and worst decisions into the codebase.
When we code together, only the best decisions of the team make it through the filter of our combined point of views.
Finally, I think there is something that only happens during pair-programming: people share how they work, tips and tricks, in real-time.
We teach each other our own productivity tips − keyboard shortcuts, techniques… We help each other grow in our day-to-day work. That’s how I learned some features of the tools I use and I didn’t know existed. That’s how I teach my teammates some habits worth trying to waste less time on daunting tasks.
Sharing is why we do pair-programming.
If you do pair-programming, don’t forget to keep it dynamic, switching roles frequently. And do take breaks: pair-programming requires a lot of attention and can be exhausting.
Now tell us, did you have had an “aha” moment doing pair-programming?