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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="coen.bakker" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/coen.bakker/120/39732_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  coen.bakker
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If I make <code>bins</code> the first argument in all functions in <code>SurveyWeb.Structs.Bins</code>, I will not always be able to pass the piped argument as the first argument in <code>histogram_frequencies/5</code>.</p>
<p>For example, I might get:</p>
<p><code>|&gt; (&amp;Bins.add_empty_bins(bins, &amp;1)).()</code></p>
<p>Instead of:</p>
<p><code>|&gt; Bins.add_empty_bins(bins)</code></p>
<p>I could make <code>bins</code> the argument of the pipeline in <code>histogram_frequencies/5</code>, instead of ‘responses’. My original idea was not to do that, though, because my app revolves around the concept ‘survey’ – and therefore responses seemed a logical choice for the role of protagonist. For example: “This pipeline turns survey responses into a data-object that a histogram function can process.” instead of “This pipeline turns this <code>bins struct</code> into a data-object that a histogram function can process.”</p>
<p>Any recommendations to what is a better approach, generally speaking? Pick the most logical protagonist for your pipeline, regardless of whether it will be the first argument passed to all segments of the pipeline? Or will I  end up regretting <code>|&gt; (&amp;Bins.add_empty_bins(bins, &amp;1)).()</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="254373" 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/beyond-code-that-gets-it-done-code-readability-any-advice/48591/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-254373" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="254373"
                     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 #11"></div>
  </section>
</div>
    <div class="postbit" id="254382" data-post-id="254382">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>-without reading the whole thread-</p>
<p>When those are private functions, I would take the pragmatic ordering that makes the flow in the public function as clear as possible. After all</p>
<blockquote>
<p>the code (convention red.) is more what you’d call “guidelines” than actual rules. - Captain Barbossa</p>
</blockquote>
<p>Public functions however should be predictable; taking the struct as first argument.</p>
<p>edit: Barbossa notified me the guidelines only apply when you are a pirate. Sorry for the confusion.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="254382" 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/beyond-code-that-gets-it-done-code-readability-any-advice/48591/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-254382" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="254382"
                     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>