What is Pair Programming

Pair Programming is an interesting technique of Agile Software Development. It means to program the code in pair, i.e. two programmers work on an assignment together. One writes the code, and other think the code. One who Writes Code is called Driver, who has the steering wheel in hand i.e. the keyboard. Other who Think the Code, is called Navigator or Observer. Navigator means who helps in navigation, who shows the path, who see the good or bad road ahead and also try to find the right path to move on. One who observe the every proceeding and provide a helping hand by discussing the observations for right implementation.

What does it mean to think the code? Isn't coding about typing the programming constructs in some specific language? You should be good with that language and then write the program. Isn't that all? Probably Not.

Writing something is not all about writing. It would involve much more than writing. Suppose you are writing an article in newspaper. Whatever language you use, writing this article means first to think what to write, from where to start, what to put in for right message, and right impact. It may require a lot of research, analysis and understanding of the desired topic. It may requires a lot of brainstorming also before finalizing what to write. It may need consultation with other experienced hand. Then it would need the drafting and editing or the written matter.

Similarly writing the software program is also not only about writing the code. It means much more, many things as we have written above for a new article and probably something more specific. This is what we call "Think the Code". And this is where a Navigator or Observer helps in, by doing all such things in parallel while writing the code.

We might have used pair programming one or other time while following any of the software development techniques. We (two developers) may prefer to sit together to write a piece of software. It happens sometimes when we find any part very complex, or quite vast in concepts, tricky or might be having many integration to control and so on. And we follow the same things as we mentioned above. One write the code, and other keeps thinking what should we write considering the bigger picture of the problem. One focuses on complexities of writing the code using language constructs, and other focuses on complexities of design and integration of code. So pair programming is not started with Agile Software Development only; but it is an important step of being Agile.

In this article, we shall discuss what Extreme Programming states about pair programming. It advocates the development of most of the production code in pairs. Reason is all about its benefits as we described briefly above. In more details, these are: