<br><br><div class="gmail_quote">On Wed, Jan 16, 2013 at 7:39 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div>On Jan 16, 2013, at 2:06 , Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">
<div class="gmail_default">On Mon, Jan 14, 2013 at 8:44 AM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Jan 14, 2013 at 8:24 AM, Daniel Jasper <<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>> wrote:<br>


> Author: djasper<br>
> Date: Mon Jan 14 10:24:39 2013<br>
> New Revision: 172431<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=172431&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=172431&view=rev</a><br>
> Log:<br>
> Make single-line if statements optional.<br>
<br>
</div>Thanks!<br>
<br>
Out of curiosity, do you know how common this style is in Google's<br>
internal code? I haven't seen it much.<br></blockquote><div><br></div><div>For what it's worth, despite having written a lot of single-line if statements, I don't think this is worth options in the formatter. I think consistency and simplicity should trump here, and since there trivially exist cases that can't be on a single line, it seems of very low value to support folding onto a single line....</div>

<div><br></div><div>My two cents, and it applies both to Google's internal coding style, and my feelings on LLVM's coding style.</div></div></div></div></blockquote><br></div><div>This is pure opinion, but I actually prefer single-line if statements if the braces are omitted. It makes it clearer to me that you can't add anything to the consequent clause.</div>
<div><br></div><div>(I agree that this is not the dominant style in LLVM though, or at least not in Clang.)</div><div><br></div><div>This may eventually be subsumed by a setting to add braces to single-statement if-statement.</div>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>Jordan</div><br></font></span></div><br></blockquote><div>Actually, it should probably be a generalized setting that would apply across the board to `if`, `else`, `for`, `while` for consistency.<br>
<br>-- Matthieu<br></div></div>