Hacker News new | ask | show | jobs
by tempaccount9473 4836 days ago
So they have created an mechanism that allows replacing a small subset of what execptions can do (communicate errors to the callers of a function).

The downside is they need to write all code in a non-standard idiom, need wrappers around standard libraries, cannot easily bubble up errors through multiple levels of the callstack when appropriate, and have made their typing system significantly more complex.

I cannot see an upside.

The example they gave, that division by zero is a "crafty little exception can sneak out of our net and crash our program", could just have easily been solved by wrapping division in a try/except block that caught the RuntimeException, and threw a MyDivisionByZero exception. Then the compiler would enforce that the exception must be caught, elimiating their handwaving argument that unchecked runtime exceptions are "the wild west".