That is Rust's tack:
> [assert!] assertions are always checked in both debug and release builds, and cannot be disabled.
> Unlike assert!, debug_assert! statements are only enabled in non optimized builds by default. An optimized build will omit all debug_assert! statements unless -C debug-assertions is passed to the compiler.
In sane build systems the command line is visible by default.
Non-sane build systems display wrong percentage numbers instead, but that is a different topic.
The debug vs release build is a bit of a problem still but I think part of the issue is around the idea that debug builds are too slow to use at all or take so long to build anyway so you might as well use release optimizations. This is something to address with faster compilers and better teaching (and perhaps encouraging folks to try learning how to use debuggers effectively).
https://gist.github.com/technion/7c74fad9efd1f14244e25a1cee3...
Many people do not know that their compilers optimise away assertions in `-O` ("release") builds.
They use assertions for control flow and input validation, which is very wrong.
I believe that could be trivially fixed by giving functions proper names that indicate what they do or what they are intended for. For example, calling such an optimised-away assertion function `debug_only_assert()` would immediately rule out such unintentional misuse.