Estimate project

What Is Pair Programming? Types, Pros, and Cons

Software Development   -  

February 15, 2017

Table of Contents

Lately, our Designveloper team started implementing a new working method – Pair Programming, where two programmers sit side by side at one computer, sharing just a single workspace. So what is pair programming?

We were very nervous at first time. You know, we, programmers got used to using our own swords and fighting solo when getting into the war. Then, suddenly you have to share your weapons with another guy, how confusing it could be?

pair programming

Surprisingly, we have to admit that much like a cup of coffee a day, pairing tastes awful at first, but we end up liking it after just a few weeks imbibing of it repeatedly.

So in today’s post, I’m going to share with you some reasons why we fell in love with pair programming and why it’s a good idea for every ninja coder to give it a try.

What Is Pair Programming?

In a nutshell, pair programming is when two programmers are coding together. To make it easier to understand, let’s imagine when you and your friend are in the car. You’re driving and your friend is responsible for looking at the map and showing the direction. The same can be said of pairing. In pair programming, while one developer is writing code and implementing solution, the other beside will keep an eye on the big picture and navigate.

Benefits of pair programming

How We Actually Pair at Designveloper?

At Designveloper, we do pair programming slightly differently. Typically, in pair programming, it is recommended to use only one machine for both developers but we use two machines. The reason is that each developer has his/her own preferences, for example, text editor, IDE, font, color, screen resolution, a place where his/her code resides, etc. Letting each developer works on his/her own machine would make the developer feel more comfortable. The other developer can also learn more from these preferences and he/she can pick what he/she wants.

However, the common mistake when 2 developers working on 2 machines is that the navigator tends to use his/her own machine while the other is coding. To avoid this problem, we explicitly require the navigator to close his/her own laptop.

1. The 2 Laptops Work Best With a Big Monitor.

It is recommended to have at least a 23” monitor with 2 HDMI ports. Skype or Hangout screen sharing work best in case of working remotely. If 2 developers sitting next to each other but do not have an extra monitor, using the built-in screen sharing feature of the mac to keep 2 machines displaying the same is recommended.

Following is the instruction to setup screen sharing on Mac:

Benefits of pair programming

Throughout the process, programmers will switch roles frequently, constantly talk to each other, and especially do research together to keep both engaged.

We also have a pair programming diary. At the end of every day, the lessons learned will be documented. At the end of a working week, all the lessons could be used for sharing via a blog post for example.
Last but not least, we highly recommend you to use the Pomodoro technique for keeping time and taking breaks between every section. You can use Be Focused app on the app store to execute this.

2. How We Measure Pair Programming?

It would never be easy to measure the value. That’s why we use Hubstaff to track all the work and get invaluable insights into the real results programmers produce.

The 3 Types of Pair Programming

The following are 3 typical pair combinations:

1. Expert – expert

Since both members of the team are experienced, they can produce the best quality for sure. The thing is there’s always something more to learn but experts used not to make questions. And as a result, they normally lose their creativity and are less likely to introduce a new solution.

2. Expert – novice

This will be a great opportunity for the novice to learn more from the expert. When the novice raises questions, the expert has to think over and explain. This Questions & Answers process can lead to the best new solution.
Nonetheless, make sure the novice is active. If not, the novice may end up just watching and the expert will feel annoyed. This is the watch-the-master phenomenon.

3. Novice – novice

Obviously, two novices pairing can give better results than they working independently. But this combination is discouraged.

The 5 Benefits of Pair Programming

We’re gaining huge benefits from pair programming:

1. Better product quality

As usual, after the code is written, we need to review it to improve the quality. The thing is even though you try your best to focus on reading your code, again and again, you still might not come up with some suggestions for better quality.
But with pair programming, the review process will be done WHILE the code is being written. It sure makes the code nicer, and reduces the risk of errors and failures.
Moreover, two heads are always better than one. Solo developers can’t think up more alternatives when proceeding than a pair could. And as the result, it leads to better design quality.

2. Better team knowledge

Let’s face the fact that humans fundamentally like being social. And pairing means more communication. It gives us chances to make friends with the ones we normally don’t hang out with. In consequence, it builds trust inside the team and makes employees comfortable. Happy employees help us to build a productive and effective team for sure.

Recommended read: Top 6 Best Productivity Apps for Business Owners

3. Sharing experiences

Everyone makes mistakes. Sometimes, to solve a problem you just need a simple solution but somehow you can’t realize it by yourself. In the pair programming process, we will constantly and easily learn from our partners.

When an expert and a novice are paired, we can save ourselves a lot of headaches and time in training newbies. Pair programming could be a good way to strengthen each other skills faster.

4. Saving time, getting more money

If you think that having two programmers work on a task will double the hour it takes to do that task, you’re wrong! I did think the same at the beginning.

A study run by Laurie Williams from the University of Utah shows that pairs just spend about 15% more time on programs than individuals (Figure 1). However, the resulting code has about 15% fewer defects (Figure 2). Let’s take a look at the two charts below:

Figure 1: Programmer Time
Figure 1: Programmer Time
Figure 2: Code Defects
Figure 2: Code Defects

Having a second set of eyes can help us debug faster. Time-saving is obviously equal to more money!

5. Reducing staffing risks

Don’t you ever feel frustrated when your staff is off and then tons of workflow is interrupted? When it comes to pair programming, you can say goodbye to this stress. One member in the pair is off, the other still knows exactly what to do without taking time to transfer.

Downsides and How We Overcome Them

1. The Common Disadvantages

Nothing is perfect! So pair programming may have some disadvantages. On our journey to successful pairing, we have discovered some of its drawbacks:

  1. Taking up all the time talking: If one person in pair or both do not have any experience with the task they are working on, they might end up explaining things almost time and might not even touch the keyboard to write code.
  2. Bad effect on each other: What I mean is that if a member is with his/her head in the clouds, or is simply a slow typer, it can slow down his/her partner as well.
  3. Lacking self-confidence: The most common situation we met is someone in the pair doesn’t have the courage to admit that he/she is stuck at some points. They just wait and hope things get clearer instead of asking for an explanation. This can easily lead to the “Watch the Master” phenomenon and be the main reason for disengagement.
  4. Better when working alone: Some people are just better when working solo. They prefer being independent and self-reliant.

2. The Disadvantages When Designveloper Try This Method

Nonetheless, from my point of view, there’s nothing wrong with pairing, it just depends on how to find the right partner for the right task. That’s why at Designveloper, we emphasize the need to carefully recruit team members. Here are some of our partner recruitment criteria:

  1. Good attitude: In pair programming, members have to be eager to learn and are willing to cooperate, and make a commitment to excellent quality.
  2. Strong communication skills: Pair programming is also known as “programming out loud”. Therefore, team members need to be active in speaking and even in writing documentation.
  3. High skills, good education background
  4. Sense of humor: Science proves funny people are more intelligent. Additionally, it will make the working atmosphere comfortable and sure release stress.
  5. Play hard, work hard
  6. Fast typing skill: As I said before, a slow typer will slow down another teammate.

Final Thoughts

After all, we are just new kids who make a real concerted effort to get our feet wet with a new working method for saving time in our day-to-day workflow and bringing to our customers the best product.

Pair programming can be tough and totally be a nightmare for those who can not find the right combination. But at least we did try and we have nothing to lose but a chance to win. For now, pair programming still gives us a lot of fun, knowledge sharing, and motivation.

How about your opinion? Why don’t you give it a try and share with me your experience in the comment box below? If you have any further questions about pair programming, just ask, I’m eager to help you!

Also published on

Share post on

Insights worth keeping.
Get them weekly.

body

Subscribe

Enter your email to receive updates!

Got an idea? We can help you realize it.
Submit
body

Subscribe

Enter your email to receive updates!