<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="122935" data-post-id="122935">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Erlang-Core-Team" data-username="joeerl" data-post="30" data-topic="21156">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/joeerl/48/6651_2.png" class="avatar"> joeerl:</div>
<blockquote>
<p>Umm - should you terminate English sentences with a comma instead of a period, in case you want to reorder the sub-clauses,</p>
</blockquote>
</aside>
<p>English isn’t programming.  Heck english isn’t even nicely parseable in any way.  ^.^</p>
<p>It is more akin to each statement being ended with a period in English.  ^.^</p>
<aside class="quote no-group" data-username="LostKobrakai" data-post="31" data-topic="21156" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lostkobrakai/48/3072_2.png" class="avatar"> LostKobrakai:</div>
<blockquote>
<p>I find no trailing comma to be better readable. About the reordering / diffing argument I kinda feel like that could also be solved by more intelligent editors/diffing algorithms and mustn’t be done by me adding more commas.</p>
</blockquote>
</aside>
<p>I find it less readable as it is a weird discontinuity:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[
  Something.longCall(1, 2, andmore()),
  Blah.blorp("hello", "world"),
  Breep.gorp(6.28, 42)
]
</code></pre>
<p>Compared to the thing that actually follows the same pattern on every line:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[
  Something.longCall(1, 2, andmore()),
  Blah.blorp("hello", "world"),
  Breep.gorp(6.28, 42),
]
</code></pre>
<p>No weird discontinuities there.  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122935" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-122935" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122935"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="122955" data-post-id="122955">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="32" data-topic="21156">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>No weird discontinuities there. <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
</blockquote>
</aside>
<p>Sure there is - there’s a comma and nothing that follows; feels like something is missing (or was forgotten). No comma means I’m done; comma implies there is more to come.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122955" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-122955" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122955"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="122965" data-post-id="122965">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="peerreynders" data-post="33" data-topic="21156">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>Sure there is - there’s a comma and nothing that follows; feels like something is missing (or was forgotten). No comma means I’m done; comma implies there is more to come.</p>
</blockquote>
</aside>
<p>Sure there is, the end tag of the list <code>]</code> follows it.  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>To me a comma at the end of an item means that item is ‘terminated’ in the listing.  It is a separator when used on a single line, a terminator when on multi-line.</p>
<p>This is like in OCaml, do you do a prefix <code>|</code> or not?  I.E. would you do a match like this:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">match blah with
  1 -&gt; "1"
| 2 -&gt; "2"
| 3 -&gt; "3"
| _ -&gt; "?"
</code></pre>
<p>Or would you do it like this?</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">match blah with
| 1 -&gt; "1"
| 2 -&gt; "2"
| 3 -&gt; "3"
| _ -&gt; "?"
</code></pre>
<p>The <code>|</code> is a case separator, it technically should not be before the first one, you can even write it like this just fine either way:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">match blah with 1 -&gt; "1" | 2 -&gt; "2" | 3 -&gt; "3" | _ -&gt; "?"

match blah with | 1 -&gt; "1" | 2 -&gt; "2" | 3 -&gt; "3" | _ -&gt; "?"
</code></pre>
<p>Yet most people will write it with a prefix <code>|</code> on the first one when multiline and without a prefix <code>|</code> on a single line.  Same thing when writing <code>,</code> on the last line in a list of elements as well, or rather a <code>;</code> is a list separator in OCaml:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">(* Single line *)
let some_list = [1; 2; 3; 4]

(* Multi line *)
let some_list = [
  1;
  2;
  3;
]
</code></pre>
<p>You can of course do it backwards if you so wish though I rarely see this done:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">(* Single line *)
let some_list = [1; 2; 3; 4;]

(* Multi line *)
let some_list = [
  1;
  2;
  3
]
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122965" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-122965" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122965"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="122969" data-post-id="122969">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="34" data-topic="21156">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>To me a comma at the end of an item means that item is ‘terminated’ in the listing.</p>
</blockquote>
</aside>
<p>That seems revisionary to justify trailing commas.</p>
<p>A comma either</p>
<ul>
<li>separates <strong>two</strong> adjacent items that could be otherwise mistaken as being one or</li>
<li>joins <strong>two</strong> obviously distinct adjacent items into one structured whole</li>
</ul>
<p>Trailing commas are a fairly recent thing.</p>
<p>The version control system excuse is just another case of DX winning over UX - lets not bother dealing with this in the diffing logic (and the few developers dealing with it) but rather download this to millions of users of the version control system by adjusting their habits and forcing programming languages to alter the semantics of punctuation characters.</p>
<p>As much as some people may hate the idea of leading commas - at least that is a self-contained solution that doesn’t impose responsibilities elsewhere.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122969" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-122969" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122969"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="122972" data-post-id="122972">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I find that level of strictness off-putting and needlessly nitpicky. Programming languages, editors, IDEs and tooling are meant to serve the humans, not the opposite.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122972" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-122972" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122972"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="122973" data-post-id="122973">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hauleth" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/120/18942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hauleth
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="peerreynders" data-post="35" data-topic="21156">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>lets not bother dealing with this in the diffing logic</p>
</blockquote>
</aside>
<p>This can be a little bit of the problem, for the same reason why by default all changes in whitespaces also are present in Git diffs. The reason for that is that you can send output of <code>git diff</code> (the default one) to the other person and this is perfectly valid diff which that person can apply that diff using standard tools, with requiring the default diff tools to omit commas it could result in incorrect diffs (as commas are required by the syntax in most languages, while whitespaces aren’t).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122973" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-122973" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122973"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #36"></div>
  </section>
</div>
    <div class="postbit" id="122975" data-post-id="122975">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="peerreynders" data-post="35" data-topic="21156">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/48/5826_2.png" class="avatar"> peerreynders:</div>
<blockquote>
<p>A comma either</p>
<ul>
<li>separates <strong>two</strong> adjacent items that could be otherwise mistaken as being one or</li>
<li>joins <strong>two</strong> obviously distinct adjacent items into one structured whole</li>
</ul>
</blockquote>
</aside>
<p>You could just as easily separate using whitespace and disambiguate via parenthesis as well.</p>
<p>But still, this is not the only time this pattern has popped up (and a trailing comma I know was accepted in at least fortran (and later modula-3, which also had an optional leading <code>|</code> too) back when I was a child, so it’s quite a few decades old pattern at this point).  One big thing is semicolons.  In just about any older language that use a semicolon as a statement separator (*cough*C*cough*, and erlang uses semicolons too!) they did not allow trailing semicolons.  Eventually C when standardized accepted the extra odd semicolon without giving you a syntax error (it just ignored it until finally the standardization required it).</p>
<p>Thus following the idea that ‘because they separate items’ then there should be no trailing comma also states that ‘because they separate statements’ then there should be no trailing semicolons.  Do you subscribe to this as well or do you think it is special cased for some reason in a way that lists are not?  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="dimitarvp" data-post="36" data-topic="21156" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>I find that level of strictness off-putting and needlessly nitpicky. Programming languages, editors, IDEs and tooling are meant to serve the humans, not the opposite.</p>
</blockquote>
</aside>
<p>Exactly this.  This is why the trailing semicolon was eventually accepted as ‘human noise’ by most languages (not all, look at most ML languages!), because it helps the human even though it is noise to the compiler.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122975" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-122975" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122975"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #37"></div>
  </section>
</div>
    <div class="postbit" id="122980" data-post-id="122980">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hauleth" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/120/18942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hauleth
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="38" data-topic="21156">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>‘because they separate statements’</p>
</blockquote>
</aside>
<p>I would argue that nothing is also some kind of statement.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="122980" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-you-always-add-a-trailing-comma/21156/39">Post #38</a>
	                </div>
	            </div>
              <div id="likers-container-122980" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="122980"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>