[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Exception handling
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2014-01-29 21:11:42
Message-ID: 201401292211.42888.kde () carewolf ! com
[Download RAW message or body]

On Wednesday 29 January 2014, Rodrigo wrote:
> Dear all, analysing the source code of konqueror, I could figure out that
> the exception handling constructs of c++ is not frequently used in the
> project. Is there any recommendation for not using try-catch statements
> for handling errors in the project?
> 
Don't use C++ exceptions if you can avoid it, and if you must use them, keep 
them tightly controlled in an isolated part of the application. If you use 
exceptions in one place the entire call stack needs to be exception safe and 
if you use eventloop and reentrancy than can mean the entire application and 
all of its libraries. Most C++ libraries and applications are not exception 
safe, and no C libraries are, and it is hard and error prone to try to make 
them exception safe. In theory both Qt and KDE libs should be exception safe, 
but I wouldn't trust exceptions further than I could throw them ;)

`Allan
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic