A Guide to Pair Programming */?> A Guide to Pair ProgrammingApril 10, 2016 6:08 am ·
Pair programming is an agile software development technique in which two developers work on the same block of code in tandem. The developers take on one of two roles – the Driver and the Navigator – and switch back and forth throughout the duration of the project. The Driver is responsible for actively writing code while the Navigator observes and focuses on the strategy and bigger picture.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
It’s a hard sell to convince some managers to dedicate double the scarce programming resources to such a practice, especially since it can be seen as a waste of resources at first glance. The real truth is, pair programming can take an average of 15% longer, yet results in 15% fewer mistakes1, drastically improving your bottom line. In the end, your QA team and users will thank you for dedicating the extra resources up front.
Why use pair programming?
Why Two Heads Are Better Than One
Collaboration in the workplace is far from a revolutionary idea, but in a field where folks are typically encouraged to work independently, it can be a challenge for two programmers to team up. When they do, it requires constant communication and presents an instant feedback loop, which often results in more innovative thinking.2
A natural byproduct of this feedback loop is the skill sharing that occurs between team members. Junior developers learn the more complex systems by teaming up with a senior programmer, and those with plenty of experience can benefit from sharing ideas with their peers. Ultimately, the resulting code is just better.3
Solve Problems Faster
With the demand for instant information on the rise, solving problems quickly and efficiently is of increasing importance. Pair programming not only helps to prevent errors and bugs from happening in the first place, but helps teams work through issues with code together to help expedite the problem-solving process.
Leverage Remote Connections
Using freelancers and remote programmers is becoming the norm for many technology companies. One study shows that 40% of America’s workforce will consist of independent contractors by 20204, and that doesn’t even take into account remote full-time employees.
With instant online collaboration tools like Live by Experts Exchange, you can use the whiteboard to stay connected to your team and use pair programming to complete projects and find solutions to your toughest problems, regardless of location.
Communicate Openly and Often
To be most effective with pair programming, it’s important to think out loud. Talk through what you’re doing and where you’re going next. Articulating thoughts aloud and talking through the process not only helps to identify problems but often forces the simplification of code. This simplified code can often make it easier to build upon and share in the future.
Things to Do
- Be present. Put your phones away, eliminate distractions, and focus on the task at hand.
- Check your ego. It’s not a competition, you’re working together.
- Take breaks. If it’s a big project, don’t be afraid to hit the pause button and come back to it after a brief interlude. Just remember that time is money!
Things to Avoid
- Silence. Remember that previous bit about thinking out loud? Yeah, do that.
- Monopoly. Be sure to switch roles often in order to maintain a fresh perspective.
- Lack of planning. Take five minutes to set a goal, and carve out enough time to accomplish it.
Pair programming can be a beautiful and effective thing when done correctly. The benefits of this type of collaboration far outnumber the cost of teaming up with a peer, and can be much more fun than going at it alone.