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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>One of the stupidest most bike-sheddy things I absolutely loved about Elm was the commas prepended to new lines. Lists like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[ :apple
, :banana
, :cherry
]
</code></pre>
<p>so that the elements are all left aligned and you never worry about trailing commas.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356690" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/65">Post #64</a>
	                </div>
	            </div>
              <div id="likers-container-356690" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356690"
                     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 #64"></div>
  </section>
</div>
    <div class="postbit" id="356692" data-post-id="356692">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is that really how Elm works?  Is it not this?:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[ :apple
, :banana
, :cherry
]
</code></pre>
<p>If so, that just translates the trailing comma problem to the preceeding comma problem.  I’ll give you that it is less common to append than to prepend but it still doesn’t help the diff situation.  Although, if it allows double commas like that, that is a whole other thing!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356692" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/66">Post #65</a>
	                </div>
	            </div>
              <div id="likers-container-356692" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356692"
                     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 #65"></div>
  </section>
</div>
    <div class="postbit" id="356695" data-post-id="356695">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is it really about language or just a code formatting preference? I believe you can achieve that with a custom formatter plugin. That’s said I don’t really like this idea. If we would really go for a custom formatting plugin then I would simply allow trailing comma even on the last element (when the map or list has more than one line.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356695" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/67">Post #66</a>
	                </div>
	            </div>
              <div id="likers-container-356695" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356695"
                     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 #66"></div>
  </section>
</div>
    <div class="postbit" id="356696" data-post-id="356696">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>haha, yeah that was my bad. It’s not double commas. But it’s also not an issue with the preceding comma because you’d have it on a whole new line and visually find it immediately if the formatter didn’t already handle it for you (which it does).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356696" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/68">Post #67</a>
	                </div>
	            </div>
              <div id="likers-container-356696" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356696"
                     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 #67"></div>
  </section>
</div>
    <div class="postbit" id="356730" data-post-id="356730">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/eiji" rel="nofollow">@Eiji</a> I was specifically talking about the doubled up commas <a class="mention" href="/u/stevensonmt" rel="nofollow">@stevensonmt</a> had erroneously included (and has now fixed).</p>
<p>I have no problem with this style and actually like it.  My main point is that for me the real advantage of trailing commas is for cleaner diffs when appending to a list, this style gives you the same problem when prepending.</p>
<p>Otherwise, they are super convenient but I personally don’t care about too much about not having them.  I would absolutely use them if the formatter allowed it but actually prefer it visually without them, so I have a love/hate relationship with the formatter there.</p>
<p>One thing that absolutely does drive me nuts and I can never get used to is this style of tuple return for LiveViews:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{:noreply,
 socket
 |&gt; assign(:foo, "foo")
 |&gt; assign(:bar, "bar")}
</code></pre>
<p>My team at work uses this and multiple times per week I go to append a new assign and add it after the <code>}</code>.  It’s an easy fix but gives me a visceral reaction every time.  I know it’s prevalent and have seen people preach it as GoodStyle, but I do not (and will not) understand the aversion to assigning variables.</p>
<p>EDIT: I wrote “arrows” instead of “commas” (WTH? <img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" 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="356730" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/69">Post #68</a>
	                </div>
	            </div>
              <div id="likers-container-356730" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356730"
                     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 #68"></div>
  </section>
</div>
    <div class="postbit" id="356739" data-post-id="356739">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You can write a macro or a function to solve this depending on what you prefer.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># if block returns socket wrap it in noreply
handle_event :some_message, _params, socket do
  socket
  # …
  |&gt; reply(some: :data)
end

# if returns a tuple leave it as-is
handle_event :other_message, _params, socket do
  socket
  # …
end

# otherwise warn/raise error
handle_event :bugged, _params, socket do
  :oops
end

defp reply(socket, data) do
  {:reply, data, socket}
end
</code></pre>
<p>It would be awesome if by default <code>Phoenix</code> would use <code>:noreply</code> and allow to reply with <code>assign/2</code> or <code>reply/2</code> function instead of wrapping it in the tuple.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">assign(socket, :phx_reply, some: :data)
# or
reply(socket, some: :data)
</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="356739" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/70">Post #69</a>
	                </div>
	            </div>
              <div id="likers-container-356739" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356739"
                     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 #69"></div>
  </section>
</div>
    <div class="postbit" id="356741" data-post-id="356741">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ha, I tried those out for a while and didn’t like it.  I much prefer re-binding a <code>socket</code> variable and doing <code>{:noreply, socket}</code> (though I will do <code>{:noreply, assign(socket, :foo, :bar)}</code> if there is only one assign).  It’s verbose, but it’s explicit and readable.  I have snippets that makes writing them painless, though I should really be using AI by this point—I’m just old and slow.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356741" data-batch-url="/posts/batch_likers">
                        5
                      </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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/71">Post #70</a>
	                </div>
	            </div>
              <div id="likers-container-356741" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356741"
                     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 #70"></div>
  </section>
</div>
    <div class="postbit" id="356747" data-post-id="356747">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>For those that like this style, <a href="https://hexdocs.pm/moar/Moar.Sugar.html" rel="noopener nofollow ugc">Moar.Sugar</a> implements a bunch of these. You can add the library to your project or just <a href="https://github.com/synchronal/moar/blob/main/lib/sugar.ex" rel="noopener nofollow ugc">copy the code</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356747" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/72">Post #71</a>
	                </div>
	            </div>
              <div id="likers-container-356747" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356747"
                     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 #71"></div>
  </section>
</div>
    <div class="postbit" id="356755" data-post-id="356755">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Very cool library. I do think the function names are not consistent with normal Elixir conventions. Like <code>noreply/1</code> and <code>noreply!/1</code> are not analogous to <code>Map.fetch</code> and <code>Map.fetch!</code>. The <code>noreply</code>/<code>noreply!</code> pair do inverse things to their arguments (wrap vs unwrap) whereas <code>fetch</code>/<code>fetch!</code> do the same things and differ in how they handle errors. Put another way, it’s the argument type that differs rather than the handling of the arguments. The specs from the <code>Map</code> module docs for <code>fetch</code> and <code>fetch!</code>:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">@spec fetch(map(), key()) :: {:ok, value()} | :error


@spec fetch!(map(), key()) :: value()
</code></pre>
<p>versus for <code>Moar.Sugar.noreply</code> and <code>Moar.Sugar.noreply!</code></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">@spec noreply(term()) :: {:noreply, term()}

@spec noreply!({:noreply, term()}) :: term()
</code></pre>
<p>Maybe this doesn’t matter to anyone else, but I would find it less confusing to have <code>unwrap</code> in the name of functions that unwrap tuples, with an <code>unwrap!</code> variant that raises an exception rather than returning an error if there is one. I do love little convenience libraries like this though.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356755" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/73">Post #72</a>
	                </div>
	            </div>
              <div id="likers-container-356755" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356755"
                     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 #72"></div>
  </section>
</div>
    <div class="postbit" id="356759" data-post-id="356759">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Looks like a perfect backstory for the creation of yet another library! <img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" 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="356759" 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/what-are-the-remaining-gaps-in-the-elixir-ecosystem/69307/74">Post #73</a>
	                </div>
	            </div>
              <div id="likers-container-356759" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356759"
                     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 #73"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/69307/load_more?page=8">Load more posts (20 remaining)</a>
</div></template></turbo-stream>