<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="286877" data-post-id="286877">
  <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="dorgan" data-post="31" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dorgan/48/22107_2.png" class="avatar"> dorgan:</div>
<blockquote>
<p>I’d rather reserve the <code>!</code> for the cases where you explicitly <code>raise</code> by providing a custom error message, or when you also provide an alternative non-bang function</p>
</blockquote>
</aside>
<p>Sure, but I had exactly zero situations in my Elixir career – 7 years now – where in app code I had to write separate non-raising and raising function variants. I view this idea as a strictly library practice.</p>
<aside class="quote no-group" data-username="dorgan" data-post="31" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dorgan/48/22107_2.png" class="avatar"> dorgan:</div>
<blockquote>
<p>I like that being implemented in userland rather in elixir itself, neither elixir nor erlang impose a particular structure to the atom or the number of tuples in the result tuple to make it viable to add such constructs to the language itself, in my opinion.</p>
</blockquote>
</aside>
<p>Absolutely, I agree. Some people are not happy that this is not obvious but work with the language and the ecosystem for a bit of time and it starts to become natural..</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286877" 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/conditional-piping-part-of-the-language/55524/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-286877" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286877"
                     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 #31"></div>
  </section>
</div>
    <div class="postbit" id="286879" data-post-id="286879">
  <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">
								<aside class="quote no-group" data-username="dimitarvp" data-post="32" data-topic="55524">
<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>Sure, but I had exactly zero situations in my Elixir career – 7 years now – where in app code I had to write separate non-raising and raising function variants. I view this idea as a strictly library practice.</p>
</blockquote>
</aside>
<p>Agreed on that, honestly I’d rather explicitly match on <code>{:ok, value}</code> and have that raise if it returns anything else, than write a <code>!</code> version too. Using a <code>!</code> function may be helpful in pipes but “escaping the monad” can be either dangerous, or lead to code that’s hard to refactor when you actually need to handle the error case but all the code depending on that line of code assumes it always succeeds…</p>
<p>I like how Rust makes that smelly by forcing you to <code>.unwrap</code> 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="286879" 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/conditional-piping-part-of-the-language/55524/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-286879" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286879"
                     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 #32"></div>
  </section>
</div>
    <div class="postbit" id="286881" data-post-id="286881">
  <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
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I might be misunderstanding the OP, but it seems like a case for <code>with</code> statements to me.<br>
I’ll steal an example from this <a href="https://dev.to/martinthenth/using-elixirs-with-statement-5e36" rel="noopener nofollow ugc">blog post</a>:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">with true &lt;- is_email_address?(email),
     true &lt;- String.length(code) === 6,
     %EmailConfirmation{} &lt;- EmailConfirmations.get_email_confirmation(email),
     nil &lt;- EmailAddresses.get_email_address(email),
     {:ok, user} &lt;- Users.create_user(data),
     {:ok, email_address} &lt;- EmailAddresses.create_email_address(user, email) do
  ...
end
</code></pre>
<p>The example glosses over the <code>else</code> statement for when the condition is not met, but I think it still serves.</p>
<hr>
<p><em>I’m leaving it but I just realized how terrible the wording is in the statement “a case for <code>with</code> statements”; very confusing in this context. Sorry.</em></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286881" 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/conditional-piping-part-of-the-language/55524/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-286881" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286881"
                     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 #33"></div>
  </section>
</div>
    <div class="postbit" id="286883" data-post-id="286883">
  <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="dorgan" data-post="33" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dorgan/48/22107_2.png" class="avatar"> dorgan:</div>
<blockquote>
<p>Agreed on that, honestly I’d rather explicitly match on <code>{:ok, value}</code> and have that raise if it returns anything else, than write a <code>!</code> version too.</p>
</blockquote>
</aside>
<p>That’s how it should be, we the programmers love to discuss these things to death but in the end you arrive at your app’s user-facing code and you have to make sure you have covered for everything AND make sure to send logging and/or APM events to your appropriate systems if something is not (quite) right.</p>
<p>So I usually write most of the internal code in quite a lax manner and then do more exhaustive pattern matching in my highest level app code because there you can’t allow any slack. Users don’t want to see “app crashed” page, they want to see “this did not work, please try again shortly” and you want to receive a notification in the meantime.</p>
<aside class="quote no-group" data-username="dorgan" data-post="33" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dorgan/48/22107_2.png" class="avatar"> dorgan:</div>
<blockquote>
<p>I like how Rust makes that smelly by forcing you to <code>.unwrap</code> it</p>
</blockquote>
</aside>
<p>Yes, and this is HUGE. Rust forces you to mark this explicitly which helps a ton with static analysis tools AND allows you to <code>grep</code> for it and tighten the bolts down the road. A lot of people that work predominantly with dynamic languages can’t quite appreciate how important such aspects are before they dive deeper in the static strongly typed / native-code-compiled languages. I miss this every time I write Elixir.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286883" 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/conditional-piping-part-of-the-language/55524/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-286883" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286883"
                     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 #34"></div>
  </section>
</div>
    <div class="postbit" id="286884" data-post-id="286884">
  <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="30" data-topic="55524">
<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>What matters most is what your team finds convenient.</p>
</blockquote>
</aside>
<p>Absolutely, I was just talking in terms of something like that making it into the language.  I have also never written a custom <code>!</code> function <em>unless</em> it’s calling a library <code>!</code> function (like, <code>Blog.get_post!</code>).  I personally always prefer <code>?</code> return a boolean but I’m certainly not going to try and police teams I’m not on <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"></p>
<p>I only quickly read the docs for Rust’s <code>and_then</code> but isn’t that a situation where you would want <code>with</code> in Elixir?  I think what this thread is talking about is conditionally adding to a data structure or returning it untouched.  Though I may have lost the plot a bit <img src="https://forum.elixirforum.com/images/emoji/apple/upside_down_face.png?v=15" title=":upside_down_face:" class="emoji" alt=":upside_down_face:" 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="286884" 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/conditional-piping-part-of-the-language/55524/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-286884" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286884"
                     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 #35"></div>
  </section>
</div>
    <div class="postbit" id="286885" data-post-id="286885">
  <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="sodapopcan" data-post="36" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>I only quickly read the docs for Rust’s <code>and_then</code> but isn’t that a situation where you would want <code>with</code> in Elixir?</p>
</blockquote>
</aside>
<p>Elixir’s <code>with</code> – and this is also aimed at <a class="mention" href="/u/stevensonmt" rel="nofollow">@stevensonmt</a>’s most recent comment from a few minutes ago – suffers from lack of expressivity. Here’s how I’d rewrite his <code>with</code> block:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">with {:check_email, true} &lt;- is_email_address?(email),
     {:check_code_length, true} &lt;- String.length(code) === 6,
     {:get_email_confirmation, %EmailConfirmation{}} &lt;- EmailConfirmations.get_email_confirmation(email),
     {:email_confirmation_should_not_exist, nil} &lt;- EmailAddresses.get_email_address(email),
     {:create_user, user} &lt;- Users.create_user(data),
     {:create_email_address, email_address} &lt;- EmailAddresses.create_email_address(user, email) do
  ...
end
</code></pre>
<p>…because in the <code>else</code> block you can have a better idea what’s wrong i.e. you can pattern-match on <code>{:check_email, false}</code> and know exactly which step failed.</p>
<p>The code above is looking very much like an <code>Ecto.Multi</code> chain and ironically enough, I started using <code>Ecto.Multi</code> instead of <code>with</code> in no small amount of cases just for this reason. <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"> But IMO it does give you a better code readability.</p>
<p>To answer your question, code comprised of chains of <code>and_then</code> is more expressive and more readable than Elixir’s classic <code>with</code> usages.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286885" 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/conditional-piping-part-of-the-language/55524/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-286885" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286885"
                     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 #36"></div>
  </section>
</div>
    <div class="postbit" id="286888" data-post-id="286888">
  <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">
								<p>This gets back to context mattering here.  In your <code>with</code> example that is definitely better suited to a <code>Multi</code>!  I use <code>with</code> generally when each stage has the same return value, mostly <code>:ok/:error</code> tuples, then you don’t have to care exactly which one failed.  I like <code>with</code> when doing side effects where the database isn’t involved.</p>
<p>I do get that <code>with</code> is sort of a hacky <code>do</code> notion or the like, and isn’t the prettiest (I wish the formatter would let me put the <code>do</code> on its own line but I’m over it), but I prefer when I can see a <code>with</code> and know “this is a procedure where something can go wrong” and see a pipeline and think “this is just a series of immutable data transformations”.</p>
<p>I just have PTSD of working with someone who insisted <em>everything</em> be a pipeline.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286888" 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/conditional-piping-part-of-the-language/55524/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-286888" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286888"
                     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 #37"></div>
  </section>
</div>
    <div class="postbit" id="286890" data-post-id="286890">
  <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
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Not familiar enough with Ecto but will absolutely be looking at that in the future.</p>
<p>With respect to <code>with</code> statements though, I would argue that your rewrite of the example is exactly what makes them so great. You can make them as expressive as you like. I particularly like that they allow you to handle the happy path in one chain but you can handle multiple unhappy paths in the same place. It’s like instead of having <code>Option::Some(res) | Option::None</code> or <code>Result::Ok(res) | Result::Err(err)</code> you have a de facto return type of</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Happy(ness) 
| NotAnEmail(res) 
| WrongCodeLen(res) 
| NotConfirmed(res) 
| FailedCreateUser(res)
| FailedCreateEmail(res)
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286890" 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/conditional-piping-part-of-the-language/55524/39">Post #38</a>
	                </div>
	            </div>
              <div id="likers-container-286890" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286890"
                     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 #38"></div>
  </section>
</div>
    <div class="postbit" id="286892" data-post-id="286892">
  <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="sodapopcan" data-post="38" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>I use <code>with</code> generally when each stage has the same return value, mostly <code>:ok/:error</code> tuples, then you don’t have to care exactly which one failed.</p>
</blockquote>
</aside>
<p>While this is factually correct, I’ve seen such real-world scenarios extremely rarely. Most of the time <code>with</code> is used when you want a pipeline of transformations and/or side effects, yes, but very often you do want to know what failed. After all, if your 7-step <code>with</code> pipe keeps failing at step 3 wouldn’t you the app dev want to know why?</p>
<aside class="quote no-group" data-username="sodapopcan" data-post="38" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>I just have PTSD of working with someone who insisted <em>everything</em> be a pipeline.</p>
</blockquote>
</aside>
<p>Zealotry and pyramid hierarchy are a sad fact of life of our profession. I’ve successfully challenged and changed the minds of CTOs and VPs of Engineering but it was a rarity, most people default to ego or traumatic past experiences and will ride that until the heat death of the Universe to justify what they do.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286892" 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/conditional-piping-part-of-the-language/55524/40">Post #39</a>
	                </div>
	            </div>
              <div id="likers-container-286892" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286892"
                     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 #39"></div>
  </section>
</div>
    <div class="postbit" id="286894" data-post-id="286894">
  <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>Oh yes, I agree. Maybe I had bad luck with employers and customers (I was just taking every job and not insisting on culture fit is more accurate) but almost no team I was a part of used the more expressive <code>with</code> syntax, for reasons I can’t explain because they regularly had problems with part of the chain failing and them having no idea which exactly. I rewrote their <code>with</code> pattern-matching arms and added more clauses to <code>else</code> which led to us discovering the bug literally 10 minutes after deployment. And they were legitimately surprised.</p>
<p>…WTF, right. I think some of these practical programing-for-money practices should be put more front and center in some of Elixir’s educational material.</p>
<aside class="quote no-group" data-username="stevensonmt" data-post="39" data-topic="55524">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stevensonmt/48/20503_2.png" class="avatar"> stevensonmt:</div>
<blockquote>
<p>It’s like instead of having <code>Option::Some(res) | Option::None</code> or <code>Result::Ok(res) | Result::Err(err)</code> you have a de facto return type of</p>
</blockquote>
</aside>
<p>I love the example and yes you’re right. I’ve personally made exactly such Rust enums because we really wanted to send an APM event knowing what went wrong (we worked with a company’s 3rd party API which was super unstable and was sometimes spitting out wrong type of data).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="286894" 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/conditional-piping-part-of-the-language/55524/41">Post #40</a>
	                </div>
	            </div>
              <div id="likers-container-286894" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="286894"
                     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 #40"></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/55524/load_more?page=5">Load more posts (5 remaining)</a>
</div></template></turbo-stream>