[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Concerning automated astyle application to the code
From:       Inge Wallin <inge () lysator ! liu ! se>
Date:       2010-01-19 13:48:13
Message-ID: 201001191448.13176.inge () lysator ! liu ! se
[Download RAW message or body]

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)

is much more difficult than the way that Thomas suggests above.  In fact, I 
added this to the Marble coding style in addition to the kdelibs guidelines 
when I used to work there a lot.

	-Inge
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic