Hacker News new | ask | show | jobs
by bombcar 1833 days ago
> Earlier this week we got a bug report about the game freezing, consuming all of the available RAM, and then crashing when it ran out of RAM. It was again a modded save file so my first instinct was to blame it on a mod. Again, I had to test it. And again... it's never what you think it is.

> So, I still repeat the phrase: "Crashing on dereferencing null? Just add a null check!" as a reminder to myself and others to always look deeper into why and never stop at the basic symptom of a problem.

I feel this is a very important rule that people often forget - most anytime your "safety" code triggers, something went wrong somewhere else and it can be worth tracking it down.

1 comments

It's a perfect example of how useful it is to think in terms of what invariants should hold and why.