[Development] The age-old T* foo vs. T *foo

Ville Voutilainen ville.voutilainen at gmail.com
Sat Oct 19 23:14:29 CEST 2019

On Fri, 18 Oct 2019 at 19:53, Edward Welbourne <edward.welbourne at qt.io> wrote:
> Putting the * or & to the left of the space promotes the lazy reading of
> a declaration as being
>   type name;
> which works just fine for the most common cases, but lulls readers into
> using a mental model that will leave them entirely unprepared for the
> subtleties that arise when anything trickier happens.

This logical argument doesn't work. There's evidently no such lull,
nor does putting the type-meta-modifiers
next to the variable name result in a deeper understanding of how
declarators work, again evidently.
However, read below.

> And, in any case, it is senseless to change this in a whole code-base.

Agreed. It would indeed be a massive change, so there are very few
opportunities to make such
a change, and as time passes on, they get weaker and weaker due to
sheer inertia. We are,
apparently, past that point. I am going to admit that we are, and I
would like to emphasize that
I don't think it's a passive-aggressive admission of defeat. Changing
is something I speak against of in other contexts, like re-indenting,
so I appreciate and agree with what
Eddy and Andre are saying, for the most important parts. The only last
straw I have is that I don't think
the technical arguments for the status quo make much sense, but
consistency and inertia matter.
But, as I tend to say, and what always makes Simon chuckle, I can live
with that.

More information about the Development mailing list