Arch Forum 2024-12-05¶
Participants: Backend devs, Magnus, Victor and Zak
Agenda¶
- Nullable / .NET8 (Lars)
Nullable / .NET8 (Lars)¶
Lars gave a refresher on Nullables now that we are migrated to .NET8 and should start using it. https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references
The main upsides by nullable are:
- Runtime errors will happen earlier, i.e. when deserializing a response instead of when using the result which is null but shouldn't.
- Many runtime errors will be compile time errors instead
The guideline:¶
- All new projects should have Nullable enabled (
<Nullable>enable</Nullable>in csproj) - In the long term, existing projects should be updated to enable nullable. However, this is a big effort. Instead
while migrating we can enable annotations (<Nullable>annotations</Nullable>in csproj) to help us upgrade gradually.