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).