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

Java, if coded properly, ensures that a NullPointerException means that something went really, really wrong - in which case you're better off terminating than doing anything else. For variables that are expected to be missing occasionally, there are the Optional types or Collections/Lists, which I use extensively.


It’s an exception not an error, you can easily catch that, which may make sense eg. when you run third party extensions that should not bring down your whole program.




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

Search: