Why does QT use so few exceptions?
I am developing Java programs since 3 years, so I very often work with exceptions. I wonder why QT does not use them as oftens. It seems that they are used as less as possible. Can somebody explain, why?
When Qt was started exceptions were not available for all the compilers that needed to be supported by Qt. Today we are trying to keep the APIs consistent, so modules that have a history of not using exceptions will generally not get new code using exceptions added.
You will notice exceptions are used in some of the new modules of Qt.
Denis: For consistency we should not mix error handling styles in modules, so I can not see this happen without causing a mayor version number change (since the non-exception style would need to get removed which will break source compatibility).
But this is just my opinion: I am not aware of any plans for Qt 5 or later.
Some of them are explained here [parashift.com]
And keep in mind:
there is NO one size fits all! Exceptions might work wel for one case, but not for the other.