Closed bkoelman closed 2 years ago
I noticed https://github.com/dennisdoomen/CSharpGuidelines/commit/34949fae383678e2a6bea80b30105e034a4f453e, which increments to C# 9, but I believe it should be C# 10, which was released last year.
I knew I should have used a PR for that ;-)
Is there anything else you want to do with this issue?
I'm okay with closing this, but perhaps keep it open a little longer to allow community members to chime in?
CLosing due to inactivity.
@dennisdoomen can you create a new release, so I can align CSharpGuidelinesAnalyzer with the latest changes?
I've reviewed the language changes in C# 8, 9 and 10 in an attempt to update CSharpGuidelines.
I'm reluctant to add rules that recommend using the various syntax enhancements in recent C# versions. These are already being suggested by Rider/Resharper (or Visual Studio itself) and can be configured to produce warnings. While it's good for teams to standardize on such syntax, there's little point in spelling them out here. Amongst these are:
using var stream = ...
vs nested statements)await using
)public int Name { get; init; }
)List<string> items = new()
)var account = isAdmin ? new AdminAccount() : new UserAccount();
)int x = 0; (x, int y) = point;
)Then there's a category of features that I suspect most application developers aren't likely to care much about:
unmanaged
generic constraintstackalloc
nint
andnuint
)AsyncMethodBuilder
attribute (for custom async/await handlers)CallerArgumentExpression
attribute#line
pragma (used by debuggers)I've skipped nullable reference types, as there's already great guidance and tooling for that.
Then there's record types, which I haven't used yet, so nothing to report there from me.
What's left are features that I wouldn't know any guidance to provide for:
yield return
in methods that returnIAsyncEnumerable<T>
)Based on the above, I've created https://github.com/dennisdoomen/CSharpGuidelines/pull/241 and https://github.com/dennisdoomen/CSharpGuidelines/pull/244, which concludes my investigation.
Once these are merged, I think we can extend the supported version range to C# 10.
Feedback and suggestions welcome!