I'm late to the party: C# 3.0 rocks

I know this is lame, but whatever. In my day job we haven't jumped beyond .NET v2.0, which I think is reasonable. In my own part-time self-employment projects, I haven't really developed anything new either, at least not on the server side of things.

But today I endeavored to rewrite the private message system in POP Forums because I thought it sucked. It just wasn't logical. After considering WWFBD, I started fresh. With the just-posted beta of ReSharper also installed, I went at it. Between the suggestions that ReSharper was making and my own ideas, I'm shocked at how much less code there is.

The big immediate and obvious savings are of course auto properties. Using lambda expressions in the predicates for some of the generic List methods is so much cleaner. ReSharper suggested using an object initializer in a couple of places, which further reduced code clutter.

Is there anything ground breaking that I'm doing? No. Could I have done things the old way? Yep. Am I a lot happier with the readability of the code? Absolutely!

This is why I need to be doing work that is always looking forward, so I can have these fun gee-whiz moments more frequently.

The Mothership recently called me and wants me to visit... so perhaps I'll get that chance soon! ;)
 

No Comments