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

In those cases I take a defensive approach.

There will be exceptions I don't know about, and that's fine. I let go the desire to fully know the set of all exceptions that can be thrown. Instead, I weaken my assumptions and code as if everything could break, and that makes code quite robust. For example, I try to arrange the code so that it is transactional, which can be easy if the approach is functional. Otherwise, places that must be protected get a catch-all handler, etc.




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

Search: