4 ms·
It's interesting that is how it is described, as it is at odds with actual usage. From my memory going back to early 2000's, it was seen as bad form to use an u
by zmmmmm 6y ago
It's interesting that is how it is described, as it is at odds with actual usage. From my memory going back to early 2000's, it was seen as bad form to use an unchecked exception in "user land" code - these were looked at as only for very severe internal failures like out of memory or similar. This was probably encouraged by IDEs that will auto-generate code for you for handling, rethrowing, adding to type signatures etc etc that proliferate the exceptions up through API layers. But it also seems at odds with the language itself ... for example a simple file not found will generate a checked IOException out of the standard libraries. It seems strange to suggest there is recovery from that (beyond choosing another file).
Even though I completely agree that checked exceptions make Java a huge pain to work with, I do feel something has been lost when I use languages that don't support them or any alternatives. Having no way to enforce systematic handling of an error isn't a great solution either.
- Nursie 6y ago> It seems strange to suggest there is recovery from that (beyond choosing another file). That's the thing though, right? If you're writing a program with a UI you want to pop up a box saying "File not found, choose another". A server program might format an appropriate response, log it and send it back to the client. A batch process may just want to bail with a code. So it would seem to make sense to have it checked...