<?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>194848</bug_id>
          
          <creation_ts>2019-02-19 20:45:58 -0800</creation_ts>
          <short_desc>[Code Style] Functions returning void</short_desc>
          <delta_ts>2019-02-20 09:44:27 -0800</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>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Daniel Bates">dbates</assigned_to>
          <cc>darin</cc>
    
    <cc>jond</cc>
    
    <cc>rniwa</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1507991</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2019-02-19 20:45:58 -0800</bug_when>
    <thetext>WebKit Dev thread: &lt;https://lists.webkit.org/pipermail/webkit-dev/2019-February/030439.html&gt;

It has been a long standing, unwritten policy, that return statements should be written expression-less and on their own line in functions that return void. And a return statement on its own line in a function returning void should be omitted when its effect is equivalent to falling off the end of the function.

From the WebKit dev thread (linked above), I strongly support this policy and so does Tim Horton [1]. Ryosuke Niwa seems supportive, acknowledging that WebKit &quot;tend[s] to have a separate return.&quot; and replying to Tim Horton&apos;s &quot;+1&quot; with support for codifying this unwritten policy [2]. Although he did not reply to the thread, Darin Adler has acknowledged &quot;our style has been to not return void&quot; in his remarks in bug 194485, comment 5. Alex Christensen seems to be the lone respondent that is strongly opposed to the unwritten policy [3]. All other respondents to the thread to date have expressed no strong opinion.

[1] &lt;https://lists.webkit.org/pipermail/webkit-dev/2019-February/030440.html&gt;
[2] &lt;https://lists.webkit.org/pipermail/webkit-dev/2019-February/030441.html&gt;
[3] &lt;https://lists.webkit.org/pipermail/webkit-dev/2019-February/030444.html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507994</commentid>
    <comment_count>1</comment_count>
      <attachid>362479</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2019-02-19 20:50:13 -0800</bug_when>
    <thetext>Created attachment 362479
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507995</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2019-02-19 20:51:36 -0800</bug_when>
    <thetext>When I have a moment I will look to teach the style checker to enforce this rule. I do not feel we need to wait for style checker support to move forward and amend the code style guidelines in light of the support for this policy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508003</commentid>
    <comment_count>3</comment_count>
      <attachid>362479</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-19 21:43:44 -0800</bug_when>
    <thetext>Comment on attachment 362479
Patch

As far as I can tell, there isn&apos;t a strong consensus either way.
As such, I don&apos;t think we should make this coding style guide change right now.
r-.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508007</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2019-02-19 22:23:33 -0800</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #3)
&gt; Comment on attachment 362479 [details]
&gt; Patch
&gt; 
&gt; As far as I can tell, there isn&apos;t a strong consensus either way.

Please read the bug description.

&gt; As such, I don&apos;t think we should make this coding style guide change right

You&apos;re remarks are confusing. You wrote, emphasis mine:


[[[
I much prefer doing this in my own code **but stay away from it in WebKit
because we tend to have a separate return.**
]]

AND

[[
On Thu, Feb 7, 2019 at 12:53 PM Tim Horton &lt;timothy_horton at apple.com&gt; wrote:

&gt; +1 to a style guide update
&gt;

Yeah, we **might as well as codify it in the style guideline for clarity.**

]]

Yeah, we might as well as codify it in the style guideline for clarity.

&gt; now.
&gt; r-.

I&apos;m so confused what you&apos;re position is. What is is?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508010</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2019-02-19 22:45:02 -0800</bug_when>
    <thetext>Ryosuke, your argument does not follow from the discussion as far as I can tell. I&apos;m inclined to put this up for review again because 1) your argument does not follow for the discussion 2) your comments seem to contract your own words in &lt;https://lists.webkit.org/pipermail/webkit-dev/2019-February/030441.html&gt; and 3) you have not provided any constructive criticism of the content of the patch or provided guidance on a path forward. Instead you put up a wall and tell me &quot;I don&apos;t think we should make this coding style guide change *right now*.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508099</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-20 09:44:20 -0800</bug_when>
    <thetext>(In reply to Daniel Bates from comment #5)
&gt; Ryosuke, your argument does not follow from the discussion as far as I can tell.

It totally does. Just look at the latest reply on webkit-dev. I think you misinterpreted people&apos;s responses.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>362479</attachid>
            <date>2019-02-19 20:50:13 -0800</date>
            <delta_ts>2019-02-19 21:43:44 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-194848-20190219205012.patch</filename>
            <type>text/plain</type>
            <size>2669</size>
            <attacher name="Daniel Bates">dbates</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQxNTU5Cm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2UgZm9vQ29uZGl0
aW9uOgorICAgIGNhc2UgYmFyQ29uZGl0aW9uOgorICAgICAgICByZXR1cm4gZihTaG91bGRDb250
aW51ZTo6WWVzKQorICAgIH0KKyAgICBmKFNob3VsZENvbnRpbnVlOjpObyk7CisgICAgcmV0dXJu
OworfQorYGBgCisKICMjIyBCcmFjZXMKIAogW10oI2JyYWNlcy1mdW5jdGlvbikgRnVuY3Rpb24g
ZGVmaW5pdGlvbnM6IHBsYWNlIGVhY2ggYnJhY2Ugb24gaXRzIG93biBsaW5lLgo=
</data>
<flag name="review"
          id="379101"
          type_id="1"
          status="-"
          setter="rniwa"
    />
          </attachment>
      

    </bug>

</bugzilla>