Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not horrible, it's ok and a bit repetitive. Really the whole thing about error handling in Go is overblown.


Because its repetitive its leads to incorrect code. I've seen more swallowed errors in Go than other languages.


Honestly, I've seen way more problems with global exception handlers, which often lead to incomprehensible end user messages.


It’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).


Repetitive code is a language flaw IMO. There are certainly more concise alternatives to the common case of that loop construct in many languages.


Then 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.


It'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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: