Skip to content

Comment on Control structures in programming languages: from goto to algebraic effectsparent

Comments

>I really like checked exceptions in Java because it's very easy to see how developers are handling errors and they also form part of the function signature.

Errors as return values also form part of the function signature in many languages.

>Most functions will just pass on exceptions verbatim so it's better than error return values because with them the entire codebase has to be littered with error handling, compared to fewer try catch blocks.

The question is whether you think that calls that might pass an error up the call chain should be marked as such. I think they should be.

I wouldn't call this "littered with error handling" just because a certain language has decided to do this in a way that resembles industrial style fly-tipping rather than just littering.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.