Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't it effectively the same thing as swallowing Throwable with an empty catch block in Java?


Yes, but you need to wrap every line of source code in your whole program (and all libraries) with an empty catch block to have the same result.

Just a single top level catch block would prevent other code after the error occurred from running, which might still be able to work fine without the results of the faulty code.


I see. I'm just not sure that situations where this way of exception handling is a viable strategy are common enough to warrant this syntactic sugar (which seems very easy to misuse). The Visual Basic docs also recommend using structured exception handling instead. Perhaps it is more useful in scripting contexts.


They are not viable strategies, which is why the analogous strategies in modern-day languages are heavily discouraged and wouldn't pass a code review.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: