4 ms·
> Exceptions are just spooky GOTO and a distance I couldn't agree more! When you throw exceptions it's unclear where the control flow will go
by goodoldneon 3y ago
> Exceptions are just spooky GOTO and a distance
I couldn't agree more! When you throw exceptions it's unclear where the control flow will go
- Karellen 3y agoI just don't see how multiple levels of if err: return nil, err in the call stack makes things any clearer? Or how having many instances of that snippet scattered everywhere makes the code easier to read?
- mmnfrdmcx 3y agoAgreed. It's also objectively worse because you lose the stack trace in the final exception you will display to your user. Enjoy debugging that when a customer sends you an error.
- demi56 3y agoOr you could use a 3rd party error package that’s not a good excuse because the standard don’t have it as a priority
- goodoldneon 3y agoIt makes the happy path harder to read but the unhappy paths much clearer. I hated this aspect of Go when I first started with the language but I love it now