3 ms·
> Other languages like Go do not necessarily have enums, but you can represent enums by using something like this (in Go): This misses the important point that
by da39a3ee 3y ago
> Other languages like Go do not necessarily have enums, but you can represent enums by using something like this (in Go):
This misses the important point that Go lacks pattern matching -- one uses a switch statement instead -- and the Go compiler lacks the ability to check that all branches have been handled in a switch statement.
Go's concurrency stuff is beautiful. If Go had sum types / Rust-style enums with pattern matching and handled errors as a Result sum type, then it would be a much nicer language.