3 ms·
This article doesn't have a clue. For example: > but many C++ programmers disable exceptions for performance I have never seen a project like this for 10+some
by chaotic-good 10y ago
This article doesn't have a clue. For example:
> but many C++ programmers disable exceptions for performance
I have never seen a project like this for 10+something years. The only piece of code with disabled exceptions that I've seen was created for Atmel controllers. And in modern C++ exceptions is zero-cost. Your paying for exceptions only when they occur so, nobody is disabling exceptions now.
This is not the only line that bugs me but I don't have enough time for it right now.
- panic 10y agoThere are reasons to disable exceptions aside from performance. Google's C++ style guide (which bans their use) discusses some of the pros and cons: https://google.github.io/styleguide/cppguide.html#Exceptions https://google.github.io/styleguide/cppguide.html#Exceptions
- chaotic-good 10y agoI saw this first time many years ago. It clearly states that exceptions is a good thing but shouldn't be used in Google's projects because their code is not prepared for exceptions: > On their face, the benefits of using exceptions outweigh the costs, especially in new projects. However, for existing code, the introduction of exceptions has implications on all dependent code. If exceptions can be propagated beyond a new project, it also becomes problematic to integrate the new project into existing exception-free code. Because most existing C++ code at Google is not prepared to deal with exceptions, it is comparatively difficult to adopt new code that generates exceptions. And most importantly, I don't think that they're disabling exceptions using compiler flag. I'm sure that they just using error codes for error handling instead of exceptions.
- santaclaus 10y ago> nobody is disabling exceptions now Embedded people still disable exceptions.