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

List:       kde-devel
Subject:    Re: C++ exceptions
From:       David Johnson <david () usermode ! org>
Date:       2005-12-06 7:49:49
Message-ID: 200512052349.49465.david () usermode ! org
[Download RAW message or body]

On Monday 05 December 2005 11:17 pm, Guillaume Laurent wrote:

> Nobody disputes that they are pitfalls, nobody claims they are a
> panacea either. But discarding them because they can be misused is
> silly. This same discussion pattern applies to just every C++ feature
> (templates, multiple inheritance, STL, pick yours).

You're missing my point.

My point is that the nature of exception propagation means that it's an 
all or nothing affair. If a library uses it (such as kdelibs), then 
every application using that library must also use it or risk not 
catching a thrown exception.

The same is not true for templates, multiple inheritance, STL, 
iostreams, RTTI, etc. While all of these are important, if they are not 
exposed in the API, then the application developer is not compelled to 
use them.

The reason this is important is because C++ is a BIG language. It is 
unrealistic to expect a developer to use all parts of the language all 
the time. One thing I especially like about Qt is that you can be 
quickly productive without comprehensive expertise in all parts of the 
C++ language. A library which demands comprehensive knowledge (such as 
Boost) severly limits its audience.

My argument isn't that exception are bad, or even dangerous. Rather it's 
that exceptions should not be part of a general purpose library's API.

-- 
David Johnson
 
>> 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