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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Something that this thread makes me believe—though I’m sure others will likely disagree—is that the formatter is too aggressive. I may prefer a formatter that has a little more respect for the author’s whitespace choices. Consistent code is a worthy goal, but perhaps it would be easier to infer some decisions from the author, rather than attempt to maximize the utility of a single style (or require additional configuration in the case of locals_without_parens).</p>
<p>+10 on 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="55418" 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/running-the-new-elixir-formatter/9344/63">Post #62</a>
	                </div>
	            </div>
              <div id="likers-container-55418" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55418"
                     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 #62"></div>
  </section>
</div>
    <div class="postbit" id="55419" data-post-id="55419">
  <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="net" data-post="63" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/net/48/429_2.png" class="avatar"> net:</div>
<blockquote>
<p>Something that this thread makes me believe—though I’m sure others will likely disagree—is that the formatter is too aggressive. I may prefer a formatter that has a little more respect for the author’s whitespace choices. Consistent code is a worthy goal, but perhaps it would be easier to infer some decisions from the author, rather than attempt to maximize the utility of a single style (or require additional configuration in the case of locals_without_parens).</p>
</blockquote>
</aside>
<p>Hear hear.  I <em><strong>love</strong></em> most of what the formatter does.  Just in a few cases I really <em>really</em> do not want it to touch some things.  ^.^;</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="55419" 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/running-the-new-elixir-formatter/9344/64">Post #63</a>
	                </div>
	            </div>
              <div id="likers-container-55419" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55419"
                     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 #63"></div>
  </section>
</div>
    <div class="postbit" id="55420" data-post-id="55420">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="62" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>The fact we are rewriting this is really bad, haha. Please open up another issue.</p>
</blockquote>
</aside>
<p>I’m sorry, I don’t understand. What exactly are we/you rewriting? <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="55420" 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/running-the-new-elixir-formatter/9344/65">Post #64</a>
	                </div>
	            </div>
              <div id="likers-container-55420" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55420"
                     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="55421" data-post-id="55421">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="61" data-topic="9344">
<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>all within an unquote seems exceedingly</p>
</blockquote>
</aside>
<p>I would store it as a module attribute and then access it in the function body.</p>
<aside class="quote no-group" data-username="NobbZ" data-post="60" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/48/27235_2.png" class="avatar"> NobbZ:</div>
<blockquote>
<p>So why did you remove trailing comma then?</p>
</blockquote>
</aside>
<p>You are right. That’s <strong>the</strong> argument for trailing commas but no parens calls in Elixir make trailing commas a bit inconsistent. For example, you can’t do:</p>
<pre><code>defstruct foo: :bar,
          baz: :bat,
</code></pre>
<p>So we felt adding trailing commas could actually cause misunderstandings due to this “inconsistency”.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="55421" 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/running-the-new-elixir-formatter/9344/66">Post #65</a>
	                </div>
	            </div>
              <div id="likers-container-55421" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55421"
                     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="55422" data-post-id="55422">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tmbb" data-post="65" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/t/77aa72/48.png" class="avatar"> tmbb:</div>
<blockquote>
<p>I’m sorry, I don’t understand. What exactly are we/you rewriting? <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>We should keep <code>#! foo</code> like that and not as <code># !foo</code>!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="55422" 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/running-the-new-elixir-formatter/9344/67">Post #66</a>
	                </div>
	            </div>
              <div id="likers-container-55422" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55422"
                     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="55423" data-post-id="55423">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="66" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>You are right. That’s the argument for trailing commas but no parens calls in Elixir make trailing commas a bit inconsistent. For example, you can’t do:</p>
<pre><code>defstruct foo: :bar,
          baz: :bat,
</code></pre>
</blockquote>
</aside>
<p>I do</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defstruct [
  foo: bar,
  baz: bat,
]
</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="55423" 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/running-the-new-elixir-formatter/9344/68">Post #67</a>
	                </div>
	            </div>
              <div id="likers-container-55423" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55423"
                     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="55424" data-post-id="55424">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="net" data-post="63" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/net/48/429_2.png" class="avatar"> net:</div>
<blockquote>
<p>Something that this thread makes me believe—though I’m sure others will likely disagree—is that the formatter is too aggressive. I may prefer a formatter that has a little more respect for the author’s whitespace choices.</p>
</blockquote>
</aside>
<p>The issue is that it is most likely that <em>you are inconsistent</em> in those choices and do not always follow them in your codebase. We could add options for controlling things like using trailing commas or not, but then people will be bikeshedding on which options to enable. We have three options and they all have cons:</p>
<ul>
<li>Respecting the user choice - leads to inconsistencies because we are not consistent</li>
<li>Providing configuration - leads to bikeshedding about the code style</li>
<li>None of the above - leads to worse formatting in some cases</li>
</ul>
<p>One of the things I am really enjoying about the formatter is that I now type code without any care about style and let the formatter do the job. It is absolutely liberating. Respecting the user’s choice means being more careful.</p>
<p>That’s why I want to wait the formatter to really be on the wild before adding more configuration or respecting more the user’s decision.</p>
<p>To me it is definitely a “choose your poison” kind of deal and we have chosen ours. Maybe marking parts of your code the formatter should not touch is a fair compromise but again, it is too early for that.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="55424" 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/running-the-new-elixir-formatter/9344/69">Post #68</a>
	                </div>
	            </div>
              <div id="likers-container-55424" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55424"
                     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="55425" data-post-id="55425">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="67" data-topic="9344" 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/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>We should keep <code>#! foo</code> like that and not as <code># !foo</code>!</p>
</blockquote>
</aside>
<p>For the record:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(5)&gt; Code.format_string!("#! foo")  
["# ! foo"]
iex(6)&gt; Code.format_string!("#!foo") 
["# !foo"]
</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="55425" 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/running-the-new-elixir-formatter/9344/70">Post #69</a>
	                </div>
	            </div>
              <div id="likers-container-55425" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55425"
                     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="55457" data-post-id="55457">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="66" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>So we felt adding trailing commas could actually cause misunderstandings due to this “inconsistency”.</p>
</blockquote>
</aside>
<p>This begs the question. Is the goal of the formatter to reach total consistency, or is the goal to improve readability? In my opinion, too much consistency might actually have negative effects on readability, so just striving for consistency might IMO be counterproductive.</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="69" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>The issue is that it is most likely that you are inconsistent</p>
</blockquote>
</aside>
<p>I personally confess that I’m sometimes inconsistent, and in many cases this is deliberate. A simple example are tuples. If they are very short, I write them on a single line, otherwise I put each element on a separate line. Same thing goes for maps.</p>
<p>Empty lines are another example. I sometimes use them to break and separate larger subsections in the code. OTOH if the code is very simple, I don’t bother.</p>
<blockquote>
<p>That’s why I want to wait the formatter to really be on the wild before adding more configuration or respecting more the user’s decision.</p>
</blockquote>
<p>It seems that the initial formatter is going to be quite opinionated, and given what I stated above I’m not enthusiastic about it. Personally, I’d prefer a more relaxed formatter initially.</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="69" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>One of the things I am really enjoying about the formatter is that I now type code without any care about style and let the formatter do the job.</p>
</blockquote>
</aside>
<p>Another way to put it is that with the formatter we stop paying attention to how layout affects readability, and instead completely delegate this task to the machine. I’m not saying this is bad, but I’m also not sure I like the fact that this is now in complete control of the machine. Personally I’d prefer a more balanced approach, where the machine takes care of mostly mechanical tasks, while people are responsible for case-by-case decisions. Unfortunately, I have no idea what exactly does this means, and whether it’s even possible.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="55457" 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/running-the-new-elixir-formatter/9344/71">Post #70</a>
	                </div>
	            </div>
              <div id="likers-container-55457" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55457"
                     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="55472" data-post-id="55472">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sasajuric" data-post="71" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>I personally confess that I’m sometimes inconsistent, and in many cases this is deliberate. A simple example are tuples. If they are very short, I write them on a single line, otherwise I put each element on a separate line. Same thing goes for maps.</p>
</blockquote>
</aside>
<p>Those decisions are also taken by the formatter based on the line length. The formatter won’t split a data structure into multiple lines unless the data structure was previously broken into multiple lines (so this is one of the cases where we respect the user’s choice - those few cases are all documented).</p>
<aside class="quote no-group" data-username="sasajuric" data-post="71" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>Empty lines are another example. I sometimes use them to break and separate larger subsections in the code. OTOH if the code is very simple, I don’t bother.</p>
</blockquote>
</aside>
<p>We need to remember that the issue is not only consistency with ourselves but also within our teams. This became clear to me as the Elixir team grew because they would ask me why I chose a certain layout and I could not give a reasonable answer. There was no pattern besides “it feels better”.</p>
<p>Empty lines were particularly an issue with Phoenix, where Chris would remove my empty lines and add them elsewhere and I would remove his empty lines and add them elsewhere. We would just do it subconsciously (to be fair, I probably did it more frequently than him <img src="https://forum.elixirforum.com/images/emoji/apple/stuck_out_tongue.png?v=15" title=":stuck_out_tongue:" class="emoji" alt=":stuck_out_tongue:" loading="lazy" width="20" height="20">).</p>
<p>It is still worth reminding that you cannot run the formatter blindly on an existing code base. Sometimes you will need to change the code to get a better output. Once you work on those and familiarize yourself with the formatter style, the cases where everyone agrees the formatter code is arguably worse are rare. For those still on the fence, the Elixir codebase is a good place to get started, since it has been fully formatted.</p>
<aside class="quote no-group" data-username="sasajuric" data-post="71" data-topic="9344">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>It seems that the initial formatter is going to be quite opinionated, and given what I stated above I’m not enthusiastic about it. Personally, I’d prefer a more relaxed formatter initially.</p>
</blockquote>
</aside>
<p>We generally follow the opposite approach when designing code and APIs in Elixir. We always start with the most restricted APIs and behaviours and then add options and flexibility later on. The reason is that it is relatively easy to add something later but it is extremely hard to remove something.</p>
<aside class="quote no-group" data-username="OvermindDL1" data-post="55" data-topic="9344">
<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>Here was one from one of my work projects (a port from one of my old erlang libraries with some more features):</p>
</blockquote>
</aside>
<p>Btw, another idea I had yesterday is to define it as a list of lists. It may actually reflect better the origin of the data since you have a comment there that says “each row defines a dimension”. Then you flatten it and convert it to a tuple.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="55472" 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/running-the-new-elixir-formatter/9344/72">Post #71</a>
	                </div>
	            </div>
              <div id="likers-container-55472" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="55472"
                     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>
</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/9344/load_more?page=8">Load more posts (80 remaining)</a>
</div></template></turbo-stream>