Earlier quoted context omitted.
> No Go doesn't do it better, Go just doesn't give you the choice, from a convention perspective. You have a discipline issue with Java, it is not an issue in the language itself, it's with you and your team. Its my entire company, and its with the open source ecosystem. Its naive to think that language constructs dont influence dev's decisions. You need to make it easy to do the right thing, not hard, and go makes i…
The right thing is to automatically maintain error context (e.g. stack traces) which golang fails at. Furthermore, the vast majority of the time you will have a top level handler that will log the error anyway. golang is just introducing boilerplate for the sake of it, with none of the upsides. Not to mention it also makes it easy to accidentally ignore or overwrite errors, I've seen several instance of that happenin…
Please, over-swallowed exceptions happen all the damn time. Same shit different day.
A really common Java problem:
T x = foo();
return x.bar();
Now foo() can throw, OK try {
T x = foo();
return x.bar();
} catch (Something exc) {
return quux();
}
You just ate anything from bar(). Instead you gotta do T x;
try {
x = foo();
} catch (Something exc) {
return quux();
}
return x.bar();
Which is longer and now your happy-path logic is noised up even worse than most Go handling.