3 ms·
Making InterruptedException a checked exception was a _mind-boggling_ stupid design mistake that should have been immediately corrected but unfortunately never
by lenkite 9y ago
Making InterruptedException a checked exception was a _mind-boggling_ stupid design mistake that should have been immediately corrected but unfortunately never was. I always wince when writing scalable, long-running concurrent Java code. You need to interrupt and handle interrupts when tasks are hung, but you then need either litter up all your Java interfaces or do lots of exception detection juggling.
- kovrik 9y agoWell, nowadays all checked exceptions are considered to be a mistake.
- i386 9y agoIt’s explicit and encourages the consumer to handle errors correctly. The negatives seem to be cosmentic arguments.
- Salgat 9y agoForcing the programmer to add handlers for exceptions he may not even want to handle (sometimes it's okay to pass it up the call stack) just creates a mess in the source code. It's fine as a suppressible compiler warning, but not as a compiler error.
- kuschku 9y agoWell, in modern languages, the same concepts are all coming back. Go has its product types for errors, and Rust uses sum types. As result you end up with basically the same code as with exceptions, just even more verbose.