viernes, 7 de diciembre de 2012

Software creation using Collaboration(II): Pair programming

Sometimes we create a task and say: "Let's do it in pair programming".

Let's try to define the formal framework that defines what Pair Programming is, what it is not.

In general, when two programmers are doing pair programming, one programmer types in code at the keyboard and the other programmer watches for mistakes and thinks strategically about whether the code is correct.

Key points to success using Pair Programming

Don't waste time discussing code standards
It won't be effective if the pair spend the time arguing about coding style. It should be already defined so that programmers can focus on the "essential" task.



Don't let pair programming turn into watching
The person without the keyboard should be an active participant in the programming: analyzing the code, thinking ahead to what will be coded next, evaluating the design, planning,...

Pair programming is not for easy stuff
When a complex issue is dealt, what works best is to have a 15minutes whiteboard meeting and then to program solo. 

Regular work and pair rotation
Benefit arises when the pair rotate the assignments, that is, 30 minutes "driving", 30 minutes without the keyboard. Some experts also recommend changing pairs as often as daily.

Match each other's pace in the pair
One partner going too fast limits the benefit of having the pair. The faster needs to slow down, or the pair should be set up with different partners.

The two can see the monitor? 
It can look like an obvious thing, but sometimes we forget obviousness. E.g. are the fonts too small?

Avoid pairing people that doesn't like each other, avoid pairing all newbies
Some more obviousness: it's pointless to force people who don't get along, who have conflicts. Needless to say that one of the partners needs some experience in working in pairs and in the business.


Benefits of Pair Programming

  1. Pair programming holds better under stress. Pairs encourage each other to keep the code quality, to stay concentrated,... Helps to keep in step the ups and downs of the individuals. 
  2. Improves code quality: readability and understandability is improved.
  3. It shortens schedules: Pairs usually write code faster and with fewer errors. The team spend less hours fixing bugs. One somebody picks a bug, everybody knows what is going on.
  4. Other benefits arise from the culture and personal style exchange, mentoring of junior programmers, fostering collective ownership of the work.

Now we have a few things to say to your boss when he comes along to say why are you sitting in other work mate desks.
I'll try to follow these simple rules when we start doing pair programming. 



No hay comentarios:

Publicar un comentario