4 ms·
This reminds me of the Qt framework which is C++ but doesn't make any use of exceptions. Before I worked with Qt, I never thought this was possible without sac
by vog 15y ago
This reminds me of the Qt framework which is C++ but doesn't make any use of exceptions.
Before I worked with Qt, I never thought this was possible without sacrificing the API, but the Qt API is very clean and doesn't seem to suffer from that design decision. So I looked around in the Qt API for some time, trying to learn how they managed to get along without exceptions. And I think I finally got it.
The whole error handling in Qt mostly boils down to providing sensible null objects. That is, instead of using NULL pointers (as in C) or generic null objects (as in JavaScript), for all kinds of objects there are specialized null objects which behave sensible to the most possible extent.