The try/catch construct require too much code for the common propagate case.
It would be nice if Java had a similar construct for error handling.
The try/catch construct require too much code for the common propagate case.
It would be nice if Java had a similar construct for error handling.
Still, it's too bad the error type must be a throwable. I kind of wish it could just be a plain type so you can error or cancel without generating stack traces. Awaiting a failed task could still throw.
Would be a nice perf boost. As it is now, you don't want to actually cancel or fail a C# task in performance critical code. You need to successfully complete the Task and return an error, which is pretty confusing.
Proliferation of types is an issue in Java, but the whole language has that problem. It's not just exceptions.
I feel the same way about Go vs Java or Zig vs Java, I think errors as values makes more sense.
It’s the laws of the universe breaking and control flow changing on errors that I think most people hate.