Enhancing Teamwork and Knowledge Sharing with Pair Programming

Rafael A. George Duval
3 min readFeb 13, 2023

--

Pair programming means that two people write code together on one machine. It is a very collaborative way of working and involves a lot of communication. While a pair of developers work on a task together, they do not only write code but also plan and discuss their work. They clarify ideas on the way, discuss approaches and come to better solutions. Teams tend to ship slower over time because they accumulate sub-par code that impedes their progress.

Pair programming brings more intellectual firepower to bear on this challenge. A pair of programmers tend to produce better code than someone working alone. Teams that pair often will maintain a fast shipping speed longer. When pairing, fewer corners are cut (and fewer distractions are indulged in). With two sets of eyes, bugs are caught earlier. With two brains to a storm, more creative solutions can be found. Pairing is two people working together on a single programming problem. The goal is to spread and exchange knowledge rather than concentrate on it. Pairing is the best way, by far, to share knowledge between team members and prevent knowledge silos from forming.

Teams tend to ship slower over time because they accumulate sub-par code that impedes their progress. A pair of programmers tend to produce better code than someone working alone.

Teams that pair often will maintain a fast shipping speed longer. A team that ships almost always does so because it is fighting a sub-par codebase.

You can write code that minimizes these problems. It’s much more complicated. Pair programming brings more intellectual firepower to bear on this challenge. With two sets of eyes, bugs are caught earlier. With two brains to storm, more creative solutions can be found. With someone always watching, fewer corners are cut (and fewer distractions are indulged in).

Let’s start with the most direct and least disputed benefit of pairing: Knowledge sharing. Be bold in pairing on tasks when you need to learn about the technology or environment. Having two people work on a piece of the code helps the team spread knowledge on technology and domain daily and prevents silos of expertise. If you keep working in the area, you feel most comfortable in. You will miss out on learning new things and spreading knowledge in your team. Pair programming forces us to discuss approaches and solutions instead of only thinking them through in our heads. Saying and explaining things aloud pushes us to reflect on whether we have the correct understanding or a good solution. It’s a lot easier to have a structured approach when there are two of you: Each of you has to communicate why you are doing something and where you are heading. When we pair, we have four eyes on the little and the more important things as we go. More errors will get caught on the way instead of after we’re finished.

The refactoring of code is always part of coding and pair programming. It’s easier to improve code when you have someone beside you because you can discuss approaches or name things, for example. Ask each other questions! Questions are the most powerful tool to understand what you are doing and find better solutions. Collective code ownership abandons any notion of individual ownership of modules. The consistent pairing ensures that every line of code is touched or seen by at least two people.

Limiting work in progress is one of the core principles of Kanban to improve team flow. Especially in larger teams, pair programming limits the number of things a team can work on in parallel and increases the focus. This will ensure that workflows and blockers are addressed immediately.

Changes in a team have an impact on the team flow. People need some time to get to know each other. Pair programming can help cut that impact because it forces people to communicate much more than they need when working solo. This will make it easier for them to follow along, contribute during the pairing, and get the most out of it. Always use the new joiners’ machine when pairing to ensure they are set up to work by themselves.

[¹]: Clean Agile: Back to Basics (Robert C. Martin Series)

--

--

Rafael A. George Duval
Rafael A. George Duval

Written by Rafael A. George Duval

✍🏼 Building a Solo Digital Media Company 🧪 Snippets of Text [https://snippetsoftext.substack.com/subscribe]

No responses yet