4 ms·
Have you seen old java code that has tons of empty try / catch blocks? It is very, very common.
by icedchai 7y ago
Have you seen old java code that has tons of empty try / catch blocks? It is very, very common.
- lolc 7y agoJava is special in this regard because the common case of letting an exception terminate the program is harder than ignoring it. When I was still writing Java, I'd gotten so annoyed by this that in the top layers every method "throws Exception". It was less verbose than promoting all the checked exceptions to runtime errors. Unfortunately people don't know about this possibility and write empty catch statements because "it's not going to happen anyway". Yeah right.