Update AV1755: Only use Async or TaskAsync as a suffix when a method has both synchronous and asynchronous versions#374
Open
dennisdoomen wants to merge 1 commit intodevelopfrom
Open
Conversation
Split from #298. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bkoelman
reviewed
Mar 29, 2026
| rule_id: 1755 | ||
| rule_category: naming-conventions | ||
| title: Postfix asynchronous methods with `Async` or `TaskAsync` | ||
| title: Only use `Async` or `TaskAsync` as a suffix when a method has both synchronous and asynchronous versions |
Collaborator
There was a problem hiding this comment.
Why was this rule changed? The BCL still adds the Async suffix, as far as I'm aware.
| severity: 2 | ||
| --- | ||
| The general convention for methods and local functions that return `Task` or `Task<TResult>` is to postfix them with `Async`. But if such a method already exists, use `TaskAsync` instead. | ||
| Only postfix a method or local function that returns `Task` or `Task<TResult>` with `Async` if there is also a synchronous version of that method. If the only version is asynchronous, the `Async` suffix adds unnecessary noise. If both synchronous and asynchronous versions exist, use `Async` as the postfix. If a method named `Async` already exists, use `TaskAsync` instead. |
Collaborator
There was a problem hiding this comment.
Suggested change
| Only postfix a method or local function that returns `Task` or `Task<TResult>` with `Async` if there is also a synchronous version of that method. If the only version is asynchronous, the `Async` suffix adds unnecessary noise. If both synchronous and asynchronous versions exist, use `Async` as the postfix. If a method named `Async` already exists, use `TaskAsync` instead. | |
| Only suffix a method or local function that returns `Task` or `Task<TResult>` with `Async` if there is also a synchronous version of that method. If the only version is asynchronous, the `Async` suffix adds unnecessary noise. If both synchronous and asynchronous versions exist, use `Async` as the postfix. If a method named `Async` already exists, use `TaskAsync` instead. |
Googled for "what's the difference between postfix and suffix as a noun?":
"suffix" is the standard term in linguistics for word endings (e.g., -ed, -ing), whereas "postfix" is a technical term commonly used in computing and mathematics to mean an operator placed after operands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates guideline AV1755.
It was split out of #298 so the change can be reviewed independently.
Files:
Part of the replacement for #298.