Skip to content

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

Merged
Tyler Whitney (TylerMSFT) merged 2 commits into
MicrosoftDocs:mainfrom
jeremy-rifkin:patch-1
Aug 16, 2024
Merged

Tyler Whitney (TylerMSFT) merged 2 commits into
MicrosoftDocs:mainfrom
jeremy-rifkin:patch-1

Conversation

@jeremy-rifkin

Copy link
Copy Markdown
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.

@prmerger-automator

Copy link
Copy Markdown
Contributor

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

@learn-build-service-prod

Copy link
Copy Markdown
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:

@prmerger-automator

Copy link
Copy Markdown
Contributor

PRMerger Results

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

@learn-build-service-prod

Copy link
Copy Markdown
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:

@prmerger-automator

Copy link
Copy Markdown
Contributor

PRMerger Results

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

@ShannonLeavitt

Copy link
Copy Markdown
Contributor

Tyler Whitney (@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

@TylerMSFT Tyler Whitney (TylerMSFT) left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator

#sign-off

@TylerMSFT
Tyler Whitney (TylerMSFT) merged commit 0b4cf27 into MicrosoftDocs:main Aug 16, 2024
@jeremy-rifkin

Copy link
Copy Markdown
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
Copy Markdown
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