<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>30538</bug_id>
          
          <creation_ts>2009-10-19 14:40:38 -0700</creation_ts>
          <short_desc>Replace boolean operator indentation example with an if statement.</short_desc>
          <delta_ts>2010-06-10 19:21:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Website</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Andrew Scherkus">scherkus</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>levin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>155915</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Scherkus">scherkus</who>
    <bug_when>2009-10-19 14:40:38 -0700</bug_when>
    <thetext>As Dave Levin pointed out in https://bugs.webkit.org/show_bug.cgi?id=30529 my || should have been on the next line.

The style guide gives an example using a &quot;return&quot; statement, however there are many instances in WebKit today that contradicts that rule and place the operators at the end of the line.

If &quot;if&quot; statements are not an exception, then I&apos;d suggest replacing the example to use an if statement.  You&apos;re more likely to write if statements than return statements so this example should prevent further style violations from happening.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155917</commentid>
    <comment_count>1</comment_count>
      <attachid>41453</attachid>
    <who name="Andrew Scherkus">scherkus</who>
    <bug_when>2009-10-19 14:42:12 -0700</bug_when>
    <thetext>Created attachment 41453
Round 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155927</commentid>
    <comment_count>2</comment_count>
      <attachid>41453</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-10-19 14:57:12 -0700</bug_when>
    <thetext>Comment on attachment 41453
Round 1

OK.  :shrug:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155934</commentid>
    <comment_count>3</comment_count>
      <attachid>41453</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-19 15:10:46 -0700</bug_when>
    <thetext>Comment on attachment 41453
Round 1

Clearing flags on attachment: 41453

Committed r49816: &lt;http://trac.webkit.org/changeset/49816&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155935</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-19 15:10:50 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155993</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-10-19 17:17:53 -0700</bug_when>
    <thetext>I specifically chose a return statement rather than an if statement, because of the problem where the boolean operator lines end up lined up with the statement in the body of the if.

In the past we have discussed indenting one additional level to avoid that problem, but this was contentious enough that I wanted to leave it out until we discussed it.

I am *not* sure that what you checked in here represents our style recommendation, and I wish we had some discussion of it before it was landed!

I would write:

    if (a
            || b)
        return;

Not:

    if (a
        || b)
        return;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155995</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-10-19 17:23:10 -0700</bug_when>
    <thetext>Happy to revert it.  We can also make an additional checkin which makes specific all of these cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155996</commentid>
    <comment_count>7</comment_count>
    <who name="Andrew Scherkus">scherkus</who>
    <bug_when>2009-10-19 17:23:57 -0700</bug_when>
    <thetext>Eeek -- sorry :(

I&apos;m fine reverting -- I was just confused at what the proper style should be and grepping the code base didn&apos;t give any consistent answers.

How about we start the discussion on webkit-dev?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>41453</attachid>
            <date>2009-10-19 14:42:12 -0700</date>
            <delta_ts>2010-06-10 19:21:35 -0700</delta_ts>
            <desc>Round 1</desc>
            <filename>boolean_style.patch</filename>
            <type>text/plain</type>
            <size>1552</size>
            <attacher name="Andrew Scherkus">scherkus</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdFNpdGUvQ2hhbmdlTG9nIGIvV2ViS2l0U2l0ZS9DaGFuZ2VMb2cK
aW5kZXggYjFmNjg4MC4uMTgzMDIyOCAxMDA2NDQKLS0tIGEvV2ViS2l0U2l0ZS9DaGFuZ2VMb2cK
KysrIGIvV2ViS2l0U2l0ZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxMyBAQAorMjAwOS0xMC0xOSAg
QW5kcmV3IFNjaGVya3VzICA8c2NoZXJrdXNAY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIFJlcGxhY2UgYm9vbGVhbiBvcGVyYXRv
ciBpbmRlbnRhdGlvbiBleGFtcGxlIHdpdGggYW4gaWYgc3RhdGVtZW50LgorCisgICAgICAgIGh0
dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0zMDUzOAorCisgICAgICAgICog
Y29kaW5nL2NvZGluZy1zdHlsZS5odG1sOiBSZXBsYWNlIGJvb2xlYW4gaW5kZW50aW5nIGV4YW1w
bGUgdG8gdXNlICJpZiIKKwogMjAwOS0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