Pair programming
March 18th 2007
A common programming technique I've used with great success trough out the years is pair programming. I assume most of the readers of this blog know what pair programming is, but incase any of my non-programming friends read this blog par programming is exactly what the term says: two programmers working on the same code, on the same computer.
The two programmers have different "roles" when doing pair programming. The programmer controlling the mouse and the keyboard is the "driver", and is doing the actual programming. He's taking all the immediate decisions, like how to structure the code, how to write the if's and else's, what to name the variables etc, just like the driver of a car is making decisions like which lane to use, how to turn etc. The other programmer is the "navigator" looking ahead and planning what to implement next, and overlooking the overall structure of the code. When the programmers reach some kind of "milestone", such as completing a class or implementing some kind of functionality the programmers change role.
Pair programming have several advantages, such as:
- Higher quality of the code (two people on the same problem)
- Transfer knowledge from one programmer to the other
- Higher productivity. When you're coding with some one you don't waste time on Engadget or Gizmodo.
I haven't blogged too much about my work related projects, but currently I'm working on a project at HEMIT (the company in charge of all the IT systems in the health region). The project is about turning an internal application into a full blown product they can sell to other health regions and hospitals as well. The major part of the project is about decoupling the system and eliminating dependencies on systems that are only available in the middle Norway health region, so that we can implement providers for systems used elsewhere.
We're currently three developers working on the project, and we've been using pair programming a lot. This Thursday we took pair programming o the next level by connecting two mice and keyboards and two 19" monitors to the same laptop. This way we can easily switch roles, and we don't need to rub shoulders while programming. The laptop didn't have any problems handling multiple mouse/keyboards, and it worked out really well. There are also some code editors allowing two developers to work on the same source file remotly (remote pair programming). This way you can do pair programming remotely. I don't think there are any Visual Studio plug-ins giving you this functionality, but if you know of one drop me a comment.