3 ms·
Terrible idea. Why would you want multiple mechanisms for handling error conditions?
by rerdavies 4y ago
Terrible idea. Why would you want multiple mechanisms for handling error conditions?
- extasia 4y agoAre you talking about assert vs Exception at the end of the article?
- thesneakin 4y agoAssert usually throws an exception in most environments.
- jimbobimbo 4y ago...in debug configurations. And compiled out in release configurations. This makes it useless for checking user input. (OK for a library code, when input is validated higher in the stack.)
- simplotek 4y ago> Assert usually throws an exception in most environments. Not really. In C and C++, an assert() calls std:abort. In custom implementations it does whatever you'd like it to do. I've seen assert() call asm('int13;') out of convenience. I never see an exception once.