Code Contracts In .Net 4.0 - My initial thoughts

I just read about this new feature coming with .NET 4.0 this morning at work, linked from some blog in my reader.  After following a few links, I came to this one:

http://codebetter.com/blogs/matthew.podwysocki/archive/2008/11/08/code-contracts-and-net-4-0-spec-comes-alive.aspx
http://research.microsoft.com/en-us/projects/contracts/

In a nutshell, Code Contracts is Microsoft's Design By Contract (DbC) implementation. And it looks pretty cool.

Admittedly having only looked at it for about 20 minutes this morning, my initial thoughts are:

+ It's AWESOME that this library supports runtime checking.  That means if you have a piece of code like:

if (someObject == null) throw someException else { // do stuff};

you can replace it with:

CodeContract.RequiresAlways(someObject != null);

// do stuff

And if during compilation, the compiler notices a spot where null is being passed into the function, it will notify you with an error at compile time, rather than throwing an error when you run your code.  That's ESPECIALLY cool if you build them into a library that you release and let others use.  If they try to pass invalid objects into your library, they'll be notified when they compile.

+ The syntax is certainly cleaner than wrapping things in IF statements to check their state.  The code also communicates more clearly, in that regard.  It's easy to read what is expected in a function the way these contracts are written.

Now, the negatives:

- I still wish there was a better way to add these conditions to your code.  It's better than IF statements, but I still wish I could just write a clean function without having that in there so that ONLY the actions performed within the functon stood out.  Oh well, it's a step in the right direction.

- I think it could lull people into a false sense of security and away from unit testing, which is a slippery slope.  But a few articles I read made the case for using both complementary, as opposed to trying to tout the benefits of one over the other.

I'm going to look into it a bit more in my free time (I'm posting on my company's dime right now), but if anyone even knows my blog exists, I'd like your thoughts on this.  Is it worth using or not?