3 ms·
C++ is the only similar language I know of that actually tries to tackle this problem. And to be clear, I'm not saying that nullability checking is a bad idea!
by int_19h 2y ago
C++ is the only similar language I know of that actually tries to tackle this problem.
And to be clear, I'm not saying that nullability checking is a bad idea! On the contrary, it's great. It's especially great when the type system doesn't lie to you (i.e. if something being not nullable actually means that it can never be null), but even partial enforcement is better than nothing.
However, the OP to whom I responded specifically complained about "idea of the zero values for uninitialized struct fields" in Go, and then in the same breath mentioned "language that works, like C#" - which is rather ironic given that C# does, in fact have this exact thing, and I tried to explain why it needs it.