Any time I see code hit a null pointer exception like 20 stack frames deep from ...

@rocketsoup@mastodon.social

Any time I see code hit a null pointer exception like 20 stack frames deep from where that value originated, a value that "will never be null", I get really irritated.

Add assertions for every assumption you're making, and put them as early in the flow as possible. Type check, null check, validate everything.

Write antagonistic, oppositional, distrustful code. Write code that is jaded by countless broken promises. Adopt the attitude of a DMV clerk tapping the sign for the 90th time that day.