for #dotnet people, when we have #nullable checking on, how do you feel about DTO fields initialised to " = null!;"
e.g.
public string Name { get; set; } = null!;
It seems wrong to me "Name is not nullable, and also, surprise, it's null!"
It seems like that could go wrong.
But if it's the accepted idiom than I'll go with it.
Is there a better one?
"= string.Empty;" is verbose.
What do you think?
Maybe not that controversial take, but I love the nullable feature in C#. There are occasional situations where the nullable warning appears and I'm like "why???" But all in all, it has been a great help, and has generally made me a better programmer, even when doing stuff with .NET Framework.
#dotnet #csharp #nullable #Coding
#CSharpForMarkup 2 for #WinUI3 and @unoplatform is coming along nicely🙂
-🔥Windows C# #hotreload updates UI on Ctrl+S
- All #dotnet 7 target platforms, #csharp 11
- Nested view files in sln explorer
- Fully #nullable + #editorconfig enabled dotnet new template
#CSharpForMarkup #WinUI3 #HotReload #dotnet #csharp #nullable #editorconfig
Is there a recommended pattern to follow when dealing with #nullable types in #TypeScript ?
This snippet is just from the #supabase #nextjs quickstart guide. Since data maybe null when fetched from the Supabase bucket, TS complains since createObjectURL requires the parameter.
I know that I could guard the line with an "if" statement but that just seems unnecessary. Like there should be a more elegant solution, something like optional chaining. :thinking: :javascript: :react:
#nullable #typescript #Supabase #nextjs