I have been looking at DbC lately and Spec# which seem to have support for non nullable objects. Unfortunately Spec# seem to have been abandoned.
I don't see the problems with having features like this built in to the language. Could anybody enlighten me on this?
Have you seen the new Contracts framework will will be part of .NET 4.0?
The benefit of making it a library rather than language feature is that it becomes immediately available in all languages, with no work on the part of the language teams. Obviously there are disadvantages too...
Links:
Having said all that, I'd like to be able to write:
public Stream! Foo(string! x)
as well, indicating that Foo must not receive a null reference, nor will it return one. Having an extra bit of syntax for just that type of contract would be handy, I think.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With