Hacker News new | ask | show | jobs
by tonyedgecombe 3143 days ago
Lack of exceptions is the main reason I won't use it.
2 comments

I thought this as for a long time. Then I used go for awhile and I think I like the go way better. It solves the issues I had with execptionless languages without all the noise.

With exceptions you most often just let them trickle up the call chain, which is the same thing you often do with err, just return it.

And the returning the err works much better when doing async. Cross thread exceptions are a PITA and you are basically back to just returning an error obj.

On the whole I agree that I prefer Go's explicit error returns over other languages implicit "alt-return paradigm" aka exceptions. But you're really well advised here to run a couple of linters occasionally that inform about ignored/unchecked/non-passed-on errors, it can happen all too easily while "rodeo-coding" prototypes/MVPs
I thought this as for a long time.

I have tried Go and worked with languages without exceptions in the past. The problem is the amount of error handling code I was writing time and time again. It might only be a case of returning an error but that is one more thing you need to think about instead of concentrating on the the domain.

Error handling in threads is a pain either way.

Lack of exceptions (in my code, but more importantly in library code) is one of the main reasons I use go.