[webkit-dev] Proposing style guide change regarding braces on conditional arms

Mark Rowe mrowe at apple.com
Wed Dec 2 22:07:15 PST 2009

On 2009-12-02, at 21:46, Peter Kasting wrote:

> On Wed, Dec 2, 2009 at 9:19 PM, Mark Rowe <mrowe at apple.com> wrote:
> On 2009-12-02, at 21:00, Peter Kasting wrote:
> > I find this tricky to read and error-prone.  I propose that the rule be modified to be:
> >
> > * When all arms of a conditional or loop are one physical line, do not use braces.  If any arms are more than one physical line (even if they are one logical line), use braces on all arms.
> I do not agree that this would be an improvement.
> Are you satisfied with the existing rule, then?

I am satisfied with the existing rule, and I have seen nothing to support the suggestion that a change to the rule would provide additional benefits.

> > In most places this will not differ from the existing code, so it will not "cause the whole codebase to become invalid";
> I glanced briefly at three files: RenderObject.cpp, Element.cpp and Node.cpp.  In these three files I counted over two dozen places that would require modification to conform with this new rule.  That's by no means a majority of the relevant statements in these files, but it's not a small number either.
> I stand by my statement. 

I was not putting this forward as my reasoning for not changing the style, merely as a data point.

- Mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20091202/b9845678/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3166 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20091202/b9845678/attachment.bin>

More information about the webkit-dev mailing list