Falsehoods Programmers Believe About Null Pointers
2025-02-01

This article debunks common misconceptions about null pointers. It explores fallacies ranging from the simple (dereferencing a null pointer doesn't always crash the program immediately) to the bizarre (the null pointer's address isn't always 0). The author argues against relying on compiler optimizations or hardware specifics, highlighting the dangers of assuming consistent behavior across platforms. The article emphasizes that C should be treated as a higher-level language, not just "portable assembler," and encourages leveraging modern languages' memory safety features for more robust and portable code.
Development
null pointer