[API] Some more cleanup ideas

Thorsten Behrens thb at documentfoundation.org
Thu Dec 6 10:51:44 PST 2012


Lubos Lunak wrote:
> > -	rtl::OUString
> > +	OUString
> 
>  You cannot compare these with exception specifications. The examples above, 
> barring very corner cases, are only about readability and nothing else, while 
> exception specifications are not. Arguing that we should remove exception 
> specifications is more like arguing that we should remove all asserts.
> 
While I'm not standing in the way of keeping them, I still consider
them useless in 99% of all cases (quite in contrast to asserts).
That might be coloured by personal experience, frequency of finding
bugs with it (~zero), and the general unspecificity (or should I 
say, thoughtlessness) of their use throughout the API.

For large parts of UNO, making one not violate the exception
specification, would look like this:

 try {
   <functions>
 } catch(...) {
   throw uno::RuntimeException("Arrgh! General $FOO error!!1!");
 }

That is not what I would call error handling.

Mixing ivory-tower musing about ES usefulness & hand-waving
arguments about developers paying attention to their
self-documenting presence, and the real, actual benefits they bring
(or don't bring) to our UNO API implementation is at least not
getting us the ideal solution. ;)

My 2 cents,

-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20121206/2cef9701/attachment.pgp>


More information about the LibreOffice mailing list