You'll find that almost all C++ game middleware will avoid exceptions too
*cough* https://raw.githubusercontent.com/KhronosGroup/Vulkan-Hpp/master/vulkan/vulkan.hpp
Sorry, I couldn't resist :)
That kind of proves my point :)
They use C for a stable ABI, and then in their C++ wrapper, they let you choose between an API with strict preconditions and undefined behaviour if you violate those contracts, or, an API that tolerates invalid code by implementing a contract validation layer that throws exceptions. If they only had the latter API, it would be regarded as broken and unusable by many users, not to mention being unnecessarily bloated (correct code doesn't need the validation layer)... And if they only had the former, it would be regarded as broken and unusable by a different set of users, not to mention being unnecessarily fragile and error-prone. It's as if C++ is actually two (or more) completely distinct languages.
They're doing the right thing by making a multi-layered API that's usable by everyone.
the benefits of exceptions vs. all the alternatives have been demonstrated again and again, and with numbers to back that up.
Exactly; exception-free C++ code has enormous code maintainability benefits, which is the real reason why no one uses them in serious large scale projects.
( :wink: yes I'm trolling you, Bregma )
It is interesting though that our two different communities have completely different common sense here. My experience with gamedevs has common sense saying that C++ exceptions add a huge amount of extra complexity to the entire code base for very little gain, and that a good use for the construct is extremely rare anyway (we tend to have pseudo-realtime loops made up of many parallel and asynchronous tasks, resulting in call-stacks that have no relationship to task hierarchies anyway)... Meanwhile your experience with professional FOSS app dev has pretty much completely opposite lessons / conclusions :|