
9 tips for increasing the effectiveness of pair programming
Hello, Habr! In our work, we use pair programming and today we want to share with the community tips that help us increase the effectiveness of this method.

When pair programming, two programmers solve the problem by joint efforts, sitting shoulder to shoulder at each other at the same computer. The first acts as a “driver”, which prints the code on the keyboard, and the second serves as a “navigator” - he makes sure that there are no errors in the program, he designs the code, plans a sequence of actions and thinks about the correct coding on a strategic scale. This development method allows you to maintain a higher concentration, encourages you to carefully think out a solution before it is implemented, and significantly reduces the number of errors and improves the quality of the code.
Pair programming has a number of advantages:
To take advantage of the benefits of pair programming even more, you need to follow a few simple rules:
Pair programming is ineffective if members of the couple spend time arguing about the coding style. To avoid disagreements, it is necessary to standardize the “non-essential attributes” of programming so that developers can focus on the “essential” task before them and not be distracted by the coordination of styles.
Pair programming is a joint work, but not the observation of one developer after another. A programmer who is not directly involved in writing code should take an active part in the development: analyze the code, plan the next step, evaluate the draft program as a whole, think about how to conduct testing, etc.
In most companies using pair programming, they finally conclude that in pairs it is better to perform not all, but only some parts of the work. With the implementation of simple code fragments, the developer will cope more efficiently on his own. In addition, in some cases, it is more profitable to devote 15 minutes to the detailed design on the board to write the most complex code, and then program one by one.
As with other collaborative development techniques, one of the main advantages of pair programming is that each of the developers studies different parts of the system. A regular change in the composition of the pairs helps to stimulate the exchange of experience and knowledge between all team members. Some experts recommend changing the composition of the pairs daily.
When one of the partners works too fast, the second has to try to keep up with its pace, which reduces the quality of code analysis. In this case, pair programming does not perform the desired function and begins to lose meaning. A member of a pair with a higher speed should slow down, or the pair must be broken and reorganized in a different composition.
Make sure that both developers understand the code well on the screen. Incorrect monitor positioning or too small print can reduce the effectiveness of pair programming.
Do not forget about ergonomics - when you transfer the keyboard from one member of the pair to another, it remains in the center of the table and everyone has to bend over, both will quickly get tired and begin to lose concentration.
As in other joint tasks, the better the relationship between the members of the couple and the more they match each other in character, the higher will be the effectiveness of the work. The effectiveness of pair programming depends on how well the developers get along with each other, so it’s pointless to pair people who don’t have a very good relationship.
The maximum benefit from pair programming can be obtained if at least one of the developers in the pair already had experience in pair programming and can teach the second.
When all team members want to complete all the tasks using programming in pairs, select the person responsible for the task distribution and control of the project results.
Do you use pair programming? Share your secrets in the comments!

When pair programming, two programmers solve the problem by joint efforts, sitting shoulder to shoulder at each other at the same computer. The first acts as a “driver”, which prints the code on the keyboard, and the second serves as a “navigator” - he makes sure that there are no errors in the program, he designs the code, plans a sequence of actions and thinks about the correct coding on a strategic scale. This development method allows you to maintain a higher concentration, encourages you to carefully think out a solution before it is implemented, and significantly reduces the number of errors and improves the quality of the code.
Why do we use pair programming in our work?
Pair programming has a number of advantages:
- Compared to single-user programming, it allows programmers to better withstand stress. Members of the couple encourage each other to maintain high quality code even in stressful conditions, when there may be a desire to write "dirty" code to speed up the task.
- Pair programming improves the quality of the code due to the fact that the observer constantly checks, monitors the quality and comprehensibility of the code and asks clarifying questions. Thus, the readability and comprehensibility of the code of all developers are increased to the level of the code of the best programmer of the group.
- Pair programming accelerates system development. As a rule, couples write code faster, and most errors can be detected immediately in the coding process, rather than testing. Accordingly, at the end of the project, the group has to spend much less time fixing defects.
- Pair programming enhances teamwork. While working on a project, it is recommended that the couple be mixed so that each developer in the team by the time the project ends has a deep knowledge of each of its parts.
- Pair programming provides all the other common benefits of collaborative design, such as spreading a corporate culture, training novice programmers, and promoting shared ownership of work results.
How to make pair programming more successful
To take advantage of the benefits of pair programming even more, you need to follow a few simple rules:
No. 1. Support pair programming with coding standards
Pair programming is ineffective if members of the couple spend time arguing about the coding style. To avoid disagreements, it is necessary to standardize the “non-essential attributes” of programming so that developers can focus on the “essential” task before them and not be distracted by the coordination of styles.
No. 2. Do not turn pair programming into observation
Pair programming is a joint work, but not the observation of one developer after another. A programmer who is not directly involved in writing code should take an active part in the development: analyze the code, plan the next step, evaluate the draft program as a whole, think about how to conduct testing, etc.
No. 3. Define tasks that are appropriate to solve in pairs
In most companies using pair programming, they finally conclude that in pairs it is better to perform not all, but only some parts of the work. With the implementation of simple code fragments, the developer will cope more efficiently on his own. In addition, in some cases, it is more profitable to devote 15 minutes to the detailed design on the board to write the most complex code, and then program one by one.
Number 4. Constantly change the composition of pairs and the tasks assigned to them
As with other collaborative development techniques, one of the main advantages of pair programming is that each of the developers studies different parts of the system. A regular change in the composition of the pairs helps to stimulate the exchange of experience and knowledge between all team members. Some experts recommend changing the composition of the pairs daily.
No. 5. Try to pair people at the same pace
When one of the partners works too fast, the second has to try to keep up with its pace, which reduces the quality of code analysis. In this case, pair programming does not perform the desired function and begins to lose meaning. A member of a pair with a higher speed should slow down, or the pair must be broken and reorganized in a different composition.
No. 6. Both members of the couple should see the screen well
Make sure that both developers understand the code well on the screen. Incorrect monitor positioning or too small print can reduce the effectiveness of pair programming.
Do not forget about ergonomics - when you transfer the keyboard from one member of the pair to another, it remains in the center of the table and everyone has to bend over, both will quickly get tired and begin to lose concentration.
Number 7. Do not pair people who do not like each other
As in other joint tasks, the better the relationship between the members of the couple and the more they match each other in character, the higher will be the effectiveness of the work. The effectiveness of pair programming depends on how well the developers get along with each other, so it’s pointless to pair people who don’t have a very good relationship.
Number 8. Do not make a couple of people who previously did not have experience in pair programming
The maximum benefit from pair programming can be obtained if at least one of the developers in the pair already had experience in pair programming and can teach the second.
No. 9. Choose a group leader
When all team members want to complete all the tasks using programming in pairs, select the person responsible for the task distribution and control of the project results.
Do you use pair programming? Share your secrets in the comments!