Wednesday, February 02, 2005

C# and Paired Programming

Over the weekend, my friend Ravi and I worked on an XML-based customer generation tool for this company we're contracting at (Sentinel Vision). We're doing it in C#, and I'm glad to be getting my feet wet in C# and .NET. I worked hard to break into the Java world (it's a great language), but had no breaks being hired by a company where I could write applets or distributed applications in a QA development environment. So while I'm no fan of MS, I like what I see with .NET/C# and hope to get more exposure.

Well, I don't want to get too sidetracked with discussing this programming environment. What I really wanted to talk about is an unplanned experience with paired programming. In the previous "Extreme Programming" blog posting, I mentioned that I didn't think this approach would work. Well, perhaps I was wrong. You see, Ravi and I were working at his computer. He programmed a bit, while I watched at his side, then I had a burst of energy and a few ideas, and said "let me get in there and drive for a while". So we switched seats and I programmed a bit. Ravi, being by far the more experienced programmer and possessing great alacrity, watched me code and gave some useful suggestions how to do it better. So I made the changes.

Then, he took over and coded away. I didn't correct any of his coding - there was nothing to correct! But I was able to spot other places in the program where the code segments, or similar coding, needed to be applied. So I got in there, and coded a bit more. Then I thought about some of the semantics of customer records, restrictions on what could be enabled and such. That gave me some inpetus to add those code segments. Then, Ravi thought about how we could do it better. And so we did.

Admittedly, one time, I was thinking how to solve a problem, and I told Ravi: "Don't tell me the answer". This was something we did in the Epstein household. I remember mom saying that a number of times: she wanted to remember something on her own. I've always liked to figure out solutions. In this case, I figured out half-of-it, then Ravi just jumped in and finished the job. So I only had 1/2 of the satisfaction I would have normally derived from getting the answer; but we saved some time. Of course, in this case, if the Ravster was programming by himself, he would have done it even faster.

Overall, this paired programming worked well for us. We didn't plan to engage in a "paired" exercise. It just happened, and it worked out for the best (on this occasion anyway).

1 Comments:

At Thu Feb 03, 11:58:00 PM PST, Anonymous Anonymous said...

I agree with most of what you put int he Blog.

But, in my opinion, it only works if there is a good working relationship between the people who are co-authoring. Even if one of them is more
aggressive than the other, it might not work in the long-term. There should be good understanding and sharing of knowledge to make it work.

In my previous job, the way we used to do XP is that the programmer writes the code or fixes a bug, and it is reviewed by his/her peer to make sure that the logic doesn't break other stuff. It is just another pair
of eyes making sure that changes went into the code are valid. It doesn't guarantee anything, but just double-checking the changes. This, in my opinion, is
a better way to handle XP.

 

Post a Comment

<< Home