The World Of Pair Programming

Babison Vilvarajah
4 min readApr 7, 2021

What is Pair Programming

Photo by Alvaro Reyes on Unsplash

Programming alone has its benefits however it is not always the most efficient way of doing things, and can often lead to poor practice. We would like to introduce you to Pair Programming.

In an online survey of pair programmers from 2000, 96% of them stated that they enjoyed their work more than when they programmed alone and 95% said that they were more confident in their work when they pair programmed.

Pair programming is an agile software development technique in which two programmers work together at one workstation. One programmer acts as the driver who codes while the other will serve as the navigator who will check the code being written, proofread and spell check it, while also figuring out where to go next. The two programmers switch roles frequently.

While reviewing, the Navigator also considers the “strategic” direction of the work, coming up with ideas for improvements and likely future problems to address. This frees the Driver to focus all of his or her attention on the “tactical” aspects of completing the current task, using the observer as a safety net and guide.

How to Pair Program

The biggest pitfall developers face is incorrect form. It has been a common observation that people who are assigned to pair program are on separate computers, both coding their own solutions while utilizing their partner for questions and confirmation. While this is one way to program, it is not pair programming at all. The proper described way is to have two developers working at the same computer, with one acting as the Driver (writing the code) and one acting as the Navigator (pitching ideas, confirming syntax, looking things up, and giving the Driver instructions and ideas).

Why Pair Program

  1. Approach
    One of the most common issues that will plague a student in the initial week of bootcamp is trying to write code to solve a problem, and not knowing where to start. Quite often, the challenge is knowing that there are many possible solutions and not knowing which one to pick. Your Driver or Navigator can be an immensely-valuable asset in talking through the approach to a problem.
  2. Having a Navigator eases the workload
    A common issue that new developers often run into is looking for syntax or language-specific methods. Not only do you have to write code, but you also have to figure out how to write it syntactically correct. As you may have seen, JavaScript has a lot of syntax, so having a Navigator makes this process more manageable!
  3. Confidence and Affirmation
    The same thing can apply to programming. When you pair program, you get instant face-to-face instruction, which is much better than online tutorials and faster than looking for resources on the Internet. Your partner will be able to help confirm your decisions, so that you can both move more confidently in the right direction. It would allow programmers to 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.
  4. Code Quality
    With pairing, it is like having somebody review your code instantly and regularly. It is a higher form of code reviews. It increases the code quality, lowers the risk of errors and bugs, more research is done and better syntax is used, and more care will be taken with what is written. Fewer mistakes are introduced into your code because a lot of errors are caught as they are being typed. This level of continuous code reviews gives rise to fewer bugs in your code.
  5. Verbalizing Your Thoughts
    The ability to communicate what you’re thinking is a learned skill that will help you in the real world when it comes to technical interviews and working on a dev team. Pairing will force you to take the gibberish in your head and form it into a logical approach. This will be tough at first, but it will come more easily the more you practice it.
  6. Waste Less Time
    Better diffusion of knowledge among the team, in particular when a developer unfamiliar with a component is pairing with one who knows it much better.

Common Pitfalls, and How to Avoid Them

  1. Ego
    A big issue that can occur is when one programmer feels superior to the other. It is important to come into pair programming with an open mind and to take into consideration what the other person has to offer. The best programmers are good listeners and two heads are always better than one.
  2. Imposter Syndrome
    Do not let it faze you if your pair seemingly knows more than you! One person will naturally have a better grasp on what the assignment is asking, or the concepts at play. It’s likely that this dynamic will switch back and forth throughout the exercise, and keep in mind that your pair is still benefiting from having you as their Driver or Navigator.
  3. Blame
    Trust your partner! If things go wrong, there’s always a way to fix it. Start with small steps and move towards the larger idea rather than throw more code when it’s broken.

Resources

Pair Programming by Wikipedia

Pair Programming by Stackify

--

--