2 ms·
C# does have a feature called Code Contracts [0][1]. I haven't used them, and in my experience they aren't super popular. They look like mostly convenience for
by usea 9y ago
C# does have a feature called Code Contracts [0][1]. I haven't used them, and in my experience they aren't super popular. They look like mostly convenience for specifying when to throw, rather than as an alternative to throwing. There is some static capability, but I'm not sure what the extent of it is.
[0]: https://github.com/Microsoft/CodeContracts https://github.com/Microsoft/CodeContracts
[1]: https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/code-contracts https://docs.microsoft.com/en-us/dotnet/framework/debug-trac...