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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, you are totally right, I totally forgot about that. Not the biggest fan the way they are implemented in golang, I prefer much more the elixir approach to include them in a module, but one again concept of module in golang is a totally different 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="298299" 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/oo-or-fp-easier-for-beginners/57696/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-298299" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298299"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="298300" data-post-id="298300">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>They get the job done well (I don’t like them as much as Elixir’s or Rust’s ways to do stuff either). Which is more than what can be said about Java. <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"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298300" 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/oo-or-fp-easier-for-beginners/57696/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-298300" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298300"
                     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 #23"></div>
  </section>
</div>
    <div class="postbit" id="298307" data-post-id="298307">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dimitarvp" data-post="14" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>Also you’ll need to clarify on the “can’t adequately test” part because for years of writing Golang and Rust I am just not seeing that to be true.</p>
</blockquote>
</aside>
<p>Testing all the possible interactions, timings <strong>and</strong> exceptions that can occur in a parallel programing model where race conditions and deadlocks are possible is exceedingly difficult and in fact impossible.</p>
<p>That said I do don’t put Rust in the same camp as traditional OO languages, it is much closer to what we have in Elixir with modules, functions and structs. Rust also adopted an object ownership model for concurrency as well. Rust has made great strides as a safe systems programming language, unlike traddional OO languages it didn’t adopt inheritance, but does have ability for code reuse with analogues to what we have with Elixir behaviors.</p>
<p>I think Rust actually goes <strong>extremely</strong> well with the BEAM because it took ownership of state seriously.</p>
<p>Golang is also not a traditional OO language, so it also doesn’t really count. It is also not immune to race conditions despite the ability to enable detection of some race conditions.</p>
<p>Isn’t it interesting that all the real advances are coming from non traditional OO languages?</p>
<p>In respect of options handling in HTTPoison / hackney, that is just sloppy code and a lesson in poor defaults handling. Even with types this would still be a poor state of affairs and unfriendly developer and insecure experience. It is <em>almost</em> as bad as throwing away secure defaults just because the domain didn’t end in “.com” or it just happens to April fools day, really it’s inexcusable, but that’s not the only issues with those libraries.</p>
<p>So with a hispter type system if you don’t specify all options would you expect to get a compiler error?</p>
<p>Would that be a desirable outcome if you don’t want to specify every option <strong>always</strong>?</p>
<p>I’m playing devils advocate here, be careful what you wish for, the next release of a library may add a new option and now your code breaks. Sure a library may deprecate or remove an option but that is now the responsibility of the library author to detect as they have gone and broken the established interface.</p>
<p>I don’t see how types really help with options as they are mostly <em>optional</em>, aside from perhaps catching a dumb typo. There are options libraries like <em>NimbleOptions</em> that do validation including checks for unknown options being passed, I suggest using them, as we don’t need a type system for that.</p>
<p>I want to be clear that I am not against types, I actually feel that elxir and Erlang go beyond types with pattern matching on both shapes AND values. We have value semantics and we can express our expectations.</p>
<p>I guess I characterise the rest of your response is more about bad practice and not having discipline writing code. No language will protect you from badly structured code, bad idioms and poor structure. Give a simple pen with a single function to a 3 year old and see what creative mess they can make with it.</p>
<p>Refactoring is never a big concern for me, and often a symptom of not having a sound structural methodology to begin with.</p>
<p>I like the OTP book, clean/pure functional cores that are easily tested, separate from the genserver interfaces and boundary modules where failures can happen. I find the CRC (construct, reduce, convert) pattern to result in clear understandable code and the use of context modules tend to provide sufficient insulation from lower level implementation changes.</p>
<p>If a context needs to be refactored even this can be done preserving the existing inteface through delegations until such time you have fully migrated code to a newer interface. It’s pretty easy to find where a module is used or imported so I don’t see a difficulty in determining what needs to be refactored.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298307" 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/oo-or-fp-easier-for-beginners/57696/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-298307" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298307"
                     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 #24"></div>
  </section>
</div>
    <div class="postbit" id="298308" data-post-id="298308">
  <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">
								<aside class="quote no-group" data-username="dimitarvp" data-post="18" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>That’s kind of my point, I want us to avoid falling into camps where neither side feels the need to explain well what they like and dislike about their chosen tech while looking down on the other side, and feeling all high and mighty about it.</p>
</blockquote>
</aside>
<p>Hear!  Hear!  That’s pretty much the crux of it.</p>
<p>There is a key part of Gary Burnhardt’s <a href="https://www.destroyallsoftware.com/talks/ideology" rel="noopener nofollow ugc">Ideology</a> talk where he talks about how developers will often never ask “Well if you don’t do things my way, how do you do them?” or more to the point, “I see you do things in a way that didn’t work for me, how do you make it work for you?”</p>
<p>On the flip side, it’s understandable that for the time-being some people around here might get extra defensive as a pretty massive change might be coming.  But generally, it would be great if we didn’t need to explain ourselves.</p>
<p>But having said that, dynamic typing works for me because I <em>like</em> following the strong conventions that are needed to make it work.  Explicit, consistent naming (<code>manufacturer</code>, not <code>man</code> or <code>mnfctr</code> or <code>m</code>) and writing functions in a way where the return type is obvious are things I’ve learned from trying to write clear dynamic code.  I’m also a big proponent of pair-programming.  Speaking of juniors and “eliminating entire classes of problems,” pair-programming eliminates the entire problem of letting juniors loose to heck things up!  It also eliminates the problem of letting overly “creative” seniors loose to heck things up <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20">  If you are at a company that doesn’t facilitate this, or you don’t like pair programming or want the freedom to write shorter names, than ya, static typing is going to be a <em>big</em> help. I also particularly like Erlang’s flavour of dynamic typing, but that has been mentioned many times.</p>
<p><a class="mention" href="/u/d4no0" rel="nofollow">@D4no0</a> I’ve realized that there is a big difference between OO and functional type systems but is also something I’ve never been able to articulate so thanks, that is a useful summary!</p>
<p>EDIT: Though I’ll sound like a broken record, I’ll reiterate (from other threads) that I combine all those practices with top down TDD and casting unknown data into known types as soon as it enters the system.</p>
<p>Ok, I have to get to work!  <img src="https://forum.elixirforum.com/images/emoji/apple/grimacing.png?v=15" title=":grimacing:" class="emoji" alt=":grimacing:" 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="298308" 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/oo-or-fp-easier-for-beginners/57696/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-298308" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298308"
                     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 #25"></div>
  </section>
</div>
    <div class="postbit" id="298309" data-post-id="298309">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="adw632" data-post="25" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>So with a hispter type system if you don’t specify all options would you expect to get a compiler error?</p>
<p>Would that be a desirable outcome if you don’t want to specify every option <strong>always</strong>?</p>
</blockquote>
</aside>
<p>It’s handled quite well. You can specify only 2-3 fields of a struct and let the remaining 30+ be defaults:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://doc.rust-lang.org/std/default/trait.Default.html">
  <header class="source">
      <img src="https://doc.rust-lang.org/static.files/favicon-044be391.svg" class="site-icon" alt="" width="100" height="100">

      <a href="https://doc.rust-lang.org/std/default/trait.Default.html" target="_blank" rel="noopener nofollow ugc">doc.rust-lang.org</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://doc.rust-lang.org/std/default/trait.Default.html" target="_blank" rel="noopener nofollow ugc">Default in std::default - Rust</a></h3>

  <p>A trait for giving a type a useful default value.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<aside class="quote no-group" data-username="adw632" data-post="25" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>I don’t see how types really help with options as they are mostly <em>optional</em>, aside from perhaps catching a dumb typo.</p>
</blockquote>
</aside>
<p>Much beyond that: interactions between options and how the defaults play into it. As mentioned in this (or other? can’t remember now) thread I had the misfortune of working with libraries and other people’s code where a library silently reverts config to defaults because you didn’t specify something well enough for it.</p>
<aside class="quote no-group" data-username="adw632" data-post="25" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>There are options libraries like <em>NimbleOptions</em> that do validation including checks for unknown options being passed, I suggest using them, as we don’t need a type system for that.</p>
</blockquote>
</aside>
<p>NimbleOptions is fantastic and I wish every library that needs config used it. That being said, I already addressed this when I said the following:</p>
<aside class="quote no-group" data-username="dimitarvp" data-post="18" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>The problems however are that MANY apps and libraries don’t utilize these well enough so as to properly parse / validate their inputs so we’re back to the eternal dilemma of “if you don’t make something mandatory people will always skip it”.</p>
</blockquote>
</aside>
<p>And yes I agree we hardly need static types in Elixir because of pattern-matching and guards. But there are blind spots in the community and I find myself wishing for stronger checks there (again, library configurations).</p>
<aside class="quote no-group" data-username="adw632" data-post="25" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>Testing all the possible interactions, timings <strong>and</strong> exceptions that can occur in a parallel programing model where race conditions and deadlocks are possible is exceedingly difficult and in fact impossible.</p>
</blockquote>
</aside>
<p>That’s kind of moving the goalposts maybe, but I agree with your premise.</p>
<aside class="quote no-group" data-username="adw632" data-post="25" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/9d8465/48.png" class="avatar"> adw632:</div>
<blockquote>
<p>Refactoring is never a big concern for me, and often a symptom of not having a sound structural methodology to begin with.</p>
</blockquote>
</aside>
<p>Finally, that’s a bit of a weird thing to say, refactoring is 100% inevitable. Hope you are not making the argument that we have to dream up 100% of the app before we hear the 50+ “I changed my mind” complaints from customers.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298309" 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/oo-or-fp-easier-for-beginners/57696/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-298309" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298309"
                     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 #26"></div>
  </section>
</div>
    <div class="postbit" id="298310" data-post-id="298310">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah, here’s where I gave an example with Rust btw: <a href="https://forum.elixirforum.com/t/types-n-testing/57577/8" class="inline-onebox" rel="nofollow">Types 'n' Testing - #8 by dimitarvp</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="298310" 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/oo-or-fp-easier-for-beginners/57696/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-298310" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298310"
                     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 #27"></div>
  </section>
</div>
    <div class="postbit" id="298328" data-post-id="298328">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dimitarvp" data-post="27" data-topic="57696">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>Finally, that’s a bit of a weird thing to say, refactoring is 100% inevitable. Hope you are not making the argument that we have to dream up 100% of the app before we hear the 50+ “I changed my mind” complaints from customers</p>
</blockquote>
</aside>
<p>Of course there is refactoring and I am hardly able to plan <em>everything</em> perfectly, it is just not a concern in practice when I have put in place sound structural relationships and abstractions within the code base.</p>
<p>The resulting refactoring tends to be very manageable.</p>
<p>Things that can bite are changes to global aspects like logging and instrumentation but even these are still approachable with savvy search and replace.</p>
<p>My point is that I am more about focusing on the most important factors for maintainability, kind of like if we look after the cents, the dollars take care of themselves.</p>
<p>Even with a type system, no doubt laziness will ensue with abuse of any().</p>
<p>I’m all for “type” inferencing but actually  I’m more for <em>value inferencing</em> and letting the compiler work out what the <strong>value constraints</strong> actually are and avoid sprinkling types where 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="298328" 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/oo-or-fp-easier-for-beginners/57696/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-298328" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298328"
                     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 #28"></div>
  </section>
</div>
    <div class="postbit" id="298336" data-post-id="298336">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think many of the opinions(generally speaking) are way too biased from the experiences of people that already know how to code. And for most of us when we started, FP wasn’t nearly as widespread as it is today so chances are we all started with OOP or imperative programming in general.</p>
<p>My brother is a high school teacher on a technical school. Some of the topics he teaches include automation of industrial systems(mostly PLCs, and recently stuff like Arduino). I taught him a fair bit of Elixir, C++ and JavaScript for various things he needed to do.</p>
<p>Of those three languages, most of Elixir was the easiest to learn, it’s just functions that take data and return data, there’s no “global variables” that change under your feet or anything. It was very straightforward. The idea of a “list” and “mapping over it” made sense, it was easy to explain at a high level.</p>
<p>Recursion was a bit weird to explain but he had some parallels to draw from so he got it quite quickly, though we didn’t get into body vs tail recursion.</p>
<p>We didn’t get into message passing in the language, we did discuss the concept and it made sense to him but we never used it in practice.</p>
<p>JS and C++ were a different story, he knew what functions are and that data can have different shapes, but he stumbled mostly on:</p>
<ul>
<li>Keeping state: he always lost track of the program’s global state(they’re normally global variables in arduino projects); he would often declare some step at the top of the files and then forget about them because the functions he was writing didn’t have that as arguments(conversely I think keeping program state in elixir would have been confusing but we didn’t get to it)</li>
<li>His students always struggled to understand how variables work(this would probably have been the same for Elixir)</li>
<li>What a class and an instance are, and functions vs methods, required lots of explanations. And lots of very basic code requires you up-front to interact with them.</li>
<li><code>for</code> loops required me to explain them countless times: the syntax is usually weird, and the process is always so manual that he(and his students) got lost pretty much every time they needed them. Most bugs were caused by this</li>
<li>In C++ having to declare the type of each variable caused paralysis most of the time(should I use int? long? why signed vs unsigned? I don’t know how many array items I need)</li>
</ul>
<p>There’s lots of stuff we take for granted and consider easy when we already went over them, but for complete novices the experiences are too different and wildly influenced by previous learnings.</p>
<p>Maintainability and refactoring are the least of the concerns at those stages imho, as is the notion of what’s “pure” or “impure” or what “effects” and “side effects” are. By the time these become relevant you’re no longer a complete novice, but rather someone that knows their way around programming things and wants to commit to the next levels.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298336" 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/oo-or-fp-easier-for-beginners/57696/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-298336" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298336"
                     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 #29"></div>
  </section>
</div>
    <div class="postbit" id="298345" data-post-id="298345">
  <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
                    <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>I remember the first time someone mentioned “side effects” with respect to some ruby code I had written and I was completely befuddled. Definitely not something that seemed relevant until much later in my journey.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298345" 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/oo-or-fp-easier-for-beginners/57696/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-298345" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298345"
                     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 #30"></div>
  </section>
</div>
    <div class="postbit" id="298366" data-post-id="298366">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Right, yeah, that was my point re LSP and ctags, jumping through files to definitions has always (well, for 30 years) been available in reasonable forms. My point re implicitness is just that this “finding where a method/function/identifier is defined” is not a problem unique to OO, it has existed forever in virtually all languages.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298366" 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/oo-or-fp-easier-for-beginners/57696/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-298366" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298366"
                     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>