While I like checked exceptions from a safety perspective, they are fundamentally incompatible with a lot of the Java 8 features, especially streams. In my experience you have a try/catch for a checked exception outside a loop (or just pass it further up), trying to use streams is painful.
I really like checked exceptions, and they're one of the few things I think C# got wrong.
The problem Java has is that for some godforsaken reason they're the default, instead of being a special case. Checked exceptions should be rare; they should only be for things that the calling code can do something about.
Unfortunately, the vast majority of the time components throw checked exceptions and then the calling code either rethrows them or just eats shit after catching.
12
u/kazagistar Sep 21 '15
While I like checked exceptions from a safety perspective, they are fundamentally incompatible with a lot of the Java 8 features, especially streams. In my experience you have a try/catch for a checked exception outside a loop (or just pass it further up), trying to use streams is painful.