<div dir="ltr">On Tue, Aug 13, 2013 at 4:37 AM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="im">On Tue, Aug 13, 2013 at 12:08 AM, Peter Kasting <span dir="ltr"><<a href="mailto:pkasting@chromium.org" target="_blank">pkasting@chromium.org</a>></span> wrote:<br>




<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 dir="ltr"><div>"All the existing code does it another way" is a strong enough reason to me.<br>
</div></div></blockquote><div><br></div></div><div>It would be, but that is simply not the case. It is hard to come up with good numbers, but e.g. compare the numbers for ":" on the new and old lines:</div>




<div><br></div><div><a href="https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?.*%5Cn%5C%20*%5C:)%20-file:v8%20-file:usr/include%20lang:cc%20pcre:yes&all=1&sq=package:chromium&type=cs" target="_blank">https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?.*%5Cn%5C%20*%5C:)%20-file:v8%20-file:usr/include%20lang:cc%20pcre:yes&all=1&sq=package:chromium&type=cs</a></div>





<div><br></div><div><a href="https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?%5Cn%7B0,1%7D.*%5C%20%5C:$)%20-file:v8%20-file:usr/include%20lang:cc%20pcre:yes&sq=package:chromium&type=cs&all=1" target="_blank">https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?%5Cn%7B0,1%7D.*%5C%20%5C:$)%20-file:v8%20-file:usr/include%20lang:cc%20pcre:yes&sq=package:chromium&type=cs&all=1</a><br>





</div><div><br></div><div>I have tried to tune the regular expressions to include all cases where the conditional expression is broken around the ":". The result is about 400:1000 (this time excluding v8 and usr/include). Yes, it is a preference, but clang-format's style is far from unprecedented.</div>
</div></div></div></blockquote><div><br></div><div>Two more tweaks your regex needs to make:</div><div>(1) Exclude third_party.</div><div>(2) Count the cases that break after '?' and _not_ around ':', i.e.</div>
<div><br></div><div>a ?</div><div>     b : c;</div><div><br></div><div>When both of these are done, you have 260 results formatted your way versus 1282 formatted mine*.</div><div><br></div><div>To me this is compelling.</div>
<div><br></div><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="im">




<div><span style="color:rgb(34,34,34)">1) I don't want to flip-flop. You are the first Chromium developer to complain about this.</span></div></div></div></div></div></blockquote><div><br></div><div>AFAIK based on mast chromium-dev mails, clang-format has not even worked on Chromium code until comparatively recently, and is not an explicitly encouraged part of our workflow.  Certainly there are developers using it, but I would be surprised if it was as much as even 20% of Chromium devs, and most of them not for more than a couple of months.</div>
<div><br></div><div>I would not go so far as to concluded that no one has a positive opinion about this style, but I don't think it's valid to conclude that "many others like it" either.</div><div><br></div>
<div>PK</div><div><br></div><div>*Here are the actual regexes:</div><div><br></div><div><a href="https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?.*%5Cn%5C%20*%5C:)%20-file:v8%20-file:usr/include%20-file:third_party%20lang:cc%20pcre:yes&sq=package:chromium&type=cs">https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?.*%5Cn%5C%20*%5C:)%20-file:v8%20-file:usr/include%20-file:third_party%20lang:cc%20pcre:yes&sq=package:chromium&type=cs</a><br>
</div><div><br></div><div>vs.</div><div><br></div><div><a href="https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?%5Cn%7B0,1%7D.*%5C%20%5C:$)%20-file:v8%20-file:usr/include%20-file:third_party%20lang:cc%20pcre:yes&sq=package:chromium&type=cs">https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?%5Cn%7B0,1%7D.*%5C%20%5C:$)%20-file:v8%20-file:usr/include%20-file:third_party%20lang:cc%20pcre:yes&sq=package:chromium&type=cs</a><br>
</div><div><br></div><div>+</div><div><br></div><div><a href="https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?%5Cn.*%5C%20%5C:.%2B$)%20-file:v8%20-file:usr/include%20-file:third_party%20lang:cc%20pcre:yes&sq=package:chromium&type=cs">https://code.google.com/p/chromium/codesearch#search/&q=(?m:%5C?%5Cn.*%5C%20%5C:.%2B$)%20-file:v8%20-file:usr/include%20-file:third_party%20lang:cc%20pcre:yes&sq=package:chromium&type=cs</a><br>
</div></div></div></div>