3 ms·
> you just don't allow for uninitialized fields It sounds simple, but it's the kind of thing that has very far-reaching effects across the language. If you sta
by int_19h 2y ago
> you just don't allow for uninitialized fields
It sounds simple, but it's the kind of thing that has very far-reaching effects across the language. If you start with this premise and then design everything else around it, things feel natural. If you take a language already designed around the notion of null values and bolt things on, either idiomatic code changes massively, or you leave enough loopholes in the type system to still let people write the stuff they have always done and that always worked (even though it's technically unsound).
And yes, of course it's a tradeoff. For my own part, I also think that null values and the simplicity that comes with them in some things aren't worth the trouble that they bring. I'm also not a fan of Go, to put it mildly. But given where the language is already, and given their explicit stated design goals (which I disagree with), I can totally see why on this particular issue they went with nulls just to keep things simple that were traditionally simple.
- steveklabnik 2y ago> But given where the language is already, and given their explicit stated design goals I fully agree, which I tried to say at the end. All I was saying is that you don't need all of the stuff you're talking about to make this work.