13 May
2020
13 May
'20
4:23 p.m.
On Thu, May 14, 2020 at 2:20 AM
I'm working with developers that have decided to use asserts every time they want to throw an exception. I feel that their should be something that dissuades this behavior in the language design. This could be making asserts not recoverable, making it so you can't stop assert failures from printing to stdout, forcing the return code to -1 on process termination if an assert fails, or something else.
There is something! Run your code with -OO and those asserts won't happen any more. You can easily demonstrate that this will then break their code, and thus prove that asserts are not the right tool to use. ChrisA