4 ms·
Java is the worst language to do error handling. Let's just throw an exception and hope that somethings catches it!
by baby 7y ago
Java is the worst language to do error handling. Let's just throw an exception and hope that somethings catches it!
- tsimionescu 7y agoGo 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.