Feed on
Posts
Comments

With the public release of Visual Studio 2008 this month, .NET 3.5 and particular C# 3.0 is released to the broad public. This does mean that the new functionality will be exposed a lot. And I guess Extension Methods will be the most used functionality.
I’m actually not 100% happy with this language extension. Of course we all do know its tried over and over by many beta testers and language fanatics. It does allow you a lot of flexibility. But hey, what about class coupling?

Lately I’ve been involved in many research and study projects which used the highest standards on architecture and code guidelines. This meant that all models where heavily tested by many metrics. We’ve been trough all kind of metrics and later on, while developing again. I found out that Extension Methods can become very dangerous. With a namespace such as System.Linq, you have totally no notion about class coupling. And later on, when you’re going to write some Extension Methods by yourself, you totally forget about the complexibility you’re introducing on top of objects.

For all you guys who are considering using this option heavily, make sure you know what you do. You’re creating lots of cross concerns over your code. And it does not always make your code better. Or at least the metrics say it doesn’t. And I do know that metrics aren’t laws, but they do say something.
A last suggestion: keep on using util-classes rather then extension methods, they are still very usable and they do make sure you’re backwards compatible. At least your interfaces are.

For those who want to work with the latest bits available, take a look at the Early Acces Program of Resharper 4. Their program manager announced it last week. But make sure you read these notes.

Leave a Reply