faq
flatforty
contribute
subscribe
configure
search
rdf
main
parent
thread
|
Re: Support for exceptions
by Richard Garand on Saturday 10/Jul/2004, @13:21
|
I've been doing some work on the C# bindings for Qt and KDE so that I can port a program, and for that program I found that using the CLR's XML reading classes is much easier than using Qt's, because i can use a single exception handler to catch and report all file loading errors. Exceptions can be inconvenient sometimes, but this is a case where they make things much easier (in C# it's expected that you'll catch exceptions for anything that goes wrong, unlike C++, but it still shows how error handling with the Qt classes could be simplified).
For people who argue that an unhandled exception is the same to a user as a segfault, libraries like Qt could add a catchall statement in the main loop that would report the error and allow the user to continue; well written code will ensure that this is possible without leaving a mess behind. Common causes of segfaults, like null pointer accesses, could work the same way since they don't actually damage the program's state, but the process will just exit wherever it is instead of going up the stack and cleaning up everything. |
|
|