3 ms·
The biggest annoyances are the lack of exhaustive pattern matching and the lack of sum types. I say annoyances because its possible to get most of the behavior
by omeze 8y ago
The biggest annoyances are the lack of exhaustive pattern matching and the lack of sum types. I say annoyances because its possible to get most of the behavior for sum types with interfaces but a lot more boilerplate must be written. And, while Go offers no exhaustive pattern matches, in practice the use of a default switch that returns an err works OK. But at the end of the day, I find my colleagues a lot less elegant and rigorous with their Go types/structs compared to their Typescript code because of the additional boilerplate, which makes me think language ergonomics around types makes a difference in code quality around data modeling. Its not an monumental chasm, but it exists.