3 ms·
> I asked if the compiler preserved the asserts when not compiling in debug mode. What was the answer?
by tomsmeding 2y ago
> I asked if the compiler preserved the asserts when not compiling in debug mode.
What was the answer?
- jbverschoor 2y agoDepends on language/platform
- rurban 2y agoGuy really had no idea about -DNDEBUG?
- 4hg4ufxhy 2y agoI wonder which option OP is implying is an issue. Either functionality is perfectly valid software engineering. I for one prefer to keep asserts in production code to fail fast. Depending on the language and domain of the program you may or may not catch them with logging to keep the program running.
- Rygian 2y agoUsing assertions to validate malicious input is not a valid software engineering choice, unless one can guarantee that the assertions will always be active in the production code.