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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve been thinking about this a lot lately. I had a discussion about this (e.g. the never-dying OOP vs FP – which is better argument.) yesterday with a colleague. My current state of mind:</p>
<ul>
<li>OOP and (Actor-Model-based) Functional Programming allow for a similar amount of abstraction and conciseness in programs.</li>
<li>The features in (Actor-Model-based) Functional Programming (immutability, pattern-matching, <em>real</em> concurrency without deadlock-dangers) allow you to write programs that are much faster than the alternative in OOP-programs.</li>
<li>There are a lot less ways in (AM-based) FP to shoot yourself in the foot than in OOP, because patterns like <a href="https://en.wikipedia.org/wiki/Law_of_Demeter" rel="noopener nofollow ugc">Demeters Law</a> or <a href="https://pragprog.com/articles/tell-dont-ask" rel="noopener nofollow ugc">tell, don’t ask</a> resolve themselves naturally when working with processes/immutability.</li>
</ul>
<p>I don’t remember who, but someone showed me this image a while back:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/2X/0/0cdd7c92b212b8e4c56ecc2c72aa1aa0b1d52848.jpg" data-download-href="https://forum.elixirforum.com/uploads/default/0cdd7c92b212b8e4c56ecc2c72aa1aa0b1d52848" title="fpvsoo.jpg" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/2X/0/0cdd7c92b212b8e4c56ecc2c72aa1aa0b1d52848_2_690x410.jpg" width="690" height="410" srcset="https://forum.elixirforum.com/uploads/default/optimized/2X/0/0cdd7c92b212b8e4c56ecc2c72aa1aa0b1d52848_2_690x410.jpg, https://forum.elixirforum.com/uploads/default/original/2X/0/0cdd7c92b212b8e4c56ecc2c72aa1aa0b1d52848.jpg 1.5x, https://forum.elixirforum.com/uploads/default/original/2X/0/0cdd7c92b212b8e4c56ecc2c72aa1aa0b1d52848.jpg 2x" data-dominant-color="ECEDEC"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">fpvsoo.jpg</span><span class="informations">932×554 43.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>Basically, there are less patterns to learn, because most problems we face in Object-Oriented design resolve themselves in the functional world.</p>
<p>The hardest thing is to change your mindset from a <em>I have this data and I want to put them in a hierarchy of objects</em> to <em>I have this data and I want to write functions/processes that consume it</em>.</p>
<p>Of course there are nice features like Polymorphism, that some claim only exist in OOP-land, but I’d argue that that isn’t true; In Elixir we have Behaviours and Protocols to fill this gap, and they work great at allowing code-re-usage and ‘swapping out components’.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="3564" 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/want-oop-in-elixir/543/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-3564" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="3564"
                     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="4831" data-post-id="4831">
  <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">
								<div class="youtube-onebox lazy-video-container" data-video-id="5EtV2JUU0Z4" data-video-title="Lightning Talks - Wojtek Mach (ElixirConfEU 2016)" data-video-start-time="" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=5EtV2JUU0Z4" target="_blank" class="video-thumbnail" rel="noopener nofollow">
    <img class="youtube-thumbnail" src="https://img.youtube.com/vi/5EtV2JUU0Z4/maxresdefault.jpg" title="Lightning Talks - Wojtek Mach (ElixirConfEU 2016)" width="690" height="388">
  </a>
</div>

<p><img src="https://forum.elixirforum.com/uploads/default/original/2X/7/776053aa22968f83c10e90c98b23aa0ddd5c9d47.gif?v=15" title=":lol:" class="emoji emoji-custom only-emoji" 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="4831" 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/want-oop-in-elixir/543/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-4831" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="4831"
                     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="5002" data-post-id="5002">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>HAHAHA Very funny, and pretty awesome!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="5002" 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/want-oop-in-elixir/543/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-5002" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="5002"
                     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="7932" data-post-id="7932">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I really wonder if Ruby could be rewritten in Elixir. You could argue that Ruby’s biggest problem is lack of concurrency. Would this solve the problem? <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> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="7932" 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/want-oop-in-elixir/543/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-7932" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="7932"
                     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="7933" data-post-id="7933">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s very nice that you wrote this library, but it’s totally inappropriate to use <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>
Luckily Elixir is not Scala <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> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="7933" 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/want-oop-in-elixir/543/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-7933" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="7933"
                     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="7934" data-post-id="7934">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ruby has many features that make it flexible to use (and easy to shoot yourself in the foot with in the long term), but which mean that there is a lot of metadata to keep track of, which makes the language quite a bit slower. Also, these features go against the concurrency-principles in Elixir. What would happen, for instance, if you would load monkeypatched code in one ruby thread?</p>
<p>So while it is doubtlessly possible to build a Ruby intserpreter on top of Elixir, a lot of Elixirs nice features are lost because it will have to support Ruby’s design choices that go against it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="7934" 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/want-oop-in-elixir/543/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-7934" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="7934"
                     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="7957" data-post-id="7957">
  <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">
								<p>I learned from José’s keynote at the first ElixirConf that Elixir was originally a prototypal OO language on the BEAM – closer to Ruby and Javascript. But, yes, it performed poorly and he went a new direction, bringing us the Elixir we know and love today.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="7957" 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/want-oop-in-elixir/543/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-7957" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="7957"
                     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>