• Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    14 hours ago

    Yeah, I was gonna say, error handling easily makes up 80+% of the code paths, and depending on whether you’re building a library or service or script etc., different strategies are most suitable for how to deal with those code paths.

    In a script, you often just want it to crash. In a library, you want to make these code paths matchable, in case the user cares why something failed. And then you have the awkward in-between, which is that 99% of your application codebase will be used by your main-function like a library, but you don’t want to spend as much effort on error handling for that as a proper library does, in particular also because you know what all consumers of your application-library need to know.

    So, it’s kind of multiple different problems, with overlap, and people are hoping for one easy solution to cover all these problems.