Monday, December 7, 2009

Pair Programming : My Experience (Take 1)



Why Pair?
If our projects are behind ,then how would two developers with two keyboards and one monitor speed up things?

How expensive would it be to rewrite the entire application later? .Pairing gives instant and immediate feedback.If it smells we throw it away.





Coming from a different domain , i could write my first piece of production code  right on day one when i paired with my teammate who is a domain expert.When it comes to the subject matter everyone brings something to the table.My web services knowledge when combined with the different technologies/processes knowledge of my pair,we had a working prototype on day two.

How?
All you need is 2 keyboards a monitor and off-course a CPU.While he was coding i could refactor or write tests.While one of us is coding one can think about the big picture.




We use the pomodoro technique running a 25 min tomato.We are planning to replace the tomato with a lemon soon . It might sound funny , but its productive as everything is timeboxed.We strictly define what we are going to do in a pomodoro .And when the alarm/tomato goes off we lock the system and walk away to take a  3 min break and discuss what we have accomplished and plan for the next pomodoro.

Those short discussions save us a lot of time in situations where we are struck with a problem and  i do not have to try my idea/solution alone driving towards the end of the day before i call for help.


It is not a race,so if we want to stop our pair from running of with the keyboard we either throw a tape at him and take over the keyboard while he tries to catch the tape.
                               or
Use our yet to be patented pair programming grammer/language and say 'Potato'.The pair says 'mashed' and i can then take over.


Challenges..
 We all have different personalities and come from different social and cultural backgrounds/contexts which influence the way we work.And i once again feel that pairing is one way to learn more about those and influence without authority.

Here are a few rules that might come in handy along with some commonsense...
http://www.extremeprogramming.org/stories/pair.html

Coming soon...
 Rotating/Switching you pairs is one of the best ways you could communicate .When a large part  of the work we do depends on someone Else's work , why not work with them?.What if a developer who holds all the stocks of a particular piece of code goes on a vacation and never comes back?.So cross team paring and i am sure we need not reinvent anymore.And it also drives us closer to collective code ownership.

All this came from just my 5 weeks of pairing with the stars.In our case it was not two but three developers pairing?:).I can read your mind and it says awesome.So Stop thinking , Start pairing!!

"Be the change you want to see in the world" - Mahatma Gandhi