5 ms·
> It seems a lot of things in golang were done just for the sake of being different, with nothing to back it up. Take an afternoon to go through the Go FAQ [0]
by Cthulhu_ 7y ago
> It seems a lot of things in golang were done just for the sake of being different, with nothing to back it up.
Take an afternoon to go through the Go FAQ [0] (they answer why they don't have exceptions), design documents [1], including this fairly recent one [2] about error handling - they explicitly discuss exceptions and the pros / cons - and that's just what ended up in the design documents / FAQ, there's been at least ten years worth of discussion gone into that beforehand. Do some googling before making accusations like that please.
[0]: https://golang.org/doc/faq#exceptions https://golang.org/doc/faq#exceptions
[1]: https://github.com/golang/go/wiki/DesignDocuments https://github.com/golang/go/wiki/DesignDocuments, https://github.com/golang/proposal https://github.com/golang/proposal
[2]: https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md https://go.googlesource.com/proposal/+/master/design/go2draf...
- apta 7y agoI'm aware of their rationales, what I'm saying is that they don't make sense and are dismissive, and have no studies at all to back them up. It's there in the first link you posted for example, "we believe exceptions lead to convoluted code". Belief here is not sufficient, it must be conclusively shown that it's otherwise, especially given that subjectively speaking it is possible in golang for errors to slip and not be handled at all (I saw it in real code bases), much much worse than any "convoluted" code that exceptions may result in (again it's very subjective - the way golang handles errors results in much longer code that's harder to follow).