Why You Should Never Disable Asserts in Production
By
May 31, 2026 • 14 min read • by Loris Cro
A five-star bake. Worth schmearing, sharing, saving.
Summary
The article argues that disabling asserts in production is a harmful practice, contrary to common belief. It explores how asserts serve as critical documentation and runtime checks that enforce program invariants, and disabling them removes safety nets that catch bugs early. The author uses Zig's std.debug.assert as a starting point but generalizes the argument to software engineering best practices, emphasizing that asserts should remain enabled in production to maintain code reliability and developer confidence.
Key quotes
· 4 pulledFear is the killer of the mind ...and the codebase as well.
I think 'disabling asserts in prod' is a pretty common technique, yeah?
As far as I know that is probably a correct statement, but I believe it to be an irredeemably bad practice.
An assert is a line of code that introduces a new fact to the program, such as 'this argument can never be null', or 'this integer can never be even'.
You might also wanna read
A critique of misusing "backpressure" in AI code-generation system design
This article critiques Lucas Costa's piece on building systems for code-generating AI robots, arguing that Costa misuses the term "backpress
Three Years In: A Senior Engineer's Reflection on AI's Impact on the Software Development Role
A senior engineer reflects on the long-term sustainability of AI tools in software development, three years into deep organizational adoptio
Three Years In: A Senior Engineer's Reflection on AI's Impact on the Software Development Role
A senior engineer reflects on the long-term sustainability of AI tools in software development, three years into deep organizational adoptio
Bijou64: A variable-length integer encoding that's both correct and accidentally fast
This article describes the development of bijou64, a variable-length integer (varint) encoding created for the Subduction CRDT sync protocol
Bijou64: A variable-length integer encoding that's both correct and accidentally fast
This article describes the development of bijou64, a variable-length integer (varint) encoding created for the Subduction CRDT sync protocol
Domain Expertise, Not Code, Is the True Competitive Advantage in Software
The article argues that true competitive advantage ("moat") in software has always been domain expertise—deep understanding of the business
