3 ms·
This feels argumentative but fine. If you're unsure then make it a runtime exception. I agree that a lot of the problems people have with checked exceptions is
by invalidname 3y ago
This feels argumentative but fine.
If you're unsure then make it a runtime exception. I agree that a lot of the problems people have with checked exceptions is that people over use them.
You don't want to handle the checked exception wrap it with a runtime exception. But as an author if there's something important, I want to give the user of the library as much help as I can.
- tremon 3y agoBut as an author if there's something important You're still ignoring other people's point in this thread: you (the author of a library/package) cannot decide what is important for the users of your library. You can guess, but your guess will always be wrong for a subset of your downstream users. And speaking from the other side, as an application developer: for most of my code, an ArrayIndexOutOfBoundsException is a pretty serious exception. How do I go about making it a checked exception?
- invalidname 3y agoArrayIndexOutOfBoundsException is a runtime exception... You're ignoring the fact that I'm not saying EVERYTHING should be a checked exception. Quite the opposite.