Base types, Collections, Diagnostics, IO, RegEx…
The BCL Team has put together a survey about Code Contracts. We're trying to get data about how people are using the feature to help us figure out where to invest in further development. Even if you haven't used Code Contracts yet, your answers would be quite helpful. We have a few questions to help us determine the main reasons people haven't tried the feature. If you have a few minutes to spare, the survey can be found here: http://codecontracts.questionpro.com.
Thanks in advance for your help.
you got to try it
The survey workflow does not make sense. It asks if I use Code Contracts. I say No. Then it ask why and I tell why. It then asks how much time I save using it! How am I supposed to answer that if I'm not using it yet?
I have downloaded it and have plans to use it when an opportunity to do so appears. I'm interested on using it to make explicit pre and post conditions, documentation and to use it together with Pex.
Some questions don't make sense, for example how much time do I spend on annotating methods with contracts. It depends on the size of the project actually.
But go ahead guys, I can't wait for you to release Code Contracts
I was giving a talk about code contracts this week and got a question I wasn't sure how to answer.
When you compile in debug, all the ContractRuntime goo is injected into the IL, but when you compile in Release it is all removed.
So the question I received was whether or not to do
if(x == null) throw new ArgumentNullException("x");
or Contract.Requires(x != null);
Is it safe to do contract.requires because you would still want that null check at runtime wouldn' t you? I could see that especially if you were building something that would be consumed by 3rd party.
Perhaps an option to still emit the .Requires checks in a release build? or at least convert to the if(x == null) syntax?
It's great that the survey also asks us about our (non-code contract) priorities. I *really* hope that this list isn't the main shortlist of features for the next version of Visual Studio.
Please, please review the feedback people are providing on Connect. For example in the top 5 VS/.NET requests:
and specifically for code contracts:
and specifically for the BCL: