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

OutOfMemoryError isn't an exception so they would not be catching it.


whatever, the point is exception allows and encourages people to catch less and more than they should


Sometimes top level code needs to do this. It's not always wrong. It's not always black and white in programming.


> Sometimes top level code needs to do this

come on, it's not as if anyone disagrees with that, but that's extremely, extremely rare, overwhelmingly, callers are just dealing things like with UserNotFoundException, NullPointerException, what have you, and there's no reason why the compiler should happily let you catch Exception (or nothing) when it could just be giving you an honest object back


It has not been extremely/overwhelmingly rare in my experience. Further still, within the context of Java, exceptions are objects.




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

Search: