Pair programming is a programming method in which two people work together on a single program. The first person is the “Driver“, who writes the code, the other person is the “Navigator” who reviews each line of code as it is typed, checking for errors. They exchange their roles on a regular basis.
In the book “Pair Programming Illuminated”, Laurie Williams and Robert Kessler describe pair programming as a programming style in which two programmers work side by side on a computer, continually collaborating on the same design, algorithm, code, and test.
When a program is developed in a pair, the Navigator continuously inspects all the code that is produced. This continuous inspection is an opportunity to spot errors early and reduce defects in the finished product. This results in better collaboration, greater quality, better code, and sustained better development practices. It enables learning and sharing of information among developers, and in general, two people thinking about the same problem can create simpler and more effective solutions and scenarios. As the saying goes, ‘Two heads are better than one.’
Pair programming also contributes to the robustness of the team, because the constant exchange of roles and knowledge minimizes the impact the loss of a team member has on the team.
Some advantages of pair programming are as follows:
- Reduces Error – When there are 2 people in a team, they are more likely to do the right thing, since one person will review other person’s work.
- Better workflow and Focus – Attention and focus on the work will be stronger. They help each other, stay focused on their work and create a continuous flow of work. This flow is more resistant to interruptions because one person deals with the interruption while the other continues to work.
- Improves morale – Working collectively brings more satisfaction and recognition.
- Mutual and continuous learning – One individual teaches the other during the project, thus knowledge exchange is more efficient and faster.
- Team union – People know each other better when they work in pairs, creating strong synergy in the team.
In a survey conducted by the “Department of Software Engineering and Computer Science at Blekinge Institute of Technology – Sweden”, “96% of the pair programmers reported that they enjoyed working in a pair programming environment than working alone. “
If you have never tried pair programming activities on your team, it is worth a try. It makes work a lot more fun and facilitates better communication between the team. This is certainly a benefit, as anything that is done with satisfaction and diligence tends to increase productivity and yield better results.