<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, May 18, 2016 at 3:51 AM Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com">ppaalanen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 12 May 2016 17:20:49 +0200<br>
Miguel Angel Vico <<a href="mailto:mvicomoya@nvidia.com" target="_blank">mvicomoya@nvidia.com</a>> wrote:<br>
<br>
> Thanks Derek.<br>
><br>
> Inline.<br>
><br>
> On Thu, 12 May 2016 08:54:26 -0500<br>
> Derek Foreman <<a href="mailto:derekf@osg.samsung.com" target="_blank">derekf@osg.samsung.com</a>> wrote:<br>
><br>
> > On 11/05/16 10:53 AM, Miguel Angel Vico wrote:<br>
> > > Thanks, Yong.<br>
> > ><br>
> > > Inline.<br>
> > ><br>
> > > On Wed, 11 May 2016 09:45:15 -0500<br>
> > > Yong Bakos <<a href="mailto:junk@humanoriented.com" target="_blank">junk@humanoriented.com</a>> wrote:<br>
> > ><br>
> > >> On May 11, 2016, at 7:48 AM, Miguel A. Vico <<a href="mailto:mvicomoya@nvidia.com" target="_blank">mvicomoya@nvidia.com</a>><br>
> > >> wrote:<br>
> > >>><br>
> > >>> No functional change. This patch only renames gl_renderer_create()<br>
> > >>> to gl_renderer_display_create(), which is something more<br>
> > >>> descriptive of what the function does.<br>
> > >>><br>
> > >>> Signed-off-by: Miguel A Vico Moya <<a href="mailto:mvicomoya@nvidia.com" target="_blank">mvicomoya@nvidia.com</a>><br>
> > >>> Reviewed-by: James Jones <<a href="mailto:jajones@nvidia.com" target="_blank">jajones@nvidia.com</a>><br>
> > >><br>
> > >> Hi Miguel,<br>
> > >> When renaming, I suggest adjusting the indentation of subsequent<br>
> > >> arguments as well, to preserve alignment. Example noted inline<br>
> > >> below. I'm noticing this issue throughout this whole patch<br>
> > >> series.<br>
> > ><br>
> > > The thing is arguments aren't correctly aligned throughout all<br>
> > > weston code. I think the code-style rule of using hard-tabs instead<br>
> > > of spaces for indentation made things to be a bit messy, since<br>
> > > arguments are usually aligned using hard-tabs as well, but I think<br>
> > > spaces should be used instead for those cases in order to keep a<br>
> > > correct indentation regardless tab length settings of the editor.<br>
> ><br>
> > The style of this weston source code is to use hard tabs, 8 chars<br>
> > wide. It won't look right in an editor configured with any other tab<br>
> > width.<br>
> ><br>
> > I'm with Yong on this one - if you're going to rename a function, it's<br>
> > preferable to fix up the indenting at the same time for those call<br>
> > sites (even if they didn't match the style guidelines before). This<br>
> > fix-up should be done with tabs for alignment.<br>
> ><br>
> > Otherwise trivial refactoring patches would rapidly make the code look<br>
> > terrible.<br>
><br>
> Okay, sounds sane to me too. I'll send an updated patch.<br>
><br>
> ><br>
> > For what it's worth, I personally prefer tabs for indenting and spaces<br>
> > for alignment -<br>
><br>
> I prefer spaces for everything, but I can live with tabs for<br>
> indenting and spaces for alignment :-)<br>
><br>
> > but that's not what this project uses, so it's not<br>
> > what I use on this project. :)<br>
><br>
> I double-checked code-style rules here:<br>
><br>
> <a href="https://cgit.freedesktop.org/wayland/wayland/tree/doc/Contributing" rel="noreferrer" target="_blank">https://cgit.freedesktop.org/wayland/wayland/tree/doc/Contributing</a><br>
><br>
> and wrt alignment it only states:<br>
><br>
> - when breaking lines with functions calls, the parameters are aligned<br>
> with the opening parentheses;<br>
><br>
> To me, that doesn't mean we shouldn't use spaces for alignment.<br>
<br>
Hi,<br>
<br>
as with all styles, there are exceptions.<br>
<br>
When breaking lines and aligning, it often does not happen exactly at a<br>
hard-tab boundary, so use spaces for the final adjustment.<br>
<br>
However, if any single argument to a function call cannot be reasonably<br>
fit by the alignment requirement without breaking the max line length,<br>
then (at least I have) you can forget the alignment to the opening<br>
parenthesis and just indent as far as you can and align there, using<br>
hard-tabs only.<br>
<br>
Sometimes it might be preferable to use shortcut variables, sometimes<br>
not. Rules can be bent if it is necessary for style consistency and<br>
readability. After all, the whole point of a style definition is to make<br>
things more readable to everyone on average, and almost always<br>
consistency in style helps that, so people should follow the project<br>
style rather than personal preferences.<br>
<br>
And yes, Weston does not rigorously follow the defined style to the<br>
point absolutely everywhere. Sometimes it is just better to land a v6<br>
of a patch than to go a few more review cycles to hone the style. Even<br>
reviewers can get tired of it, and we're usually short on review<br>
bandwidth anyway.<br></blockquote><div><br></div><div>In fairness, we'd likely be less short on review bandwidth if the majority of that bandwidth was not in use to make/revise trivial criticisms such as whitespace usage and comment grammar which are guaranteed to be cleaned up in future patches; this leads to burnout on both the code-writing side as well as the reviewing side since everyone has become hyper attuned to the insignificant and non-functional minutiae of patches rather than focusing more on expediting the technical development of the protocol.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Thanks,<br>
pq<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div></div>