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

Throwing prevents the caller's control flow from passing into code that assumes a useful value was returned and ready to be consumed when it wasn't. Handling a success or a failure with exactly the same code shouldn't be a default because it almost never makes sense.

A Java exception can suppress stack trace init if needed, letting an instance be created once and reused very cheaply (though logs will be less useful).



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

Search: