Skip to content

Improve code examples in writing-an-exception-filter.md #5081

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 2 commits into from
Aug 16, 2024

Conversation

jeremy-rifkin
Copy link
Contributor

This PR is primarily a formatting PR. I recognize that style is highly subjective, however, I am opening this PR because I find the formatting in writing-an-exception-filter.md to be confusing and more importantly inconsistent.

This PR:

  • Moves function forward-declarations outside of other function bodies
  • Formats empty compound statements more consistently
  • Formats spacing in parentheses consistently (I find __except ( Eval_Exception( GetExceptionCode( ))) especially egregious formatting)
  • Uses 4-space indentation instead of 3-space
  • Indents control flow bodies

The one substantive change I made is changing ResetVars to a more general HandleOverflow function, as I found the purpose of ResetVars misleading in this example.

In preparing this PR I consulted the style guide and in absense of clear code formatting guidelines I looked to other well-formatted articles, such as Modern C++ best practices for exceptions and error handling.

Copy link
Contributor

@jeremy-rifkin : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit 3704b28:

✅ Validation status: passed

File Status Preview URL Details
docs/cpp/writing-an-exception-filter.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

PRMerger Results

Issue Description
File Change Percent This PR contains file(s) with more than 30% file change.

Copy link
Contributor

Learn Build status updates of commit bde53f9:

✅ Validation status: passed

File Status Preview URL Details
docs/cpp/writing-an-exception-filter.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

PRMerger Results

Issue Description
File Change Percent This PR contains file(s) with more than 30% file change.

@ShannonLeavitt
Copy link
Contributor

@TylerMSFT

Can you review the proposed changes?

IMPORTANT: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged Tracking label for the PR review team label Aug 16, 2024
Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

Hi, I'm not a fan of the old formatting or the new formatting. We changed our style for braces to be on their own lines as one example. But I think this is an improvement and particularly the change from ResetVars() to HandleOverflow() is better. Thank you.

@TylerMSFT
Copy link
Collaborator

#sign-off

@TylerMSFT TylerMSFT merged commit 0b4cf27 into MicrosoftDocs:main Aug 16, 2024
2 checks passed
@jeremy-rifkin
Copy link
Contributor Author

Thanks Tyler for the quick response and merge. Are there any code style guidelines written down for the microsoft docs?

@TylerMSFT
Copy link
Collaborator

not that I'm aware of for the c++ docs.

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