Skip to content

Everything in C is undefined behavior

6.5 relevance
Score Breakdown
technical depth
9
novelty
6
actionability
5
community
8
strategic
3
personal
5

Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.

Deep dive on undefined behavior in C, high community engagement but not core interest.

2026-05-20 general Hacker News (100+)
Summary

All nontrivial C and C++ code contains undefined behavior (UB), making correct programs impossible, argues a veteran developer. UB includes subtle cases like misaligned pointer access (C23 6.3.2.3) — safe on x86 but deadly on SPARC or Alpha — and compilers assume such UB never occurs, even without optimizations. This 'telephone game' means code that works today may break on future architectures or compiler versions.

Key Takeaway

Evaluate Rust or Go for any new systems-level code that replaces C/C++ to avoid undefined behavior and future-proof your infrastructure.

Why it matters

For a platform/solutions architect, this reinforces the argument for adopting memory-safe languages like Rust or Go in new systems programming to eliminate UB risks that threaten reliability and security at scale.

Full Article

If he had been a programmer, Cardinal Richelieu would have said “Give me six lines written by the hand of the most expert C programmer in the world, and I will find enough in them to trigger undefined behavior”. Nobody can write correct C, or C++. And I say that as someone who’s written C and C++ on an almost daily basis for about 30 years. I listen to C++ podcasts. I watch C++ conference talks. I enjoy reading and writing C++. C++ has served us well, but it’s 2026, and the environment of 1985 (C++) or 1972 (C) is not the environment of today.