[Development] RFC: more liberal 'auto' rules?

Bubke Marco Marco.Bubke at theqtcompany.com
Fri Dec 4 16:27:35 CET 2015




On December 4, 2015 10:45:19 Blasche Alexander <alexander.blasche at theqtcompany.com> wrote:

>> -----Original Message-----
>> From: Development [mailto:development-bounces at qt-project.org] On Behalf
>> Of Thiago Macieira
>> Sent: Friday, 4 December 2015 9:14
>> To: development at qt-project.org
>> Subject: Re: [Development] RFC: more liberal 'auto' rules?
>> 
>> On Friday 04 December 2015 08:49:14 Marc Mutz wrote:
>> > > Qt has enough market share by itself that we can choose our own direction
>> > > and still be relevant. We are allowed to disagree with what others do.
>> >
>> > Yes, but only if we know *better*.
>> >
>> > I very much doubt that more than very few people in Qt development have the
>> > knowledge to objectively overrule the accepted C++ authorities.
>> 
>> That's why we use the mailing list and discuss the issue. Our collective minds
>> together are quite powerful.
>
> First of all I'd like to point out that I agree with Thiago and Randall. In fact, I added the auto policy to the Qt coding conventions.
>
> This policy has been in place for much longer in Qt Creator (and therefore the Qt version  just an adoption). I had my fair share of arguing over what is better or worse readability wise. At the end of the day it's subjective which makes argumentation about right or wrong harder. For me the point is that if I have to look up a function signature to figure out what type is behind the return values auto type then that's bad. An always auto policy is just asking for such situations. 

With the clang code model it is quite easy to provide that information. In my opinion it is better to give your functions and variables descriptive names so you don't need to look for the declaration. 

For Test Driven Development it is better to use auto if you must exchange types with mocks. So the interface(concepts) is important but not the type.

>> You're calling for "opt-in by default" approach, while I am calling for an
>> "opt-out by default" approach.
>
> +1
> --
> Alex
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
Sent from cellphone 



More information about the Development mailing list