[gnomemm] gnome-vfsmm and throw() lists



Hi,

I noticed that almost all methods in libgnome-vfsmm are declared with a
throw() list.  Just one example to clarify what I'm talking about:

    void Gnome::Vfs::Handle::close() throw(exception);

It looks like throw() lists are being abused for documentation purposes,
which is a bad idea.  IMHO throw lists should be used only for certain
critical functions/methods -- for instance, several methods of the
std::exception class are defined not to throw in order to avoid the
situation of having to deal with exceptions thrown by the exception
handling mechanism.

A while ago I explained on gtkmm-list what a throw() list actually does.
Here's the link:

    http://marc.theaimsgroup.com/?l=gtkmm&m=101515928306805&w=2

Another issue:  Gnome::Vfs::exception doesn't conform to the naming
conventions of the *mm libraries -- that is, I think it should be named
Gnome::Vfs::Exception instead.  This would also avoid possible confusion
with std::exception, i.e. if an older compiler that makes std:: optional
is being used (like gcc 2.95).

Fortunately the libgnome-vfsmm API is not yet frozen and thus can still
be fixed.  Any comments?

Cheers,
--Daniel





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]