Replies: 17 comments 14 replies
|
I can understand your standing point. But from a user perspective it is easier when the methods end with Async. Having async in the name makes it easier to spot mistakes in CodeReviews. So it is easy to identify while reading the code. While writing the compiler helps. But it is a learned thing from asp.net core and bcl that you have async in the name. That makes it consistent. |
|
Async methods should have the Async suffix. And no, the compiler did not help: In the real world, customer projects, especially if grown organically over years up to decades, tend to have hundreds if not thousands of compiler warnings. That one won't pop out. Changing that in your codebase will introduce massive potential problems with your customers. |
|
Personal opinion, keep it, I like it, the reasons are already stated above. Especially @gingters point about the coding guidelines. If you change it, your migration path should be tool supported, e.g. provide a roslyn codefix to change the existing names. |
|
One day Microsoft might "come to its senses" 😇 and follow Java's virtual threads (project Loom). Then we will all be happy to have the async methods nicely separated. Keeping it saves energy and is more future proof at the same time. |
|
Better to keep the Async suffix |
|
I would prefer the async method. It just makes it clear that it is awaitable. I would second the points given above as well. |
|
Please keep the Async suffix. |
|
Please don't. Why make your codebase less intuitive by not sticking to the common conventions used in most .NET codebases? Why add unnecessary friction?
|
|
I think this is a bad decision and breaks years of well defined naming conventions. How hard can it be to just keep using the suffix? Who cares if NServicebus have decided to drop the suffix, 99% of .net developers will continue to use it |
|
Not to mention that tools like SonarQube will complain about it as well. |
|
Its not the end of the world if you dropped it, but I think most of the .NET community expects Async suffixed methods at this point. |
|
I think keeping the
Without the suffix, it can be confusing to know which one you're calling. Keeping |
|
I would prefer dropping the Async suffix. I guess Microsoft introduced this suffix at a time when they were forced to provide both, synchron and asynchron variants of their methods. |
|
My two cents are, that the async suffix does not provide any meaningful insights but introduces more noise instead. We have clever compilers, tools like SonarQube and many others that can hint to unawaited tasks. Also, I'd recommend declaring these warnings as errors so that they must be fixed. I would love to drop the suffix in my projects but in OllamaSharp people where complaining about the lack of the suffix. After I talked to the folks at Microsoft while building the bridge to Microsoft.Extensions.AI, they recommended to use the suffix as well, so I finally added it. Still no fan. |
|
My opinion: 100 percent: please keep the async suffix. |
|
Please keep the Async suffixes. This is standard convention and I don't want to see this removed. This is standard practice for me when I'm designing code, and it makes it easy to see at a glance what the expectation is for the method without having to inspect the response. |
|
If you want to adopt something good by making breaking changes, then it's better to adopt the normal transmission of CancellationToken through method parameters, because the current extraction of CancellationToken inside the methods of the IdentityServer codebase is comparable to repairing a car engine through an exhaust pipe. And leave the async suffix alone, this is a common practice in .NET is understandable to absolutely everyone, and all these lengthy discussions about whether to write this suffix or not come from groups that do not want to be like everyone else. In fact, everything is fine. The NET ecosystem looks at how Microsoft does, taking the dotnet/runtime and dotnet/aspnetcore codebase as a reference. And if a suffix is used there (and it is used there), then everyone will use it. And there's nothing you can do about it. If you want to make breaking changes, then let them bring real benefits. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
With a nod to our friends over at Particular Software the team here fully agrees with their Reason for No Async Suffix naming convention. As such we are looking to adopt this across all of Duende's code base.
As this is a technically a breaking change SemVer wise we plan to role this adjustment out gradually.
Asyncsuffix for asynchronous methods.Asyncsuffix will be renamed at the appropriate time aligned with amajorversion of the given library. (We will not be shipping major versions just to make this adjustment).We value consistency but we have to make a trade-off against disruption. As this is gradual, we expect there to be mixed conventions in a given library during the transition period.
All reactions