3 ms·
Go is much better! Let's just return an error, and hope someone looks at it. Oh, and if that hope was wrong in Java? Thread does, nice call stack in logs. In G
by tsimionescu 7y ago
Go is much better! Let's just return an error, and hope someone looks at it.
Oh, and if that hope was wrong in Java? Thread does, nice call stack in logs. In Go? Well, the program will go on with some default - value struct, most likely.
- baby 7y ago> Let's just return an error, and hope someone looks at it Some people would argue that this is what linters do: warn you when you don't check errors as return values. I'm not sure what's the best solution here, and I don't think any language handles this out of the box (without linters) > and if that hope was wrong in Java? Denial of service But I get your point though, errors are hard and I think the only language that I've seen doing something good with them is Erlang. You just expect errors to crash your actors, and you design to recover quickly from any type of crash.