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

Engineer:

“It crashed on an assert…”

Pointy haired boss:

“… well, what are you waiting for!? remove all the asserts so it doesn’t crash any more!”





it's funny because I have seen the opposite. Engineer: "it crashed because it dereferenced a null pointer" boss: "add null pointer checks everywhere!"

... and because it used "if" instead of "assert", it made the null pointer arg a valid argument, making it a tolerable state of the running software, which displaced the locus of crashes far from the source of the issue. Moral of the story, use "assert" to make it crash as early as possible and debug THAT. You want to restrict the representable states in the software, not expand them by adding null checks everywhere.




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

Search: