Skip to content

C# reference: Consolidate the selection statements articles #25520

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

Merged
merged 6 commits into from
Aug 9, 2021
Merged

C# reference: Consolidate the selection statements articles #25520

merged 6 commits into from
Aug 9, 2021

Conversation

pkulikov
Copy link
Contributor

@pkulikov pkulikov commented Aug 8, 2021

Contributes to #10746 (I think it would be better to have two separate articles for selection and jump statements)

@@ -46,25 +46,3 @@ public class MyClass
}
}
```

## Example of void method
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example doesn't fit the article anymore as it generates CS8119 error

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pkulikov This is really good as well.

I have a few small nits to address, and then this is ready to :shipit:

Commenting so it stays in my queue to review

---
# Selection statements (C# reference)

The following statements select statements to execute out of a number of possible statements based on the value of an expression:
Copy link
Member

@BillWagner BillWagner Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, I think:

Updated suggestion based on the conversation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillWagner no, not a typo. The switch statement executes several statements (all those in one section). if statement always selects one, because technically the whole block {...} is considered as one embedded statement.

Should it be:

...select statements to execute FROM a number of possible statements...

?

Copy link
Member

@BillWagner BillWagner Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying. I like your change here.

@pkulikov
Copy link
Contributor Author

pkulikov commented Aug 9, 2021

@BillWagner thank you for the review. I've applied all your suggestions except the first one. Please check my latest commit, in which I've made more changes based on your feedback.

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting all this together @pkulikov

I'll :shipit: now.

@BillWagner BillWagner merged commit dd6bf71 into dotnet:main Aug 9, 2021
@pkulikov pkulikov deleted the consolidate-selection-statements branch August 10, 2021 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants