4 ms·
It's not horrible, it's ok and a bit repetitive. Really the whole thing about error handling in Go is overblown.
by Thaxll 3y ago
It's not horrible, it's ok and a bit repetitive. Really the whole thing about error handling in Go is overblown.
- righthand 3y agoIt’s a bit repetitive but so is writing `for i, v := range n {}` everywhere. Code loops and repeats syntax all the time, so what? Argument doesn’t hold water for me (not attacking).
- lmm 3y agoRepetitive code is a language flaw IMO. There are certainly more concise alternatives to the common case of that loop construct in many languages.
- righthand 3y agoThen people should use those languages. From the beginning Go has been about simplicity and utility, not about providing multiple patterns and alternate syntax. I would also argue that repetitive code is a failure of the engineer who implemented it. If writing code is repetitive then people may want to look into generating it instead.
- aatd86 3y agoIt's an interesting opinion. I tend to believe there can be value in repetitive code patterns for recognition. It can make a language easier to read and understand although a bit more tedious to write. It's especially interesting nowadays when LLM models can write parts of it. It alleviates the writing part.
- eweise 3y agoBecause its repetitive its leads to incorrect code. I've seen more swallowed errors in Go than other languages.
- 13415 3y agoHonestly, I've seen way more problems with global exception handlers, which often lead to incomprehensible end user messages.