www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - C# contracts video

reply bearophile <bearophileHUGS lycos.com> writes:
A long video presentation of C# contracts, "Compile-time Verification, It's Not
Just for Type Safety Any More" (Jul 05, 2011), by Greg Young (the speaker is
quite bombastic):
http://www.infoq.com/presentations/Contracts-Library

The compile-time error shown in the video at about 10 minutes and 40 seconds is
doable in D with this idea I've shown:
http://d.puremagic.com/issues/show_bug.cgi?id=5906

While the error shown from 11.45 requires something much better, as the
solver/inferencer used by them.

He says they are slowly adding contracts to all the dotnet framework.

He says (30 minutes 20 seconds) that most unittests become useless. The
compiler even says some certain unittests can't fail (after statically
verifying the contracts).

He says that all this stuff is still in its infancy (in dotnet, the Contracts
library itself, etc).

He says that the dynamic keyword and the contracts, both added to C#4, are
essentially one against each other.

Around 53.00 he explains the risks of overspecification in Contracts (that
cause problems similar to writing too many unittests), or adding too much
specific contracts to an interface, while they are fit for a single
implementation of it.

Bye,
bearophile
Jul 12 2011
parent reply Robert Clipsham <robert octarineparrot.com> writes:
On 13/07/2011 02:35, bearophile wrote:
 A long video presentation of C# contracts, "Compile-time Verification, It's
Not Just for Type Safety Any More" (Jul 05, 2011), by Greg Young (the speaker
is quite bombastic):
 http://www.infoq.com/presentations/Contracts-Library

 The compile-time error shown in the video at about 10 minutes and 40 seconds
is doable in D with this idea I've shown:
 http://d.puremagic.com/issues/show_bug.cgi?id=5906

 While the error shown from 11.45 requires something much better, as the
solver/inferencer used by them.

 He says they are slowly adding contracts to all the dotnet framework.

 He says (30 minutes 20 seconds) that most unittests become useless. The
compiler even says some certain unittests can't fail (after statically
verifying the contracts).

 He says that all this stuff is still in its infancy (in dotnet, the Contracts
library itself, etc).

 He says that the dynamic keyword and the contracts, both added to C#4, are
essentially one against each other.

 Around 53.00 he explains the risks of overspecification in Contracts (that
cause problems similar to writing too many unittests), or adding too much
specific contracts to an interface, while they are fit for a single
implementation of it.

 Bye,
 bearophile

Have C# contracts improved at all since I last used them? Last time I went near C# I was incredibly underwhelmed having used D. -- Robert http://octarineparrot.com/
Jul 13 2011
parent bearophile <bearophileHUGS lycos.com> writes:
Robert Clipsham:

 Have C# contracts improved at all since I last used them?

I think they have not improved them a lot, lately. Bye, bearophile
Jul 13 2011