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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="AstonJ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/AstonJ/120/15_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  AstonJ
                    <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">
								<aside class="quote no-group quote-modified" data-username="hubertlepicki" data-post="12" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>..thanks for the kind words but I’m still learning all things Erlang &amp; Elixir <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p>
</blockquote>
</aside>
<p>In that case I definitely recommend it <img src="https://forum.elixirforum.com/uploads/default/original/2X/6/6c3193d1dd46244da3c8c6f719c9f5e2abdd5ae8.gif?v=15" title=":003:" class="emoji emoji-custom" alt=":003:" loading="lazy" width="20" height="20"> you won’t be disappointed, I promise <img src="https://forum.elixirforum.com/uploads/default/original/2X/7/776053aa22968f83c10e90c98b23aa0ddd5c9d47.gif?v=15" title=":lol:" class="emoji emoji-custom" alt=":lol:" 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="50863" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-50863" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50863"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="50887" data-post-id="50887">
  <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 quote-modified" data-username="AstonJ" data-post="8" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/astonj/48/15_2.png" class="avatar"> AstonJ:</div>
<blockquote>
<p>For me I think that adds quite a bit of mental overhead, … Perhaps I am being a bit too lazy…</p>
</blockquote>
</aside>
<p>I think it may have more to do with where you are (in reference to understanding the <em>intent</em> of SRP - as it seems to be a new concept for you). If you go by the <a href="https://www.youtube.com/watch?v=lvs7VEsQzKY&amp;feature=youtu.be&amp;t=308" rel="noopener nofollow ugc">Dreyfus model of skill acquisition</a> a “novice” will tend towards “rigid adherence to taught rules or plans” - but in design/architecture things are rarely black and white - everything is about making <a href="https://www.youtube.com/watch?v=EauykEv_2iA" rel="noopener nofollow ugc">tradeoffs</a>. So the real “mental overhead” comes from the fact that there are numerous <strong><em>design guidelines</em></strong> that have to be balanced to meet the requirements for a particular situation - some will be met while others will be <strong><em>deliberately</em></strong> violated to gain some highly valued benefit.</p>
<p>For Example, Active Record violates SRP because it mixes the responsibilities of business logic AND persistence management. Yet it is listed as a viable <a href="https://www.martinfowler.com/eaaCatalog/activeRecord.html" rel="noopener nofollow ugc">Enterprise Application Pattern</a>:<br>
###<span class="hashtag-raw">#Pros:</span></p>
<ul>
<li>Good choice for domain logic that isn’t too complex, such as creates, reads, updates, and deletes.</li>
<li>Simplicity; easy to build, easy to understand.</li>
<li>Typically less duplication than <a href="https://www.martinfowler.com/eaaCatalog/transactionScript.html" rel="noopener nofollow ugc">Transaction Script</a>s.</li>
</ul>
<p>###<span class="hashtag-raw">#Cons:</span></p>
<ul>
<li>Works well only if objects correspond directly to the database tables: an isomorphic schema.</li>
<li>Complex domain logic using direct relationships, collections, inheritance doesn’t easily map onto Active Record.</li>
<li>Couples the object design to the database design; makes it more difficult to refactor either (independently) as a project goes forward.</li>
</ul>
<p>i.e. if the “cons” aren’t an issue for you (ever) and you value the “simplicity” then Active Record is a valid design choice (and investing in the higher effort alternatives is a waste).</p>
<p>Collectively all these design principles and guidelines are supposed to give you a sense of all the opposing forces and deliberate tradeoffs that come into play when trying to arrive at a “good design”. Ultimately no good comes from applying these principles and guidelines dogmatically.</p>
<p>Aside: <a href="http://sklivvz.com/posts/i-dont-love-the-single-responsibility-principle" rel="noopener nofollow ugc">Some people don’t like the SRP</a></p>
<aside class="quote no-group">
<blockquote>
<p>Would you agree that’s the gist of it?</p>
</blockquote>
</aside>
<p>Frankly the examples seemed to be easier to justify with “separation of concerns”:</p>
<ul>
<li>Persistence</li>
<li>Domain logic</li>
<li>UI (+ reports)</li>
</ul>
<p>Influenced by DDD “Domain Logic” is the focal point - it dictates the data types and is the dominating influence for the interface designs. Given that the domain logic only deals in domain types, SQL statements belong with persistence (provided you’re even using an RDBMS). <em>Ideally</em> the public API exposed by the domain logic should be able to support a whole range of UIs (web, mobile, desktop, command-line, etc. - though possibly with support <a href="http://samnewman.io/patterns/architectural/bff/" rel="noopener nofollow ugc">BFF</a>s) - but even when keeping it simple with a single frontend, <em>domain logic</em> doesn’t belong in the UI (though validation logic may be duplicated there).</p>
<p>The example with the calculations that differed for the clerical and manager report seemed contrived. It’s valid to say that not everything that “looks the same” is automatically duplication - but the example pre-supposes the existence of distinct <em>domain concepts</em> that somehow had the same calculations up to this point.</p>
<p>I think when Scott Wlaschin jovially states (SRP =&gt; functions) he is referring to the typically highly focused nature of short, pure functions.</p>
<aside class="quote no-group" data-username="hubertlepicki" data-post="6" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>Take this single responsibility principle for a review, and compare this to how things from standard library work. In either version (one responsibility, one reason to change), this is being broken all the time.</p>
</blockquote>
</aside>
<p>Modules can be used in the role of namespaces. I think the closest thing to a class is a module that defines a struct. That module should focus on the struct and the data within the struct should be focused.</p>
<p>Elsewhere you stated:</p>
<aside class="quote no-group" data-username="hubertlepicki" data-post="32" data-topic="8623">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"><a href="https://forum.elixirforum.com/t/discussion-dont-add-a-database-layer-to-your-phoenix-application/8623/32" rel="nofollow">Discussion: Don't add a database layer to your Phoenix application</a></div>
<blockquote>
<p>this can be done using Ecto schemas that are as dumb as possible. In my app, I do not put any validation-related logic there, the Ecto schemas define just schema and relationships between schemas.</p>
</blockquote>
</aside>
<p>To me this read like you felt that Changeset conflated the notion of being a <a href="https://web.archive.org/web/20100115230528/http://mercurial.selenic.com/wiki/ChangeSet" rel="noopener nofollow ugc">changeset</a> with the responsibility of validation - which sounds like a violation of SRP or at least a lack of cohesion. Yet lots of people seem to  appreciate the <em>convenience</em> afforded to them by this conflation (i.e. they are willing to accept this tradeoff).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50887" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-50887" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50887"
                     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 #13"></div>
  </section>
</div>
    <div class="postbit" id="50889" data-post-id="50889">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You, sir, made really good observation here.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50889" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-50889" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50889"
                     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 #14"></div>
  </section>
</div>
    <div class="postbit" id="50891" data-post-id="50891">
  <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 no-group quote-modified" data-username="hubertlepicki" data-post="9" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>I think <a class="mention" href="/u/pragdave" rel="nofollow">@pragdave</a> might be importing some wisdom from his object-oriented life <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20">.</p>
</blockquote>
</aside>
<p>I personally believe that on some higher-level of thinking many ideas transcend paradigms. In particular, I think that a large module which deals with many things is more problematic to read and understand.</p>
<p>A typical example I see is a case where complex GenServer state is handled directly in the GenServer module. By moving the state manipulation to a separate module, we can separate the domain logic from the time-flow logic, and this allows us to study each aspect of our system in isolation.</p>
<p>For a more concrete example, see my example blackjack code from my <a href="http://theerlangelist.com/article/spawn_or_not" rel="noopener nofollow ugc">To spawn, or not to spawn?</a> article. The domain management is done in separate modules, which means that domain code is not polluted with GenServer and vice versa.</p>
<aside class="quote no-group" data-username="hubertlepicki" data-post="9" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>I realized what is a reason for having a short classes</p>
</blockquote>
</aside>
<p>IMO the case for short classes (and also modules and functions) is to allow the reader to understand a single concept without worrying about non-essential details. Being able to understand a domain model without caring how it’s used from the rest of the system simplifies the code analysis, debugging, and extension.</p>
<p>I should also mention that I’m not a purist here. For example, if the process state is simple enough, I just bundle it inside the GenServer. If the model grows, then I split.</p>
<p>But tl;dr I believe that SRP and similar ideas, vague as they are, still apply in FP.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50891" data-batch-url="/posts/batch_likers">
                        8
                      </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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-50891" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50891"
                     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 #15"></div>
  </section>
</div>
    <div class="postbit" id="50892" data-post-id="50892">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>SRP is everything! <img src="https://forum.elixirforum.com/images/emoji/apple/open_mouth.png?v=15" title=":open_mouth:" class="emoji" alt=":open_mouth:" loading="lazy" width="20" height="20"> everything!<br>
Level 1 is the application.<br>
Level 2 are the modules. They break the application apart and their names describe the single problem every one of them is trying to solve.<br>
Level 3 are high level functions. They break the module problem into small steps and their names describe those steps.<br>
Level 4 are the low level functions. They do the actual work and are often one liners, at worst 3.</p>
<p>So when I read my code I go to the main file and look at the module names to recall what’s going on.<br>
Then it’s just a matter of following the module names and function names down the line to add or change stuff.</p>
<p>I love this approach because I don’t like writing tests and I don’t like writing comments.<br>
Why write a unit test for the + sign? It will add two numbers (in every respectable language) right?<br>
Then come the function names which are a living documentation, no need for comments.<br>
def add_two_numbers do end done!<br>
Higher level functions only describe the steps taken to solve a problem, no work is done there.<br>
If there’s a problem, you can instantly tell where it is, because all the work is done in low level functions, and if it’s a logic problem, then it’s a logic problem, and it’s easy to spot because all low level functions must work, which they always should if done right. 1+1 should always work right? (in every respectable language)</p>
<p>In other words, I feel like “comments”, “unit tests”, “types”, “specs”, and so on, are the crutches of the lazy programmer, who didn’t break the top problem into small modules,didn’t write functions that describe the steps taken to solve the problem, didn’t write low level functions that are so simple it’s impossible to have an error, and they just want to write code like this “oifaofiapodihfhopahpofhopasphofhogihasjuivfhus” and then go oh my unit test will help me, and look at all the types I have, the compiler will catch stuff, and check out my 5 pages of unintelligible comments describing my amazing “isdjfhpsaohgapoigaofghpg” code.</p>
<p>Why write comments when I can write verbose names for modules and functions, and if names become too long, then it’s obvious the module or function is trying to solve too much, break it down further, done!</p>
<p>Anyway, I bet I’ll get some heat for this, but it’s ok <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"> I write my code, I love my code, I love, love, love, my code. Did I mention that I love my code? I want to hire a racing horse to kick me on the head when reading other people’s code &lt;3 not your code dear reader! Your code is nice because it’s Elixir and SRP ; )</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50892" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-50892" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50892"
                     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 #16"></div>
  </section>
</div>
    <div class="postbit" id="50895" data-post-id="50895">
  <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">
								<p><a class="mention" href="/u/deithrian" rel="nofollow">@Deithrian</a> You’ve never tried type-based programming then.  ^.^</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50895" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-50895" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50895"
                     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 #17"></div>
  </section>
</div>
    <div class="postbit" id="50920" data-post-id="50920">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Deithrian" data-post="17" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/d/bc8723/48.png" class="avatar"> Deithrian:</div>
<blockquote>
<p>Anyway, I bet I’ll get some heat for this, but it’s ok <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"> I write my code, I love my code, I love, love, love, my code. Did I mention that I love my code?</p>
</blockquote>
</aside>
<p>The true test comes when you look at the code a year later <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"> Do you still love your code? If so well done!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50920" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-50920" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50920"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="50926" data-post-id="50926">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I just prefer “the_word_apple” and “the_adjective_red” vs “String a = ‘apple’”, “String b = ‘red’”</p>
<p>“the_word_apple” + 3. hmmm<br>
the_word_apple = the_word_hamburger. hmmmm<br>
put_item_in_object(the_word_apple, the_object_basket)</p>
<p>a+3. why not?<br>
a = c. sure! What was “c” again?<br>
g(a,n). Oh no! “g” was milk the cows, buy a newspaper, say the moon is red, 4356334, and “n” was launch the rockets? Dang it…<br>
I’m exaggerating, but not by much. <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"><br>
(refactoring ftw)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50926" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-50926" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50926"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="50932" data-post-id="50932">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Deithrian" data-post="20" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/d/bc8723/48.png" class="avatar"> Deithrian:</div>
<blockquote>
<p>I just prefer “the_word_apple” and “the_adjective_red” vs “String a = ‘apple’”, “String b = ‘red’”</p>
</blockquote>
</aside>
<p>There’s a fine line between good names and Hungarian notation (in whatever language) because you don’t have types.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50932" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-50932" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50932"
                     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 #20"></div>
  </section>
</div>
    <div class="postbit" id="50933" data-post-id="50933">
  <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 quote-modified" data-username="Deithrian" data-post="20" data-topic="8704">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/d/bc8723/48.png" class="avatar"> Deithrian:</div>
<blockquote>
<p>I just prefer “the_word_apple” and “the_adjective_red” vs “String a = ‘apple’”, “String b = ‘red’”</p>
<p>“the_word_apple” + 3. hmmm<br>
the_word_apple = the_word_hamburger. hmmmm<br>
put(the_word_apple, basket)</p>
<p>a+3. why not?<br>
a = c. sure! What was “c” again?<br>
g(a,n). Oh no! “g” was milk the cows, buy a newspaper, say the moon is red, 4356334, and “n” was launch the rockets, ? Dang it…<br>
I’m exaggerating, but not by much. <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>None of that has anything whatsoever to do with type driven programming.  ^.^</p>
<p>Type driven programming would be something like, oh if we were to emulate Phoenix’s <code>:safe</code> html renderer:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">
type safe = SafeHTML of string

let make_input_safe input =
  SafeHTML (escape_html input)

let raw input = SafeHTML raw

let render_html (SafeHTML html) = render_to_whatever html
</code></pre>
<p>Notice that I do define a wrapper type, it is documentation but otherwise no types are listed anywhere, not in the input arguments, no where else, it is all properly inferred.  With the above you cannot even accidentally pass a non-safe chunk of html text to the renderer, you <em>have</em> to either mark is as <code>raw</code> or or escape the input.  Also notice that the type drove the interface, not vice-versa.</p>
<p>Your examples are much more, hmm, Java-like, and Java is <em>NOT</em> a good language to do type-driven programming.</p>
<p>I’m not even sure what your example is demonstrating, do you have actual code to show?</p>
<p>And your things about <code>the_word_apple</code> and so forth seems very hungarian notation, but significantly more verbose, and verbosity can make code much harder to read as well.</p>
<p>Like say you have a unit of measurement, let’s say a meter:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">let width_of_house = 12
</code></pre>
<p>Well that is not descriptive at all, we could do:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">let meters_width_of_house = 12
</code></pre>
<p>That just makes it longer, and does not cause an error when we doing something like:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">centimeters_is_expected_in_this_function meters_width_of_house
</code></pre>
<p>Wow that becomes unreadable very fast, and sure you may catch it with your eyes, but it is still easily missable.  Compare this to a type driven approach to measurements:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">type meter = Meter of float

let cm i = Meter (i /. 100.0)
let dm i = Meter (i /. 10.0)
let m i = Meter i
let km i = Meter (i *. 1000.0)
</code></pre>
<p>Or you could do something like:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">type length =
| Meters of float
| Centimeters of float
| Kilometers of float
| Feet of float
...

let centimeters_of_length = function
| Meters m -&gt; m
| Centimeters cm -&gt; cm /. 100.0
| Kilometers km -&gt; km *. 1000.0
| Feet f -&gt; f *. 30.48
...
</code></pre>
<p>Or via Witnesses or a variety of other ways, whatever type style fits the pattern best.  And you can keep names short, descriptive, readable, and never worry about the system compiling when you try to pass something to somewhere where it does not belong.  ^.^</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50933" 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/single-responsibility-principle-what-does-it-mean-to-you-and-your-elixir-apps/8704/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-50933" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50933"
                     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 #21"></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/8704/load_more?page=3">Load more posts (11 remaining)</a>
</div></template></turbo-stream>