this post was submitted on 09 Jun 2024
231 points (79.7% liked)
> Greentext
7550 readers
1 users here now
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Nullable reference types are (a completely mandatory) bandaid fix in my opinion as a .net dev. You will encounter lots of edge cases where the compiler is unable to determine the nullability of an object, e.g. when using dependency injection to populate a field, or when using other unusual control flows like MediatR. You can suppress the warnings manually at the slight risk of lying to the analyzer. Objects supplied by external library code may or may not be annotated, and they may or may not be annotated correctly. The lack of compile-time null checking is occasionally an issue. But that said, NRT makes nullability a significantly smaller issue in C# than it used to be