I really like code contracts as a tool, but there are two major issues that I think need to be resolved before code contracts will be included as part of visual studio:
- The options pane needs a lot of work. Many options are advanced and some of the basic options are presented in a confusing way. What is "Custom Parameter Validation" and how does it differ from "Standard Contract Requires"? Why would I want to use a "Custom
Rewriter Method"? What is the effect of having "Disjunctive Requires"? What's the purpose of building a "Contract Reference Assembly"? Advanced and fine grained options should be hidden in a dialog, and the effects of basic options should be very clear from
their name and description.
- Practical usability issues and bugs have to be resolved, resolved much faster, and prevented in the first place. Every time I download a new version of code contracts I feel like I'm gambling on something breaking. Many versions, including the current
one, have prevented me from signing assemblies. None have yet dealt correctly with VB code that uses events, despite many issues related to that problem being reported. Even if an issue is fixed, releases are so far apart that it's easy to give up on using
code contracts for months at a time.
Basically what I'm saying is to spend time/budget improving the user experience.