[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: C++ exceptions
From:       "Henning Westerholt" <henning-05 () die ! informatik ! uni-siegen ! de>
Date:       2005-12-05 12:22:21
Message-ID: 57155.141.99.50.219.1133785341.squirrel () www
[Download RAW message or body]

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 <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic