I have to ask you this, Tom, since you are (I believe) an agile proponent.
I have indeed proponed it in the past, and i suppose it's my duty to step
up again here!
The situation here seems to be a breakdown of the agile philosophy. If I
have the terminology straight here, a navigator imposed an incorrect (or
at the very least, obscure) design decision on a driver - not once, but
twice. If this is actually the way agile is supposed to work - that the
navigator has the final say - for me that's a showstopper.
To be fair, I don't think agile is supposed to work like this. I would
have thought that the driver, as the active coder, could require the
navigator to explain why they wished to make a change.
Firstly, i should say that i don't know what the chapter-and-verse party
line on this is.
My understanding of pair programming has always been that decisions are
made by consensus - if you disagree over the way to do something, you stop
and discuss it until you reach agreement. Having a coding standard stops
you arguing about trivial things like where to put braces. Having and
writing unit tests stops you arguing about whether something will work or
not - you can try it, and find out. The "do the simplest thing that could
possibly work" and "refactor mercilessly" principles mean that you can at
least defer arguing about design - when you disagree on something, pick
the option which is simplest right now, and if you run into trouble
because of it, you can come back and fix it.
However, clearly, there will be times when you have a disagreement on
which you don't reach an honest consensus, and you need a method to
resolve that. I don't think having a rule that the driver always decides,
or that the navigator always decides, is helpful, because who is driver at
any point can be pretty arbitrary. Equally, i think it would be corrosive
to go by seniority and let the ranking programmer make the decision. Any
of those rules would undermine the need for consensus.
I'm trying to think how this had been dealt with when i've been pairing. I
think the key thing is that both members of the pair should approach the
enterprise in good faith: that means being prepared to take time to
explain your ideas to the other person, and to take their criticism on
board, but also being prepared to give your partner's ideas the benefit of
the doubt. And sometimes, swallowing your pride and letting the other guy
have his way even though you think he's wrong - knowing that if he is,
you'll find out soon enough. If you have one or two people who can't do
that, then i don't think there's much hope for them pair programming.
This week, we were tackling a story about having a tool to do some
analysis of JSPs. The first step is to parse the JSP. To me, it was
obvious that we should reuse the parser from an existing JSP engine,
adapting it to our needs; my partner (who is much more senior than me -
and that could mean either more expert or more stuck in his ways, as you
prefer!) told me he thought that was a waste of time, and that we should
hand-write a recursive-descent parser from scratch. We argued briefly,
then he agreed to humour me, and we set about hooking into Jasper's
parser. After half a day, we'd discovered that (a) Jasper's parser is a
complete pain to use outside of the rest of Jasper, and (b) although it
parsed the JSP-specific stuff, it did nothing to help us parse the HTML in
the pages, which we also needed to do. I then admitted that i'd been
wrong, and we adopted the handwritten parser strategy. Another half a day
later, we had a parser that handled enough JSP and HTML to do what we
needed (HTML/JSP actually being a pretty simple syntax). Is there a lesson
here? There was give and take in both directions, and ultimately, it was
the code that made the decision - one approach worked, one didn't.
tom