Pair Programming, the Twins that Solved Maintenance
What do you call a review session that has continuous code reviews, builds teamwork, implements cross-training and coaching, improves the writing of codes, and do refactoring at the same time. What great savings in time, money, and effort it would have a project. This review is actually a development technique. It is a review during development and it is called Pair Programming.
Pair programming is a technique in which two programmers work simultaneously at a single computer and continuously review each others’ work. Although many programmers were introduced to pair programming as a part of Extreme Programming, it is a practice that can be valuable in any development environment. Pair programming improves the organization by ensuring that at least two programmers are able to maintain any piece of the software. Pair programming also helps programmers’ professional development, because they learn from each other.
Pair programming is like having a continuous code review, without the extra time or effort of holding individual code reviews. It encourages a redundancy among the team members, and everyone is cross-trained on various parts of the code. Junior people can more quickly learn directly from senior people when they are paired together. While it may seem that assigning two people to a single programming task could be inefficient, in fact, productivity often increases. It takes somewhat less time to perform each task, as there are often gaps where one person is “tapped out” and the other can take over. More importantly, the resulting code is of very high quality, so there are far fewer mistakes to go back and fix.
One useful benefit of pair programming is that people tend to write better code when they know that someone else will be reading it. They cut fewer corners, spend more time making the code readable, are more likely to include comments where necessary, and refactor more often.
In pair programming, two programmers sit at one computer to write code. Sometimes they share a single keyboard and mouse, although it is possible to get special hardware or cables that allow each programmer to have his own. Generally, one programmer will take control and write code, while the other watches and advises. But different pairs of people may discover their own dynamic: for example, some pairs will take turns at the keyboard, while others will designate one person as the typist (if one person types significantly faster than the other).