Hacker News new | ask | show | jobs
by doublerabbit 2177 days ago
Interesting, from that slide I should always null my variables after I'm finished with them.
1 comments

If they're globals, then yes you should. Having dangling pointers anywhere, even in supposedly unused areas, tends to come back and bite you.

For locals, why bother? The optimizer will probably discard the writes, and worrying about stack addresses being reused is a waste of mental space and clutters the code.