[webkit-dev] unwritten rules of webkit style

Yong Li yong.li at torchmobile.com
Wed Sep 2 12:05:51 PDT 2009


Current guideline also contains these 2 cases that {} should be used. I think when the condition is multi-lined, this should also apply. (BTW, hate the existing rule "no braces for one line". it doesn't give any benefit. worse than "always use braces")if (condition) {
    // Some comment
    doIt();
}

if (condition) {
    myFunction(reallyLongParam1, reallyLongParam2, ...
        reallyLongParam5);
}
----- Original Message ----- 
  From: David Levin 
  To: Yong Li 
  Cc: WebKit Development 
  Sent: Wednesday, September 02, 2009 2:56 PM
  Subject: Re: [webkit-dev] unwritten rules of webkit style





  On Wed, Sep 2, 2009 at 11:54 AM, Yong Li <yong.li at torchmobile.com> wrote:

    {} should be added in this case:

      if (condition1 
              && condition2)
          statement;


  Not according to current WebKit style because it is a single line statement.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090902/0c8430d9/attachment.html>


More information about the webkit-dev mailing list