[Qt-interest] Qt and C++ exceptions
Paul Floyd
paulf at free.fr
Sat May 23 12:36:19 CEST 2009
Maxim Egorov wrote:
> Why qt does not use exceptions? This is a very powerful mechanism which allows to significantly simplify the processing of errors and create more reliable software. I have read http://qt.gitorious.org/qt/pages/CodingConventions and was amazed. I think this is a very strange decision. It seems to me that so hard to find C + + compiler does not support exceptions. So I think it would be wise to consider support for exceptions to be one of the most important tasks.
Two things
a) When Qt was originally developed, not all compilers supported
exceptions, so the core components were written using relatively
unsophisticated C++ (no exceptions, no fancy templates). Other than
easing portability, in my experience exceptions and fancy templates
usually mean poor performance and code bloat (and long compile times).
b) Exceptions are difficult (read Herb Sutter for gory details). I'm not
sure that I'd want to use a library that forced me to try to write
exception safe code.
A+
Paul
--
Paul Floyd http://paulf.free.fr
More information about the Qt-interest-old
mailing list