[Development] gsl::owner (Was: Setters: Clarifying the ownership)

André Pönitz apoenitz at t-online.de
Wed Aug 1 10:50:31 CEST 2018


On Tue, Jul 31, 2018 at 02:51:41PM +0200, Giuseppe D'Angelo via Development wrote:
> Hi,
> 
> On 31/07/18 13:11, Sérgio Martins via Development wrote:
> > I would recommend however that our docs show T* instead of gsl::owner<T>
> > and continue to include "Takes ownership of foo" in the text.
> > While I believe in self-documenting signatures I think it's too much
> > noise and hurts readability, and most devs never heard of gsl.
> > 
> > Should be just an aid for tooling IMO.
> 
> I agree with the rest of your email, but I kind of disagree with this
> particular point, for different reasons:
> 
> 
> * Because we need to educate our users that there's more C++ than Qt out
> there, and the Core Guidelines and the GSL are a fundamental part of
> knowledge for a C++ developer.

Pluralis Majestatis?

"Educating [o]ur users" etc are not exactly unworthy goals, but when it
comes to using that as reason *against* traditional Qt principles like
"consistent API", "ease of use" I don't think this "[w]e" covers everybody
here. Certainly not "Us".

> [...]
> * Leaving gsl::owner in the signature of a function documentation can help
> clarify situations where the textual documentation does not say anything
> about the ownership.

And that can and should be solved be adding the corresponding stanza to
the docs, not by doc uglification. In case they were really missing, and
this is not just speculation.

> However, from a practical point of view, unless someone adds gsl::owner
> _everywhere_ to Qt, we can't report it in the docs, as they would otherwise
> be inconsistent :-(

"We" appreciate that You consider inconsistency a problem. 1/2 ;-)

Andre'



More information about the Development mailing list