Practically, though, I like it because JavaScript’s error handling sucks. I generally avoid using try/catch as a first class member of my software.
But the semantics around try/catch are the main issue here and basically everywhere in JS. Error catching in JS is absolutely abysmal. Some examples:
- nested try catch
- not annotating that a function throws an error (or even being able to annotate in TS that it does)
- async code throwing an error in a callback is uncatchable. E.G. file reader onread throwing an error.
- not being able to narrow a catch to a specific error type.
Practically, though, I like it because JavaScript’s error handling sucks. I generally avoid using try/catch as a first class member of my software.