::scr Extreme Programming's Pair Programming

Richard Clamp scr@thegestalt.org
Mon, 1 Oct 2001 13:13:18 +0100


On Mon, Oct 01, 2001 at 12:09:56PM +0100, Greg McCarroll wrote:
> * Richard Clamp (richardc@unixbeard.net) wrote:
> > So are you saying that a pair would be comprised of two snot-nosed
> > kids, or one newbie and a seasoned hacker, or something different
> > altogether?
> > 
> 
> i have no idea, i was hoping some of the members of the church
> of XPology could offer suggestions, however in their absense lets
> look at the combinations,

Let's baseline it a little, purely from my experience, a solo coder is
only likely to come up with the goods 50-60% percent of the time.[0]
This is why we do development in teams after all.

> 	newbie + newbie:
> 		definetly an improvement on newbie on its own,
> 		the assumption being that where one doesnt know
> 		how to do something, the other might know.
> 		i'd guestimate that you'd get 1.25*newbie productivity
> 		at 2*newbie cost (BAD VALUE)

By my sums that's a break even.

> 	newbie + seasoned:
> 		in reality the seasoned programmer will occupy the
> 		keyboard 75% of the time (if not its probably even
> 		less productive), this will end up with a 
> 		0.25*newbie + 0.75*seasoned result, and some training
> 		by product, however the training by product will
> 		be incredibly poor compared to GOOD training courses
> 		(BAD VALUE)

This is the most typical way you'll do it, since pretty much everyone
is a newbie at something.  You pair with someone who can help get your
task(s) complete, so one afternoon you'll be the newbie SQL guy and the
seasoned C hacker.

Even if the seasoned programmer is typing 100% of the time the newbie
will be asking useful questions (why like that?) and spotting glitches
throughout.  The resulting code will be clearer, doing everyone a
favour in maintenance.  Shared code ownership wins too, especially
when the pairs switch often.

> 	seasoned + seasoned:
> 		they will argue over interesting problems and probably
> 		quite enjoy the banter, but at best this is gonna give
> 		you 1*seasoned as value (BAD VALUE)

No, both have a job to do, and they keep each other honest in the code
they write.  One spots the bugs the other is writing very quickly.

The other tenets of XP[1] come in useful in settling arguments, but every
software dev team needs to solve that one too.

> so imho, its all bad.

It's not as wonderful as an initiate member of the church may try and
tell you, but I don't think it's quite the losing sum I think you're
shooting at either.


[0] A newbie will likely work very hard, but not very smart.  The
seasoned programmer will tend to spend a lot of time exploring fun
ways to do things.  Call me cynical if you like, but that's what I've
seen.

[1] I'm thinking mostly of "Write the simplest thing possible that
works" here, though there are others that overlap quite nicely.

-- 
Richard Clamp <richardc@unixbeard.net>