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

Mark Rowe mrowe at apple.com
Wed Dec 2 21:19:31 PST 2009


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.

> 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.

- Mark

-------------- 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/940c3ebb/attachment.bin>


More information about the webkit-dev mailing list