Xebia Essentials| Collaboration — Pair Programming

Mohit Kanwar
Xebia Engineering Blog
4 min readJun 24, 2020
Pair Programming

Pair programming is an agile software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer or navigator,[1] reviews each line of code as it is typed in. The two programmers switch roles frequently.

- Wikipedia

I did my first pair programming assignment when I joined Xebia in 2014. I was working on a project in the healthcare domain. Until this moment, I was a windows lover. I had never worked on non-windows systems and I was afraid of Linux based systems.

I was pairing with one of my team mates (who later became a very well connected friend). This team mate was a hard-core Linux lover. Since I was in the driving seat when we started pairing, I wrote the code and started building my java code. My friend then observed that building the same code on my machine takes a lot longer time as compared to building the same on his machine.

We compared the configurations of the machine. The only difference was the operating system. The build on his ubuntu machine was approx. 50% faster. I am not here to compare operating systems, and the point I would like to emphasize here is, if not for pair programming that day, I would have been wasting a lot of time in the project, just because I was afraid of learning something new.

Since that day, I am a big fan of pair programming. Yes, people who have not experienced it might think that it is a waste of time and resources. Specifically, the management, who loves to cut the cost (in short term) hate pair programming.

Below are the reasons why I believe pair programming is awesome!

  • Improved team collaboration
  • Collective ownership
  • Learning from each other
  • Acting under observation
  • Immediate Feedback
  • Individual confidence
  • Reduced Ego
  • Real Duck Debugging

Improved team collaboration

When you work with someone on a common goal, you improve collaboration. It helps in understanding different perspectives, of the same problem. Apart from solutions, it also results in team members knowing each other better. This improves empathy for each other. When the team is bonded well, the work environment in the team is great and better product is developed.

Collective Ownership

When two people are working on the same task, both of them push each other to complete the task.

Single is lonely, two is perfect and three is a crowd. Sometimes I am asked, why not three? Why is pair programming always between two people? The answer is when there are more than two people, there are more angles and deviations. In my experience, when two people work together, it works best, more than two people cause more gossiping and less work.

Learning from each other

Everyone is unique and enriches the team with a different experience, different background. This diversity in knowledges helps the growth of the team as a whole. When we pair different people together, both of them learn from each other. Any idea can be generated because of the combined effort. People having experience in different technologies, different teams and with different worlds, improves product quality and relevance.

Acting under observation

You cannot be lazy when you are working with someone. We can procrastinate when working alone, but that is not possible when two people are working. Both people observe each other and make sure tasks are completed on time, with quality. (Well, unless both of them are lazy and planning to quit the job already)

Immediate Feedback

One advantage of being agile is getting fast feedback. With pair programming, we can get immediate feedback. When two people work together, they improve each other’s understanding of the task and deliver better quality.

Individual confidence

Recently, I was working with a young developer who did not speak much. He was under-confident. During pair programming with him, I realized that he in-fact is a gem.

He just needed a little direction. He works hard to get work done, thoroughly reads the documentation, and delivers more than expectations. Just a little grooming and he was the star of our team.

Reduced Ego

With experience sometimes the side-effect is being egoistic and arrogant. During pair programming, when you are working under observation you realize that you commit mistakes too. You realize that you are human too, just like the person you are pairing up with. This results in reduced egos, and better team bonding. I have learned a lot from people younger than me.

Real Duck Debugging

I hope you are aware of Rubber Duck Debugging Concept: When you are stuck in resolving a bug, and everything seems correct, but still not working, take a rubber duck, and explain the code to it. At some point, you will realize the mistake.

But why do you need to explain it to a rubber duck, which doesn’t give any feedback, explaining the code to a Real Duck (Your pair) works much better. Many times, it avoids the problem in the first place.

Pair Programming in the times of Covid-19

I am lucky that I am a software developer because even in these tough times when we are home quarantined, I can work from home and be productive. I can still earn money and feed my family.

A lot of new tools have emerged which help in pair programming remotely. Our team is distributed across the globe, and still, we pair up to write better code. Screen sharing tools like Microsoft Teams, Slack or even Skype are amazing tools to achieve remote pair programming.

--

--

Mohit Kanwar
Xebia Engineering Blog

I am a software developer and learner. I love to read code written by other people, understand the logic and the architecture. I love “Why”s.