News for hackers. Stuff that matters.
Re:New in Go 1.20: wrapping multiple errors by lairv on Sunday December 11, 2022 @10:17AM (#33943864)
You are playing with words, Rust / OCaml Option types are effectively the same as nulls in null-safe language, like `string | null` in TypeScript or `string?` in Dart, although I agree it has become necessary for such things to be checked at compile-time
Re:New in Go 1.20: wrapping multiple errors by tialaramex on Sunday December 11, 2022 @01:16PM (#33945748)
The difference is crucial. With these Sum types a variable of type Option<Dog> / Dog | null / Dog? might be a dog, but a variable of type Dog is definitely a dog and the language has both of those types.

Languages which just have one nullable type here like Go must use their "might be a dog" type to represent things which definitely are a dog, meaning either you write paranoid checks everywhere or you might screw up - and it's no wonder there are more bugs as a result.