Pair Programming

I have recently started working in Go-JEK as a product engineer. One of the things I want to talk about is the concept of pair programming.

Pranavendra Vittal
Sep 3, 2018 · 3 min read

What is Pair Programming?

In GO-JEK all code that is written on the floor is done using pair programming. Usually in the process of pair programming there are two roles: one is the driver who is responsible for writing the code, and the other is the observer who reviews each line of code as it is being written. While reviewing the code, the observer also comes up with ideas for improvement and future problems to address. This allows the driver to focus completely on the tactical part of finishing the task, while the observer is used like a guide or a safety net.These roles are switched frequently.

Benefits of Pair Programming

One of the main benefits of pair programming is the reduction in errors and bugs while writing code. Having an extra pair of eyes looking at the screen while code is being developed definitely reduces the probability of error. Further when faced with difficult problems there is a higher chance that atleast one person of the pair has encountered such a problem before.

In addition when there are two people working on the problem , through discussion and debate the problem and how to approach it can be understood better. Working as a team means that you are sharing the problem with someone else and that definitely brings some positivity into the mix.

When working as a pair you are less likely to get distracted and slack off time by using your phone or some other thing to detract from your work. You feel like you might be letting your partner down.

Pairing with another programmer allows you to share knowledge. You can learn many coding practices and approaches from your partner. Some of this knowledge can not be easily accrued from other sources.

Increasing truck factor : Truck Factor is a parameter used to track how dependent the project is on one person in the team. It is defined as the number of people who would have to be struct by truck for stopping progress of the project in a team. Teams having low truck factor are highly susceptible to stalling if even one member is missing. When pair programming happens it is ensured that for every feature developed in the project atleast two people have worked on it. So this increases the truck factor. In GO-JEK, pairs are regularly switched so that the team has a good understanding of the codebase.

My experience

I have experienced pair programming during the bootcamp having paired with different people every day. One of the things I noticed was the reduced amount of errors especially in naming conventions . At times I went with my partner’s approach even though I felt it was sub-optimal. Doing this helped me gain insight into how to solve the same problem differently. Some code pairing sessions helped me learn new tricks in the editor which helped boost productivity.

Cons of Pair Programming

One of the arguments against Pair Programming is that by assigning two programmers to the same task rather than assigning different tasks to each of them. This is a definite loss in productivity. However the quality of the code written by a pair is better than code written by individuals, and in the long run this helps avoid bugs and errors.

Another potential problem is that of skill disparity between the two pairing programmers. If one of the programmers has a much higher skill than the other, that programmer will end up doing most of the work or constantly tutoring the other.

The interaction might not always be positive. Time might be spent more on arguing on different solutions (which might be both correct) than actually doing the work. This is a potential time-consuming scenario with significant impact on the software development.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade