Hacker News new | past | comments | ask | show | jobs | submit login

Excellent article!

I think about error handling quite often, because I work with data a lot, so often have to make compromises between defensiveness and 'secureness' (or whatever non-defensiveness is called). And since 'error' is sometimes a pretty subjective thing, usually it's a spectrum of options for error handling too.

A year ago, I wrote an article [0] on different 'styles' of error handling in Python specifically (via mypy). It's also potentially applicable to other languages, which have some sort of generator semantics and covariant union types (for example I've been successfully using it with JS Flow [1])

[0] https://beepb00p.xyz/mypy-error-handling.html

[1] https://flow.org/en/docs/types/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: