[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">&lt;<a href="mailto:kexipl@gmail.com">kexipl@gmail.com</a>&gt;</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 &lt;<a \
href="mailto:inge@lysator.liu.se">inge@lysator.liu.se</a>&gt;:<br> <div \
class="im">&gt; On Monday 18 January 2010 09:14:32 Thomas Zander wrote:<br> &gt;&gt; \
On Sunday 17. January 2010 20.53.44 Dmitry Kazakov wrote:<br> &gt;&gt; &gt; I know it \
is good to keep the code in a good consistent style. But here<br> &gt;&gt; &gt; is a \
piece of code, changed by automated astyle commit:<br> &gt;&gt;<br>
&gt;&gt; []<br>
&gt;&gt;<br>
&gt;&gt; &gt;             if (child &amp;&amp;<br>
&gt;&gt; &gt;                         child-&gt;channelFlags().isEmpty() \
&amp;&amp;<br> &gt;&gt; &gt;                         child-&gt;projection() \
&amp;&amp;<br> &gt;&gt; &gt;                         child-&gt;visible() \
&amp;&amp;<br> &gt;&gt; &gt;                         child-&gt;opacity() == \
OPACITY_OPAQUE &amp;&amp;<br> &gt;&gt; &gt;                         \
*child-&gt;projection()-&gt;colorSpace() == *colorSpace()) {<br> &gt;&gt;<br>
&gt;&gt; For this reason I now write the double ampersand at the start of a line,<br>
&gt;&gt;   which makes it still legal coding style, but easier to read.<br>
&gt;&gt; So;<br>
&gt;&gt;    if (foo<br>
&gt;&gt;                &amp;&amp; bar)<br>
&gt;&gt;<br>
&gt;<br>
&gt; I know that Thomas and I don&#39;t always have the same opinions on style but \
on<br> &gt; this one I&#39;m with him 100%.<br>
&gt;<br>
&gt; Reading something like<br>
&gt;<br>
&gt;   if ( a very looooooooooooooooooooong and coooooooomplicated expression   \
&amp;&amp;<br> &gt;          something else that is very complicated ||<br>
&gt;          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">       &amp;&amp; something else that is very complicated<br>
       &amp;&amp; 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&#39;t \
astyle &quot;fixes&quot; 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