3 ms·
You’re right but I think that’s pretty self-defeating so people wouldn’t really do it. But there’s a pretty good argument that the way exceptions are implement
by MBCook 2y ago
You’re right but I think that’s pretty self-defeating so people wouldn’t really do it.
But there’s a pretty good argument that the way exceptions are implemented in Java makes the easiest thing to do simply be to start tacking “throws Exception“ on the end of tons of methods once you start to have trouble. Everywhere I’ve worked you start to see that in chunks of the code base.
You don’t have to. It’s certainly avoidable. But as things get more and more complicated people will just opt for that to save themselves time. Java’s design unintentionally encourage it when the going gets rough. Even when using an IDE that can add the correct types to the list for you, that’s what people reach for.