[Development] Resolving coding style contentions

Ville Voutilainen ville.voutilainen at gmail.com
Mon Nov 19 21:03:06 CET 2018


On Mon, 19 Nov 2018 at 18:37, Thiago Macieira <thiago.macieira at intel.com> wrote:
>
> On Monday, 19 November 2018 02:34:09 PST Edward Welbourne wrote:
> > I note a glaring exception to that: after the opening parenthesis of
> > a parameter list, if the line would otherwise be too long:
> >
> >   auto variable =
> > QCharacteristicallyVerboseClassName::characteristicallyLongFunctionName(
> > firstParameter, secondParameter, thirdParameter, fourthParameter);
> >
> > is tolerated (well, maybe not the naming ...), but a space *without*
> > the line-break between open-paren and firstParameter is forbidden.
>
> Right, when your line would be too long, you need to break *somewhere*. Take
> this example of a long sequence with no spacing:
>
>
> QObject::tr("%1%2%3%4").arg(someFunction()).arg(otherFunction()).arg(thirdFunction()).arg(lookMaNoSpaces());
>
> This has no space at all, so much that not even the email composer can break
> it anywhere.
>
> In this case, it's often that we break before the dot, so the next line starts
> with punctuation.

I personally tend to split such things after an opening parenthesis.
Getting back to allowing ctor-initializers to be written
with a comma starting a line, I think we should just allow it; the
benefit of not having noise in a diff seems to outweigh
the minor aesthetics of it.



More information about the Development mailing list