On Tue, Jan 19, 2010 at 5:47 PM, Jaroslaw S <kexipl@gmail.com> wrote:
2010/1/19 Inge Wallin <inge@lysator.liu.se>:
> On Monday 18 January 2010 09:14:32 Thomas Zander wrote:
>> On Sunday 17. January 2010 20.53.44 Dmitry Kazakov wrote:
>> > I know it is good to keep the code in a good consistent style. But here
>> > is a piece of code, changed by automated astyle commit:
>>
>> []
>>
>> >         if (child &&
>> >                 child->channelFlags().isEmpty() &&
>> >                 child->projection() &&
>> >                 child->visible() &&
>> >                 child->opacity() == OPACITY_OPAQUE &&
>> >                 *child->projection()->colorSpace() == *colorSpace()) {
>>
>> For this reason I now write the double ampersand at the start of a line,
>>  which makes it still legal coding style, but easier to read.
>> So;
>>   if (foo
>>           && bar)
>>
>
> I know that Thomas and I don't always have the same opinions on style but on
> this one I'm with him 100%.
>
> Reading something like
>
>  if ( a very looooooooooooooooooooong and coooooooomplicated expression  &&
>       something else that is very complicated ||
>       foo)

btw,  I am using one extra tiny guideline here: for multiline
conditions I move{ to the new line and align operators:

if (    averylooooooooooooooooooooong and coooooooomplicated expression
    && something else that is very complicated
    && foo)
{
 //....
}

this way for me it is harder to confuse the second and third line of
the condition with the body of the if.

Doesn't astyle "fixes" this? ;) 

--
Dmitry Kazakov