top | item 46740712

(no title)

rauli_ | 1 month ago

Unchecked exceptions will eventually lead into programs crashing because some developer forgot to catch specific type of exception somewhere.

discuss

order

drysine|1 month ago

And developers never forget to check error codes.

dan00|1 month ago

Looking at code, it‘s easier to spot the missing check for an error code, than a not catched exceptions.

Also error codes are part of the signature of a function, which exceptions aren‘t.

ahtihn|1 month ago

That seems like a better outcome than continuing when an error happened while thinking everything succeeded?

yunnpp|1 month ago

Yes, but that's not a dichotomy. Languages like Java have function declare what exceptions they throw, and the caller must either catch it or also declare that it throws it. Gets cumbersome quickly, but I believe it's for the best to encode exceptions at the type system.