3 ms·
Go is more verbose because it lacks a type system that allows generic programming, that seems like a very different kind of verbosity, than explicit error hand
by leshow 10y ago
Go is more verbose because it lacks a type system that allows generic programming, that seems like a very different kind of verbosity, than explicit error handling IMO.
Correct me if I'm wrong, but I don't believe Go's type system enforces you check and handle errors either, so it's not really enforcing verbosity where it counts.
- burntsushi 10y ago> Correct me if I'm wrong, but I don't believe Go's type system enforces you check and handle errors either Go's type system doesn't, but the compiler will in a good number of cases. For example, this will produce a compile time error: value, err := Foo() fmt.Println(value) It produces an error because `err` was declared and unused. The following defeats this check though: value, _ := Foo() // Bar returns one value: an error _ = Bar() Bar() The above list probably isn't exhaustive.