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

> I reckon every few function calls you make could potentially trigger an exception.

One Java module I had the misfortune of writing theoretically had to deal with checked exceptions on the majority of its calls, and the only possible response to virtually all of them was to crash, because in that context, it could only have meant someone had either ripped the DRAM off the board, or placed the board in a particle accelerator.



In that case, why don't you just put 'throws Exception' on all your methods?


I said "theoretically", did I not?

And there was nothing particularly special about the module aside from the extreme concentration. Every piece of Java I've ever written or even looked at has this same problem on a reduced scale.

My point is to show how utterly broken and worthless the concept is. Either there's a ton of exception-"handling" boilerplate that does nothing useful, or there's "throws Exception" everywhere, itself useless boilerplate that exists only to tell the compiler to buzz off.




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

Search: