[webkit-dev] [Coding Style] Clarification about multiple assignments on one line
benjamin at webkit.org
Fri Feb 22 14:50:45 PST 2013
On Fri, Feb 22, 2013 at 2:35 PM, Julien Chaffraix <jchaffraix at webkit.org>wrote:
> over several reviews, I have been saying that the following line is a
> coding style violation:
> firstVariable = secondVariable = 0;
> For a concrete example, the computePreferredLogicalWidths uses the
> following pattern:
> minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value());
I personally prefer
maxWidth = max<int>(minWidth, tableLogicalWidth.value());
minWidth = maxWidth;
minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value());
The reason is simply that it is the style widely used today (and it is
easier to follow).
Like you, I believe this is already covered by "Each statement should get
its own line." in the style.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev