[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: Dmitry Kazakov <dimula73 () gmail ! com>
Date: 2010-01-19 21:32:51
Message-ID: ae32c1ef1001191332j14ac87feue37d4f2910d6a901 () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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
[Attachment #5 (text/html)]
<br><br><div class="gmail_quote">On Tue, Jan 19, 2010 at 5:47 PM, Jaroslaw \
S <span dir="ltr"><<a \
href="mailto:kexipl@gmail.com">kexipl@gmail.com</a>></span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex;"> 2010/1/19 Inge Wallin \
<<a href="mailto:inge@lysator.liu.se">inge@lysator.liu.se</a>>:<br> \
<div class="im">> On Monday 18 January 2010 09:14:32 Thomas Zander \
wrote:<br> >> On Sunday 17. January 2010 20.53.44 Dmitry Kazakov \
wrote:<br> >> > I know it is good to keep the code in a good \
consistent style. But here<br> >> > is a piece of code, changed by \
automated astyle commit:<br> >><br>
>> []<br>
>><br>
>> > if (child &&<br>
>> > child->channelFlags().isEmpty() \
&&<br> >> > child->projection() \
&&<br> >> > child->visible() \
&&<br> >> > child->opacity() == \
OPACITY_OPAQUE &&<br> >> > \
*child->projection()->colorSpace() == *colorSpace()) {<br> \
>><br> >> For this reason I now write the double ampersand at \
the start of a line,<br> >> which makes it still legal coding \
style, but easier to read.<br> >> So;<br>
>> if (foo<br>
>> && bar)<br>
>><br>
><br>
> I know that Thomas and I don't always have the same opinions on \
style but on<br> > this one I'm with him 100%.<br>
><br>
> Reading something like<br>
><br>
> if ( a very looooooooooooooooooooong and coooooooomplicated \
expression &&<br> > something else that is very \
complicated ||<br> > foo)<br>
<br>
</div>btw, I am using one extra tiny guideline here: for multiline<br>
conditions I move{ to the new line and align operators:<br>
<br>
if ( averylooooooooooooooooooooong and coooooooomplicated \
expression<br> <div class="im"> && something else that is \
very complicated<br> && foo)<br>
</div>{<br>
//....<br>
}<br>
<br>
this way for me it is harder to confuse the second and third line of<br>
the condition with the body of the \
if.</blockquote><div><br></div><div>Doesn't astyle "fixes" \
this? ;) </div></div><br>-- <br>Dmitry Kazakov<br>
_______________________________________________
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