How Does Pair Programming Improves Productivity

Amrianto Saragih
4 min readMar 10, 2019

--

Pair Programming Image

What is Pair Programming?

Pair programming is an Agile technique originating from Extreme programming (XP) in which two developers team together and work on one computer. One, the driver, writes code while the other, the observer or navigator. The two people work together to design, code and test user stories. Ideally, the two people would be equally skilled and would each have equal time at the keyboard. how does pair programming improves productivity?. first you should know what are the advantage and disadvantage of pair programming.

The Advantage of Pair Programming

There are several advantage of pair programming as reasons you should consider.

  • Two heads are better than one. If the driver encounters a hitch with the code, there will be two of them who’ll solve the problem.
  • More efficient. Common thinking is that it slows down the project completion time because you are effectively putting two programmers to develop a single program, instead of having them work independently on two different programs. But studies have shown that two programmers working on the same program are only 15% slower than when these programmers work independently, rather than the presupposed 50% slow down.
  • Fewer coding mistakes. Because there is another programmer looking over your work, it results in better code. In fact, an earlier study shows that it results in 15% fewer bugs than code written by solo programmers. Plus, it allows the driver to remain focus on the code being written while the other attends to external matters or interruption.
  • An effective way to share knowledge. Code Fellows talks about how it could help programmers learn from their peers in this blog post. It would allow programmers to get instant face-to-face instruction, which is much better than online tutorials and faster than looking for resources on the Internet. Plus, you can learn things better from your partner, especially in areas that may be unfamiliar to you. Developers can also pick up best practices and better techniques from more advanced programmers. It can also facilitate mentoring relationships between two programmers.
  • Develops your staff’s interpersonal skills. Collaborating on a single project helps your team to appreciate the value of communication and teamwork.
  • Having backup of knowledge in the program, If one of the pairs was resigned, you’ve another programmer who knows the entire program that has written.

If you want to read more about the advantage, click this link.

The Disadvantage of Pair Programming

  • Lack of will. Some simply prefer and work better alone.
  • Wrong tasks. Pairing at the wrong time can be both time consuming and inefficient.
  • One can slow down two. If one is a slow thinker/typer or unfocused it can slow down the other one as well.
  • More talk less coding. You might end up explaining things that would be faster to just code.
  • Lack of code ownership. Since two developers are responsible for the code both can feel that the other one is more responsible. If an error occurs there could be a discussion of who should fix it or if it should be done in pair again.
  • Loss of confidence. Some developers find that pairing a lot loses their confidence of coding alone and they want to pair on more things than necessary.

If you want to read more about the disadvantage, click this link.

Why is Pair Programming Better Than Code Reviews?

First, you should know what code reviews are. Code reviews are a process where another programmer take a look at your code to find something that needs improvement or find defects in it. it something like testing your entire code and ensure that everything you code is running well. but then it’s hard to find someone who can review your code because not everyone can read your code as well and understanding your code as you did. if there someone who can review your code, it’s likely wasting time for the people who review your code. not only wasting time for the people who review your code, but also wasting your time because he/she always asked you while he/she got a problem to review your code. and if someone who one of the pairs was resigned, you’ve someone else who knows the entire program that has been written.

With pairing, it is like having somebody review your code instantly and regularly. It is a higher form of code reviews. Two people have to be there and understand the program being written. And if one sees problems with the other’s code, then it can be instantly corrected. You also have fewer chances of having bugs written into your code. Code reviews are not as proactive as you have to wait until the code is completed, bugs and all before somebody could take a look at and correct it.

Conclusion

Pair programming can improves productivity because no need another programmers to review codes, and reduce mistake while coding.

References

--

--