Hacker News new | ask | show | jobs
by ivanjaros 2436 days ago
After years of using Go, I came to realize that the ONLY people that complain about errors in Go are those who actually do not write any Go code and those who write Go code less than a year(ie. juniors). There is absolutely nothing wrong with errors in Go and the creators got it right form the start. Nobody is forcing you to use errors. You can use booleans if you want. You can panic(throw exception) if that is what you wish. To each its own. If you want more syntactic sugar, move to Java, it has plenty of it for you.
2 comments

Do have have experience using a language with sum types and exhaustive case analysis?
IMO Rust really got errors right, a sum type is the way to go. Not exceptions, multiple return, callback arguments, or sentinels. Encoding the control flow into the type system makes your code much more robust.