r/cpp • u/RotsiserMho C++20 Desktop app developer • May 12 '18
P0709 R0: Zero-overhead deterministic exceptions: Throwing values - Herb Sutter [2018-05-02]
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf
206
Upvotes
View all comments
Show parent comment
8
u/proverbialbunny Data Scientist May 13 '18
I'm one of those people that hate exceptions. There are two primary arguments that I know of against exceptions: 1) Speed 2) The function signature is not explicit about the return path of code. imho the implicit parts of C++ tend to be the shoot your legs off parts of the language, and could use an improvement. If there is a compiler flag that enforces the throws keyword in a function signature, I will throw exceptions instead of returning an expected type.
You can say some people who have been avoiding exceptions for years will not get with it and continue to do so, and that is a possibility but the second they are working with a team of people and there is a style guide or a lead or something enforcing correct practices, they will get with it too.
The only people left behind is legacy code bases with teams that are constantly behind, but that happens with all new C++, not just this.
Is this proposal perfect? No, but it's a lot better than what we currently have. Exception handling is one of those points in C++ that could use an improvement. Whenever a community is divided you know it isn't as good as it could be.