Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Code Contracts still the recommended way to go nowadays? #17640

Closed
weitzhandler opened this issue Mar 29, 2020 — with docs.microsoft.com · 9 comments
Closed

Is Code Contracts still the recommended way to go nowadays? #17640

weitzhandler opened this issue Mar 29, 2020 — with docs.microsoft.com · 9 comments
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-framework/svc Pri2 won't fix Issues that were closed as part of automated backlog grooming

Comments

Copy link
Contributor

Hi,

It's 2020, and I remember reading that code-contracts are obsolete or deprecated, is this true? Any better alternatives or news to know as of 2020?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@weitzhandler
Copy link
Contributor Author

weitzhandler commented Mar 29, 2020

I guess this comment answer my question, so I'm gonna close the issue.

@weitzhandler
Copy link
Contributor Author

Consider re-opening it, for the sake of updating the article referring or recommending readers to consider System.Diagnostics.CodeAnalysis attributes instead.

Copy link

How it would differ from test driven development then I see both serves same functionality at higher level

@weitzhandler
Copy link
Contributor Author

What's the current best recommended alternative to CC as of 2020?
Please see this StackExchange question.
Also my comment here: dotnet/runtime#23869 (comment).

@gewarren
Copy link
Contributor

Reopening to update the doc with the latest recommendations. Thanks for raising this concern, @weitzhandler .

@gewarren gewarren reopened this Mar 30, 2020
@gewarren gewarren added doc-enhancement Improve the current content [org][type][category] P2 and removed ⌚ Not Triaged Not triaged labels Mar 30, 2020
@wokhan
Copy link

wokhan commented Apr 19, 2020

Hi, any update on this? What should we use instead? I started updating my projects to use Code Contracts when I was told it was deprecated....
Finally switched to C# 8.0 Nullables for some of those, but still...

@dotnet-bot
Copy link
Contributor

This issue has been closed as part of the issue backlog grooming process outlined in #22351.

That automated process may have closed some issues that should be addressed. If you think this is one of them, reopen it with a comment explaining why. Tag the @dotnet/docs team for visibility.

@dotnet-bot dotnet-bot added the won't fix Issues that were closed as part of automated backlog grooming label Jan 25, 2021
@electricessence
Copy link

@wokhan Did you find any alternatives to contracts outside of nullable?

@Genbox
Copy link

Genbox commented Oct 28, 2022

@wokhan Did you find any alternatives to contracts outside of nullable?

Closest I've seen is Dafny.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-framework/svc Pri2 won't fix Issues that were closed as part of automated backlog grooming
Projects
None yet
Development

No branches or pull requests

10 participants