> Was it ever? I thought that the idea of exceptions in C++ was always "no cost if not thrown".
Long, long ago enabling exceptions would add some overhead to all functions. When "zero cost exceptions" went mainstream it was a bit of a big deal, but a lot of people didn't read the memo and still argue about their cost.
Either way, I'm not a fan of exceptions in any language. I'd prefer an Either<Result, Error> return value any day.
2 comments
[ 3.0 ms ] story [ 12.9 ms ] thread> all popular languages have context-free (or “nearly” context-free) grammars, while C++ has undecidable grammar
The article quotes the FQA as saying that. Notice how this neatly defines C++ as "not a popular language", against all evidence of real-world use.
> Yossi also echoes the claim that adding exception handling always adds a runtime cost even when no exception is thrown. This is no longer true.
Was it ever? I thought that the idea of exceptions in C++ was always "no cost if not thrown".
> Manual memory management should not be used.
Well, it shouldn't be used except to build abstractions that insulate you from manual memory management.
Long, long ago enabling exceptions would add some overhead to all functions. When "zero cost exceptions" went mainstream it was a bit of a big deal, but a lot of people didn't read the memo and still argue about their cost.
Either way, I'm not a fan of exceptions in any language. I'd prefer an Either<Result, Error> return value any day.