Why Pair Programming?

David Jardine
6 min readOct 17, 2020

As a student in web development, pair programming has become an essential aspect of my learning experience. Some of you may be wondering, “What is pair programming?”. Before we continue, let’s take a few moments to talk about the concept and why it is so important for students. Following this, I will demonstrate why pair programming should be a regular practice for Junior and Senior Developers alike.

What is Pair Programming?

Pair programming is a technique in which two developers work together at one workstation (many use screen sharing technology due to remote work at this time). One developer decides to be what is called the driver, and the other the navigator. The driver writes the code, while the navigator observes and reviews each line of code as it is written. The developers should swap roles frequently.

The navigator provides direction to the driver, recommending suggestions for improvements and creating the strategy or approach for the driver. Two sets of eyes are always better than one, which allows for an increased opportunity to catch errors and predict any future problems that may need to be addressed. This enables the driver to focus on writing the actual code, completing the task at hand, while using the navigator as a safety net and guide.

How has it helped me?

As a student in web development, there are areas that I am more confident with than others. The term impostor syndrome was a foreign concept before I started my journey as a developer, whereas now it is all too familiar! I think it is worth noting that my introduction to web development and coding has been through a 12 week intensive boot camp. This fast paced, high pressure program introduces a wide range of topics over a relatively short period of time.

With that in mind, the first time I participated in a pair programming session with a classmate, I was particularly overwhelmed by many of the newly introduced concepts within this program. After our first session together I realized how powerful of a technique it really was. We worked as both the driver and navigator during our session, switching roles regularly, allowing us to gain perspective of each aspect. We were two individuals with varying degrees of understanding. Many of these concepts were recently introduced to us. By the end of our session we were brought up to similar levels of understanding. We talked out problems and worked through solutions together, while also keeping our code clean, easy to read and error free. We identified multiple solutions to one problem, deciding on an approach that made the most sense to us.

I would like to reiterate the importance in creating a space for us to work together, to strengthen our skills, and build confidence in our approach to our work and our code. I have observed that the use of this technique goes far beyond education, but is essential in the field of web development and programming. Senior developers can work with juniors to allow them to learn and grow as developers, attempting to raise each other up to deeper levels of understanding.

I have continued to reach out to other classmates throughout my experience in the boot camp, suggesting we pair program as much as possible. I believe that if we can talk through our code together, then we will subsequently have a much broader understanding of our code. We cannot begin to find solutions unless we are able to articulate the obstacles or challenges we hope to overcome. Understanding the problem is half the battle, and only then can we efficiently use our time to move towards a solution.

Pair programming also creates space for positive interactions. I believe that it can play a huge role in team building, creating rapport, as well as promoting positive communication skills among developers and peers.

How do others feel?

Now that I have championed my own experiences with Pair Programming, let’s take a look at what others are saying about it. Many agree that this technique has much to offer. Many of the pros I have already mentioned, so let’s first take a look at some of the potential cons to be aware of before talking about the pros.

Cons

Sometimes pair programming can over complicate a simple task. From a financial standpoint, putting two programmers on a straightforward task, may seem like a waste of resources. Depending on what you are trying to do, give some thought about whether a particular task is best suited for pair programming or not.

Some employees mention they leave work feeling “brain dead”. Working in a pair all day puts added pressure onto employees, and holds employees more accountable. Some report feeling that they cannot go at their own pace, and have to keep up with their teammate. It is harder to cut corners and to slack off when pair programming, which is a good thing from a company standpoint. However, this kind of added pressure needs to be balanced with taking more frequent breaks throughout the day.

Other issues arise with pair programming when the pair does not work well together. There can be friction between developers where egos collide and cause the work to stop completely or hit a wall. These types of scenarios are always possible in the workplace, but pair programming can bring these feelings to the foreground.

A major concern with pair programming is the skill disparity. If partners are at completely different skill levels, you might have one developer doing all the work or constantly teaching the other. This is OK if you are trying to bring each other up to a higher level of expertise, but it can slow down productivity. It should be cautioned that pairs be patient with one another and work together to find a balance. Each pair should switch from driving to navigating frequently to allow the other to practice each role and have their input valued.

Pros

I would like to end on a positive note going over some of the pros that people have reported about pair programming. Many of them align with my initial thoughts during my time as a student. Let’s reiterate over them now:

  • Two perspectives on a problem are better than one.
  • Able to spot errors or potential bugs faster.
  • Combined knowledge allows for more efficient code
  • Due to combined knowledge, there is less dependency on the individual, in case that person is not available, others are confident in knowing what to do.
  • Less stress due to the workload being shared evenly.

I believe the pros far outweigh the cons and if approached with a positive mindset, the cons could be reduced or even removed entirely. We should all be giving pair programming more consideration when starting future projects to increase productivity and create a stronger team environment.

Happy Coding!!!

Sources

--

--