Matt Casto's .NET Journal RSS 2.0
 Friday, February 29, 2008
I just got into a nerd fight with another developer on my team about which style of LINQ join syntax looks better.

Normally I wouldn't be one to get too worked up about syntax differences like this, but in this case my code was changed from one to the other for no reason other than "I don't like the way your wrote it."

Which do you prefer?



or


Friday, February 29, 2008 3:29:42 PM (Eastern Standard Time, UTC-05:00)  #    Comments [10] -
programming
 Wednesday, November 21, 2007
Jeff Atwood's recent post Pair Programming vs. Code Reviews reminded me that I should post about my recent experience pair coding.

I spent the majority of the last three weeks pair programming with a co-worker rebuilding a UI framework that we've used before but lost the source code.  In my opinion, this was a perfect opportunity to try out pair coding.  We had two people remembering what types of things we did before, and what kinds of problems we encountered and wanted to avoid.

The thing that most suprised me about pair coding was how intense it was.  It was impossible to get distracted because the other person is there keeping you focused.  It was pretty exhausting compared to a normal day.  The best word I can think of is relentless.

Also, the quality of what we built is so much higher than I could have accomplished in the same amount of time.  I definitely think that the work we did was better than what we could have done working alone.  My partner saved me from writing so many bugs that I had no idea I was doing.  Granted, most of these would have been found by the compiler or the first time we tried to run, but I think it saved a lot of time.

Perhaps the best part of this period of pair programming is that I know everything that we did, not only my half of what was done if we had been working separately.  This was a key part of the situation because my co-worker had put his 2 weeks notice in.  I only hope I have a chance to work with him again.

Would I do it again?  You bet!  I now have no doubt that two developers can get just as much work done together that they could have done separately, and I think the quality is much better!

Wednesday, November 21, 2007 12:48:14 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -
programming
 Friday, October 20, 2006
I'm working on a new project where I laid out the class structure in ArgoUML and generated the C# code. This was my first time using ArgoUML and I found that I didn't like the generated code that much, and had a lot of changes to make. One such change was to refactor my public members into private members exposed by public properties. In Visual Studio 2005 this is no problem with the built in refactoring. This project, however, needs to use the 1.1 .NET framework, so I'm stuck using Visual Studio 2003. So I resorted to Find & Replace using Regular Expressions.

The regular expression used for the Find:
^{:b*}public {:a+} {:a+};


And the expression used for the Replace:
\1public \2 \3\n\1{\n\1\tget { return m_\3; }\n\1\tset { m_\3 = value; }\n\1}\n\1private \2 m_\3;


This results in code like this
public string Name;
being replaced with this
public string Name
{
   get { return m_Name; }
   set { m_Name = value; }
}
private string m_Name;

I suppose it would be a little better to somehow replace the capital first letter in the private member with a lower case equivalent, but it's not really that big of a deal ... at least, not big enough to spend more time on this task.

Edit: I need to come up with a better format for posting code.

Labels: ,

Friday, October 20, 2006 9:12:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
programming | regex
Central Ohio Day of .NET

About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Matt Casto
Sign In
All Content © 2008, Matt Casto
Theme based on DasBlog theme 'Business' created by Christoph De Baene (delarou)