J
JohnQ
Scenario: A GUI program is developed such that the startup sequence is
controlled by the instantiation of a key object which instantiates other
objects etc. until it finally arrives at the point where it is waiting in
the message loop for messages to be put in its queue.
That is, unless something goes wrong during one of those object
instantiations in the program startup processing! Say somewhere in the
middle of all that startup processing, something does go wrong. Well, if the
objects were built with the RAII/exception architecture, the stack would
unwind back to the catch point. At which point, just maybe, an error would
be logged and the program would abort.
Or maybe, knowing that the OS is going to clean up resources for us when the
program aborts, maybe it is a lot simpler just to program the objects so
that they log and abort (sans exceptions) whenever they encounter error.
Whaddaya think?
John
controlled by the instantiation of a key object which instantiates other
objects etc. until it finally arrives at the point where it is waiting in
the message loop for messages to be put in its queue.
That is, unless something goes wrong during one of those object
instantiations in the program startup processing! Say somewhere in the
middle of all that startup processing, something does go wrong. Well, if the
objects were built with the RAII/exception architecture, the stack would
unwind back to the catch point. At which point, just maybe, an error would
be logged and the program would abort.
Or maybe, knowing that the OS is going to clean up resources for us when the
program aborts, maybe it is a lot simpler just to program the objects so
that they log and abort (sans exceptions) whenever they encounter error.
Whaddaya think?
John