Taking a short break to do something else for a few minutes is a wonderful way to stay productive and not stuck on some issue.
I remember specifically one day in university times I was stuck for almost 4 hours in a problem. I started working shortly after 8:00 and I went for lunch with some buddies, came back, and instantly knew the solution. This is how I learned how to have lunch at 9:00
Might be that I’m so used to the status quo, but I like the current way Go handles errors very much.
I do understand that there is a lot of code repetition, and many lines of code in a function will go for error handling instead. But I also feel that when we don’t focus too much on happy path and do handle errors, we end up with a lot more work on it then on the happy path anyway, so the number of lines that go for error handling do correlate with the amount of effort we take there anyway.
I think in errors, a thing that might be improved is what to return on the “normal/happy path” side when there is an error. Suppose a string that returns a string and an error. If there is no error, I get some string and nil on the error. But if there is an error, I still need to return a string (an empty one, but still). If it’s a struct being returned without being a pointer, then it still needs to be returns. Many feel this is a weird aspect about the language.