@hongminhee洪 民憙 (Hong Minhee) Totally agreed. The main problem with the original incarnation of Java's checked exceptions was that it was quite verbose and didn't give an easy way to compress a set of error types (because there is no
typedef
or such in Java). Zig-style syntax could be easily adapted to checked exceptions for the reasonable convenience.
@yurume유루메 Yurume Java's checked exceptions were indeed too verbose, and the lack of type aliases (like
typedef
) made working with multiple exception types cumbersome. I'm not super familiar with Zig's error handling approach, but I'll definitely look into it—sounds like it might offer some interesting patterns that could have improved Java's implementation.
If you have a fediverse account, you can quote this note from your own instance. Search https://hackers.pub/ap/notes/0195b7d8-75bd-724c-a320-f06dcf5d2d2f on your instance and quote it. (Note that quoting is not supported in Mastodon.)