Why do Java people frequently consume exceptions silently?

I have always thought, that’s similar to the following scenario:

“A man gets shot.

He holds his breath and has enough strength to take a bus.

10 miles later the man gets off of the bus, walks a couple of blocks and dies.”

When the police gets to the body, they don’t have a clue of what has just happened. They may have eventually but it is much harder.

Better is:

“A man gets shot and he dies instantly, and the body lies exactly where the murder just happened.”

When the police arrives, all the evidence is in place.

If a system is to fail, better is to fail fast

Addressing the question:

  1. Ignorance.
      +
  2. Sloth

EDIT:

Of course, the catch section is useful.

If something can be done with the exception, that’s where it should be done.

Probably that is NOT an exception for the given code, probably it is something that is expected ( and in my analogy is like a bulletproof jacket, and the man was waiting for the shot in first place ).

And yes, the catch could be used to Throw exceptions appropriate to the abstraction

Leave a Comment