<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 29, 2014 at 6:14 PM, Haroogan <span dir="ltr"><<a href="mailto:Haroogan@gmail.com" target="_blank" class="cremed">Haroogan@gmail.com</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">Hello Daniel,<br>
<br>
Thank you for answering. OK, I might add it myself as time permits, although<br>
I assumed that it would be quite simple to add for those who directly work<br>
on ClangFormat given the framework that is behind.<br>
<br>
Breaking after "::" is esoecially useful with class method definitions.<br>
Don't have to go far to search for example, just look into Clang or LLVM<br>
code base. A name of class could well be 40 characters long. If a method<br>
name is around 20 characters, then you just have 20 characters left for<br>
parentheses and parameters (assuming you've already wrapped return type<br>
according to 1st proposed option). Of course you can wrap parameters, but<br>
the point is that when you are scanning/looking through source code, the<br>
"MyVeryVeryVeryVeryVeryUsefulSuperClass::" is irrelevant to you as you are<br>
more interested in the name of method which is easier to track when it<br>
starts from the beginning of line and not pushed to the middle of the line<br>
by the "MyVeryVeryVeryVeryVeryUsefulSuperClass::". For the same reason GNU<br>
decided to wrap return types. Why would we treat (routine-like in their<br>
nature) class scope resolutions differently?<br></blockquote><div><br></div><div>Several reasons:</div><div>- Mostly, readability is about pattern matching. If you are used to things being formatted like this, it is easier to read for you. If you are used to different patterns, you find other layouts easier to read. People always try to make arguments like "this is better because..." (sometimes adding and "obviously"). And the answer is always: "It is not that simple".</div>
<div>- Vertical space: Readability is usually influenced by how much you can fit on a screen. If your eyes can easily switch forward and back, e.g. between a variable declaration and its use, this can help readability in places. Yes, screens are getting larger, but this remains a factor.</div>
<div>- Easier/more intuitive search: Some people might be used to search for "Class::Method". Of course you can come up with smarter queries, but this is what people frequently do. Class name and method name kind of belong together in some people's eyes.</div>
<div>- ..</div><div><br></div><div>However, I am not even trying to convince you to change the coding style. I just haven't seen it in the wild (and don't know of a public coding style that recommends it). Yes, it would be a reasonably easy change (although it would take a few hours taking into account writing decent tests etc.), but so are most of the others (e.g. <a href="http://llvm.org/bugs/buglist.cgi?product=clang&component=Formatter&resolution=---&list_id=55266">http://llvm.org/bugs/buglist.cgi?product=clang&component=Formatter&resolution=---&list_id=55266</a> plus hundreds of internal bugs/feature requests). So, it is a matter of prioritization and this close to the bottom of my list.</div>
<div><br></div><div>Cheers,</div><div>Daniel</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">
Regards,<br>
Alexander<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/ClangFormat-Additional-Options-Proposal-tp4038901p4039163.html" target="_blank" class="cremed">http://clang-developers.42468.n3.nabble.com/ClangFormat-Additional-Options-Proposal-tp4038901p4039163.html</a><br>
<div class=""><div class="h5">Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" class="cremed">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>