[Development] kdelibs coding style

Giuseppe D'Angelo dangelog at gmail.com
Mon Apr 29 22:37:10 CEST 2013


On 29 April 2013 21:20, Thiago Macieira <thiago at kde.org> wrote:
> On segunda-feira, 29 de abril de 2013 18.52.16, Giuseppe D'Angelo wrote:
>> On 29 April 2013 18:43, Thiago Macieira <thiago at kde.org> wrote:
>> > With that in mind, I would suggest we change *both* coding styles to
>> > optionally permit the braces, and strongly suggest it for more-complex
>> > conditionals.
>>
>> In Qt the braces are already mandatory if the condition spans over
>> more than one line (which is typical for complex conditions, as other
>> rules demand for lines to be properly wrapped). Are you suggesting to
>> loosen this?
>
> No, I am suggesting adding that rule, because I didn't know it was there (it
> wasn't there when I last looked at the document, in my early days in
> Trolltech).

It's there [1]
> * Exception 1: Use braces also if the parent statement covers several lines / wraps:

and
> Keep lines shorter than 100 characters; wrap if necessary

[1] http://qt-project.org/wiki/Qt_Coding_Style

I also support the idea of avoiding to remove braces if the body
collapses to one statement only.

--
Giuseppe D'Angelo



More information about the Development mailing list