[Development] commas in ctor-init-lists

Mark Gaiser markg85 at gmail.com
Wed Jun 1 15:06:16 CEST 2016


On Wed, Jun 1, 2016 at 2:41 PM, Marc Mutz <marc.mutz at kdab.com> wrote:

> Hi,
>
> There seems to have been a silent underground move to uglify the Qt sources
> , by using commas to introduce lines
> . I have no idea where this came from
> , but it looks butt
> -ugly and it is in violation of http
> ://wiki
> .qt
> .io
> /Qt_Coding_Style
>
> QFoo::QFoo()
>   : QBase(),
>     m_f1(),
>     m_f2()
> {
>
> }
>
> -not-
>
> QFoo::QFoo()
>   : QBase()
>   , m_f1()
>   , m_f2()
> {
>
> }
>
> (http://wiki.qt.io/Qt_Coding_Style#Line_breaks 2nd item: "Commas go at the
> _end_ of wrapped lines")
>
> Thanks,
> Marc
>
>
The "butt-ugly" style looks more readable to me.
And imho it reduces the possibility of forgetting a forgetting a comma in
the begin since then your arguments will look out of alignment.

Funny in the coding style you mention. For operators: "An operator at the
end of the line is easy to miss if the editor is too narrow." The exact
same could be said for commas at the end of the line.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160601/3fbc38f0/attachment.html>


More information about the Development mailing list