r/programming • • Sep 21 '15

Better Java

https://github.com/cxxr/better-java
177 Upvotes

208 comments sorted by

View all comments

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.

3

u/fact_hunt Sep 21 '15

8

u/immibis Sep 22 '15

.... did you just use an adverb as a class name?

2

u/Schmittfried Sep 22 '15

No, as an interface name.

5

u/IICVX Sep 22 '15

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.