Re:What's New in C# 14: Null-Conditional Assignments
by zdragnar on Wednesday September 17, 2025 @11:05PM
(#45284764)
Unfortunately, I suspect this will just makes it easier to keep writing sloppy code.
Re:What's New in C# 14: Null-Conditional Assignments
by rahkiin on Thursday September 18, 2025 @01:57AM
(#45285968)
These null checks are actually for Optionals in the type system.
The whole standard library and many better packages use nullability and thus indicate what can and cannot be null ever.
And structs can never be null.
So no, c# are not constantly null-checking more than in Rust
For example in my last gig, the original devs didn't understand typing, so they were forever writing typing code at low levels to check types (with marker interfaces) to basically implement classes outside of the classes. Then of course there was lots of setting of mutable state outside of constructors, so basically null was always in play at any moment at any time.
I would have loved this feature while working for them, but alas; they were still on 4.8.1 and refused to allow me to upgrade the codebase to .net core, so it wouldn't have helped anyway.