Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> if you forgot to check for it then at least your program wouldn't crash

If I forgot to check for null (or missing data) then I would rather have my program to raise an exception (to prevent data corruption). Then my error handling code will email that exception to me. I will analyze exception message (NPE) and stack trace. Then I will fix my program and deploy it to production.



Depends on the context. In game engines it's quite common to just render a generic pattern when a texture could not be found, instead of crashing the whole game. That's a good use for this pattern, not so good example would be in a bank transaction backend.




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

Search: