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

> It almost always make sense to handle an error locally if you can

This is highly presumptuous. I have written many programs that did not need to handle errors locally, and so exception handlers were only at the very top level (or, actually, just below the top-level usually - but the point is that there were generally few and I had flexibility to decide where to put them). Perhaps you and I write very different applications. But the fact remains that the "almost always" in your statement doesn't hold.

Alternatively line of reasoning: if this was always true then there would be little point to Rust's ? as it would be so rarely used.



> It almost always make sense to handle an error locally if you can

Yes, but “if you can” does a lot of heavy lifting here. In most cases you can’t, and this is when Rust’s ? is used.




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

Search: