Raymond Chen's take on so-called zero cost exceptions
Guillaume Piolat
first.last at gmail.com
Mon Feb 28 23:01:46 UTC 2022
On Monday, 28 February 2022 at 20:33:17 UTC, Walter Bright wrote:
> "The presence of exceptions means that the code generation is
> subject to constraints that don’t show up explicitly in the
> code generation
In my C++ years, exceptions in combination with RAII were the
best barrier of defense against leaks and bugs in error paths.
Also they would allow C++ constructors to fail, and error codes
didn't. Worse, with error codes, people routinely conflated
runtime errors and unrecoverable errors. Performance is imo a
false concern here since 1. either code that should be fast is
devoid of eror handling in the first place 2. correctness of
whole codebases is at stake 3. you can always make a correct
program faster, but there will be noone to realize the incorrect
program is incorrect.
More information about the Digitalmars-d
mailing list