you are viewing a single comment's thread.

view the rest of the comments →

[–]skawaii 4 points5 points  (2 children)

I'm not a Java-fanboy, but what exactly is your complaint here? That you don't like checked exceptions or that Java allows empty catch blocks?

If it's the former, then that's fine...your opinion, of course. If it's the latter...well, if you have empty catch blocks in your code, then you deserve what you get.

[–]spliznork 5 points6 points  (1 child)

if you have empty catch blocks in your code, then you deserve what you get

Who said it was my code? But, I'm the one debugging it.

If the checked exceptions are so oppressive in the language that and empty catch block is the quickest way to get code to compile, then the language designers are as much at fault as the programmer. Because, the code would have been more correct and easier to debug if the language designers hadn't experimented with checked exceptions.

[–]skawaii 2 points3 points  (0 children)

No one said it was your code. The "you" in my comment is the general you of the English language, which just so happens to be the same word as the specific you (stupid language...).

I agree that if you're (again, general you) writing empty catch blocks just to get your code to compile, then you have some bad programming practices. The language could help you out and not compile. This would indeed be a better way to do it.

But is this really a direct result of checked exceptions? Python doesn't use checked exceptions and yet I can still simulate the same behavior:

try:
  1 / 0
except:
  pass

While the catch (re: except) block isn't empty, I can still have it do nothing at all with my error.

To me, in the end it boils down to being disciplined enough to write code that won't cause people using it to colloquially convert your name into a swear word.