Pair Programming

This is the way it works: every time anyone in the team needs to develop something, whatever it is, she does it in pairs. This means that two developers sit together and work to solve the same problem. Having done it for some time, and being the coacher of a team that does it, bellow are some considerations about this subject.

With pair programming, we put in practice the principle of “Collective Code Ownership” – which means that there is no such thing as an owner for any part of the project’s code or related artifacts. This is mainly possible because the developer is not coding alone. She always (or almost always) has someone else working together on the same code, on the same functionality.

As it is said, “Two heads are better then one”. Pair programming is a practice where math doesn’t work quite well because 1 + 1 > 2 here. This means that the value created by two programmers working together is greater than the one created by each of them separately and then summed up.

Pair programming also brings a lot of other benefits, both for the project and for the developers involved. For instance, the code quality rises. It gets better design and fewer bugs that it would end up having if it was developed by a single programmer. And the code ends up getting reviewed all the time.

On the other hand, despite maybe being counter-intuitive, the productivity also rises. Two people together can find a better solution for a problem much faster. How many times have you asked for an opinion from a co-worker that helped you with that terrible problem quickly? Now imagine that you have the co-worker available to help you all the time.

For the developer, pair programming is also great because it stimulates his professional growth. With pair programming, a developer has the chance to learn from its pair’s experience. At the same time, she also has the opportunity to transmit some knowledge. This learning is much faster than reading, for example. And as they say, teaching is the better way to learn.

Unfortunately, it is not always possible to do pair programming. A few things might prevent doing it:

  • you mighty be the only one developer in a small project;
  • there might be an odd number of developers (and thus someone must stay alone);
  • or, in the worst scenario, the company won’t allow you to do it.

Or maybe any other reason I can’t think up now. Anyway, it is always worth the effort trying to do pair programming so, if you can, go for it!

This entry was posted in agile and tagged , , . Bookmark the permalink.

3 Responses to Pair Programming

  1. Paulo Renato says:

    Thank you!
    I’ll check the link, seems interesting =)

  2. Pingback: Pair Programming as a Motivator « JCranky’s Blog!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s