[API] Some more cleanup ideas

Lubos Lunak l.lunak at suse.cz
Mon Dec 3 04:42:11 PST 2012

On Monday 03 of December 2012, Michael Meeks wrote:
> On Fri, 2012-11-30 at 18:53 +0100, Lubos Lunak wrote:
> > On Friday 30 of November 2012, Stephan Bergmann wrote:
> > > I'm not sure this is a good move.
> ...
> > > Which leaves us with the benefit of shorter, less visually cluttered
> > > declarations of C++ functions.  But, as I argue above, I am not sure
> > > that is an overall benefit at all.
> 	I'm convinced it is a benefit :-) - and it's interesting; there have
> been a string of decisions in the past where we have decided to go for
> more readable code over (IMHO) gross verbosity:
> -	rtl::OUString( RTL_USTRING_VERYLONGNAME( "foo" ) )
> +	"foo"
> 	to me is a -massive- improvement in readability. More minor ones are:
> -	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.

> 	So - IMHO it would be -far- better to have a magic clang plugin to
> build a database of what methods are called by what other methods, and
> what signatures they have, and what exceptions they throw as the code
> compiles - and post build to dump a list of offending methods: I suspect
> we will have a lot of them to fix.
> 	Then leave that on on the tinderbox in perpetuity to enforce
> cleanliness, allowing us to remove the signatures, make the code more
> readable, and stop bothering about another set of constraints as we
> write / review code :-) And of course, I'd love to write that plugin
> myself if no-one beats me to it ;-)

 Sounds like an interesting project, mainly because it may turn out to be 
bloody difficult (consider e.g. calling something via a function pointer). 
But ok, I'll pass on that one myself :).

 Lubos Lunak
 l.lunak at suse.cz

More information about the LibreOffice mailing list