Docs: Goto is barred for 50 years

Created on 27 May 2019  ·  5Comments  ·  Source: dotnet/docs

Please do not use goto in your examples.
Ever!


Document Details

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

Area - C# Guide csharp-spetech dotnet-csharprod product-feedback

Most helpful comment

goto is a feature of the language and language proposals naturally have to discuss how new features interact with it.

All 5 comments

goto is a feature of the language and language proposals naturally have to discuss how new features interact with it.

I'm going to close the issue as there is no real issue here 🍰

no real issue here

article references goto statement, which the usage of has been frowned upon for decades now and would be flagged as "correction required" by any code review.

article talks about using declarations, which are a worse idea WRT definition of bounding scope than inline out parameters.

These are two real issues that promote coding practices/styles that make the code harder to read and/or increase likelihood of bugs.

@StingyJack Sure, but this is the language specification article. It details the keywords and how they're used and essentially documents the language syntax.

The objection is with using goto in examples, because people copy example code from pages like this.

The other note is related to this proposed feature.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mekomlusa picture mekomlusa  ·  3Comments

tswett picture tswett  ·  3Comments

LJ9999 picture LJ9999  ·  3Comments

Manoj-Prabhakaran picture Manoj-Prabhakaran  ·  3Comments

svick picture svick  ·  3Comments