Proposals for bindings -- NRTs and C# syntax
See original GitHub issueWe will soon merge #1243, which will enable nullable reference types for the repo (or large parts of it). Going forward, I think we should consider the following requirements:
- Projects must enable nullable reference types to be accepted.
- Projects should use single line
using
statements (for dispose) unless there is a reason to require scoping. - Sample projects should target .NET 5.0 and use top-level programs, unless there is a good reason not to. Test projects should also target .NET 5.0.
- Name sample apps Program.cs, unless there are multiple sample projects in the same directory.
I mention these things, because they describe most of the fixes I made in #1243, with the goal of making the codebase modern and easier to read.
On a broader note, 5.0 will go out of support in ~ March 2022 and 3.1 in December 2022. It would be really nice to start using C# 9 or even C# 10 features throughout the codebase. Records would be the most obvious feature to take advantage of, particularly for all the models typically defined by bindings. I’d like to start doing that before the end of 2022 but don’t want to give up on compatibility either. We should determine if there are creative ways to enable moving the codebase to use newer features.
Any thoughts on these ideas?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (9 by maintainers)
Top GitHub Comments
This plan shouldn’t break nano support. Generics are presumably a bigger issue than records and NRTs.
Closing this as fixed. If there is anything left please create new issues with specific work items