<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_default" style>On Tue, Dec 25, 2012 at 2:31 AM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank" class="cremed">silvas@purdue.edu</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
On Tue, Dec 25, 2012 at 3:10 AM, Daniel Jasper <<a href="mailto:djasper@google.com" class="cremed">djasper@google.com</a>> wrote:<br>
> } else if (aaaaaaaa ==<br>
>            bbbbbbbb) ...<br>
<br>
</div>My gut feeling is that most people would prefer this one.<br></blockquote><div><br></div><div style>Given this example, I agree. I think it gets more complicated though:</div><div style><br></div><div style><font face="courier new, monospace">} else if (aaaaaaaa ==</font></div>
<div style><font face="courier new, monospace">           bbbbbbbb &&</font></div><div style><font face="courier new, monospace">           cccccccc ==</font></div><div style><font face="courier new, monospace">           dddddddd) {</font></div>
<div style><br></div>So, here we have a bit of a conundrum. In an ideal world, what I would really like is to see an indentation strategy which indicates operator precedence easily to the reader. Now, I've never imagined actually doing this because I'd just get it wrong and never update it. But with clang-format, I think the more complex formatting might be something worth considering.... But I've not yet come up with a good set of rules that would format consistently and well while indicating precedence whenever possible. Maybe Daniel has some strategies in mind? I've not thought much about it. In this limited case, I would personally find the following ever so slightly easier to read:</div>
<div class="gmail_quote"><br><div style><font face="courier new, monospace">} else if (aaaaaaaa ==</font></div><div style><font face="courier new, monospace">               bbbbbbbb &&</font></div><div style><font face="courier new, monospace">           cccccccc ==</font></div>
<div style><font face="courier new, monospace">               dddddddd) {</font></div><div style><font face="courier new, monospace"><br></font></div><div style>Mostly this is because I subscribe to the 'black indent of 2 spaces, line continuation of 4 spaces' school of formatting, and I'm just using indentation is a blunt instrument to indicate grouping. If extra parentheses weren't used to silence valuable warnings, my preference would be:</div>
<div style><br></div><div style><div><font face="courier new, monospace">} else if ((aaaaaaaa ==</font></div><div><font face="courier new, monospace">            bbbbbbbb) &&</font></div><div><font face="courier new, monospace">           (cccccccc ==</font></div>
<div><font face="courier new, monospace">            dddddddd)) {</font></div><div><font face="courier new, monospace"><br></font></div></div></div></div></div></div>