Let The Junior Drive

CategoryPattern

Forces:

Technique: The junior programmer drives while the senior programmer navigates. The senior programmer describes what needs to be done and the junior programmer does it. The two alternate between coding tasks regularily. If necessary, Senior describes keystrokes, and Junior types them. This is for MuscleMemory, and to keep the alternating going.

Per PairPromiscuously, Senior & Junior do not need to do this very long; a couple hours is good.

When Senior thinks of an operation, she should relate it to Junior's experience on this scale:

Senior operates the GoalStack.

Result:


LetTheJuniorTdd

For some strange reason, the schools _still_ are not teaching TestDrivenDevelopment. Give them another decade.

Until then, Senior is probably more likely to think of the next test case. She should reinforce ArrangeActAssert/AssembleActivateAssert, then sketch it like this:

 def test_frim_fram_the_frob
   #  whip out a frim test resource*
   #  whip out a fram test resource
   #  assemble them together
   #  activate their frob
   #  assert the result is what we expect
 end

The last comment is not periphrasis. Junior should replace each line with real test code (testing and integrating after each line), and then _Junior_ should try to figure out what to assert.

The point is that test cases often evert program logic, and Juniors typically have not learned to set them up. After the hard work, then figuring out what to assert reinforces Junior's mental model of the code's situation.

* a Rails "fixture"...


How to do it Wrong:

Remedies: Known Uses: Related Discussion: Testimonials: Anti-testimonials:
If any side of the pair is not learning anything, the chances are they aren't doing it right. The key point in RecordYourCommunicationInTheCode is that both the pair actively participates in building up the question/answer pair into the source code, and then distilling DocumentMode version -- removing the further chance of anyone seeing the code not understand and question any bit, by improving the quality of the code during the PairProgramming. --JuneKim

So we switched, and I ended up explaining to him things like RefactorMercilessly or how to implement IteratorPattern. I'm not complaining; I was happy to tutor him. But that's what it was, tutoring, rather than creating software. And when I was on a roll, it sometimes was frustrating because I'd have to break my train of thought in order to explain something, stammering all the way. Again, I'm not complaining, but if PairProgramming increases productivity, this ain't it.

We finally ended up working separately, I on the broader architecture, solving a problem the first time, generating reusable library code in the process; and he on implementing specific features that were variations on what we'd already done, building on what already existed. I still had to explain to him what I had done, and I still helped him from time to time understand how to extend the concepts. But we got more done this way than when we were PairProgramming.

We had much more success PairProgramming when we jointly authored a certain document. We each had similar knowledge of the domain. But we had different styles and experiences, and sitting at the same terminal, we could lever off of each other's background. Furthermore, when the driver stopped to fill in some aside, the other would regularly keep our joint train-of-thought (and thus our flow) alive. In short, it was everything PairProgramming claims to be.

My first experience with PairProgramming was many years before the practice had a name. I was collaborating on a joint project with an engineer of similar experience to my own. It was a productive and fondly remembered experience.

-- TimKing


Brent, is your friend just learning to program or are you working on a real project with a real deadline? I think maybe this will delineate when it is appropriate to use/not use LetTheJuniorDrive.


But see HowToPissOffYourPair, Guru division


EditText of this page (last edited February 18, 2009) or FindPage with title or text search