4 ms·
> This is contrasted to Go, which I think turns away these developers (at least it did for me…) due to having null-pointer/non-existent nullability. As opposed
by _gabe_ 4y ago
> This is contrasted to Go, which I think turns away these developers (at least it did for me…) due to having null-pointer/non-existent nullability.
As opposed to Typescript's null, undefined, or optionally defined types? I don't use Go or Rust, but I do use Typescript so maybe I'm a bit confused by this statement. Go allowing nullability doesn't seem like a dramatic shift from Typescript's 3 different ways to represent a potentially ill defined object, and it wouldn't turn me away from the language.
- madeofpalk 4y agonull/undefined is type checked in Typescript so the compiler will make sure you check whether your value is defined or not and handle it appropriately. Go having nullability isn’t the problematic part - it’s how nil is not type checked, so a value might secretly be nil and you won’t know until your program crashes at runtime. Rust avoids this by just not having null, instead using things like Result and Option types, which is pretty neat with pattern matching.