3 ms·
Checked exceptions sound good in theory but to make it works it requires the whole community to buy into that level of paranoia right from the beginning. It's
by blacktriangle 5y ago
Checked exceptions sound good in theory but to make it works it requires the whole community to buy into that level of paranoia right from the beginning. It's a much better concept for a language like Ada or Eiffel more design-by-contract style. Java already plays fast and lose with safety, checked exceptions are closing the barn door after the horses bolted. In reality checked exceptions in Java just means everybody swallows exceptions by doing nothing and moves on.
- ashishb 5y ago> It's a much better concept for a language like Ada or Eiffel more design-by-contract style. I'm not familiar with this. Please elaborate how you would handle say an I/O failure while R/w a file with this approach?
- blacktriangle 5y agoI'm not familiar enough with either of those platforms to answer that specific question, it was more a general comment on the respective developer cultures. I've worked on several Java codebases where swallowing exceptions was the norm, but in their defense it was because several libraries were way too chatty in their use of exceptions.
- ashishb 5y agoI worked on several Java codebases where more than 90% exceptions weren't swallowed. The other 10% were swallowed with a comment explaining why it is fine to ignore.