4 ms·
I think you misunderstood me. What I meant was that contracts in a language like C# give me the ability to statically verify the program at compile time. It is
by MrDosu 12y ago
I think you misunderstood me.
What I meant was that contracts in a language like C# give me the ability to statically verify the program at compile time. It is not a "nicer way to add conditional testing logic" but a way to formally prove correctness in my programs.
- JoelMcCracken 12y agoIIUC, contracts are specifically for creating verifications at runtime. In some cases, sanity checking can happen up front/at compile time. In other cases, these must occur at runtime. The Pragmatic Programmer has a whole section on contracts; it is pretty good.