From kde-devel Mon Dec 05 12:22:21 2005 From: "Henning Westerholt" Date: Mon, 05 Dec 2005 12:22:21 +0000 To: kde-devel Subject: Re: C++ exceptions Message-Id: <57155.141.99.50.219.1133785341.squirrel () www> X-MARC-Message: https://marc.info/?l=kde-devel&m=113378540309286 On Mo, 5.12.2005, 12:23, Michael Buesch sagte: > Although my opinion might not count much here, I think the > exceptions are one of the big _misfeatures_ of the C++ language. > They bloat code. Nothing else. Sorry, i must protest here. Exception in c++ could be very useful, and are also used within the kde project, for example in khtml. > Everything done with exceptions, can be done with normal return codes. You are right, but the solution with exception is easier to use (and to code). The errors are also more understandable, for example compare "return code -4" to "System.IO.FileNotFoundException". You can embed text messages in the exception classes and use them to report the error directly to the user, you can use inheritance to structurize your errors.. E.g. if the FileNotFoundException is not caught, try again against the IO Exception. If you have sometimes worked on a nontrivial project in java, you would have another opinion about exceptions.. I would like to see the code bloat problems fixed (if possible), so they could be used more within the c++/ kde world. Best regards, Henning >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<