Under the hood and working with .Net, TDD, Software Design, and Agile Stuff
Never let it be said that I can't say something nice about a Microsoft product. I'm not enthusiastic about VS2008 itself until ReSharper 4.0 is here and stable, but the new language features rock! I haven't even touched any of the LINQ dialects yet, but all those little features that Anders and co added to support LINQ are already making my life easier.
- Extension Methods: I'm mostly using Bellware's nunit-spec extensions for RSpec-style assertions in unit tests like someObject.SomeMethod().ShouldEqual(expected); I've also used them very sparingly to extend a fluent interface from an external assembly. It's working, but let's call that an experiment in progress
- Object Initializers: These make test data setup code soooo much more compact. Especially the initializers for collections. As silly as it sounds, I'd almost call this the single best thing about .Net 3.5 just because of the mechanical savings.
- Lambda Expressions: Besides being so much tighter than anonymous delegates, I'm digging the ability to get at the expression tree. My old MicroControllers idea in C# 3.0 looks like this: _binder.Bind(x => x.QuoteDate).To(quoteDateField).WithLabel(quoteDateLabel); See the little Lambda trick in bold? Gotta love the compiler safe reflection goodness. The tighter syntax is also making it easier to utilize some functional-lite programming that cuts down on code here and there.
What do you like about C# 3? What are you doing that wasn't possible in C# 2?
About Jeremy D. Miller
Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#.