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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ConstantBall" data-post="11" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/e8c25b/48.png" class="avatar"> ConstantBall:</div>
<blockquote>
<p>I don’t see why that logic couldn’t be extended when attempting to insert a key into a struct if the syntax were supported.</p>
</blockquote>
</aside>
<p>Structs always have all defined keys present, so inserting a new key into a struct doesn’t make sense and shouldn’t be a supported use case. This would mean the syntax is only for maps — for structs it would be (1) equivalent to the update syntax when using the form <code>%Struct{struct | new_key =&gt; new_val}</code>, and (2) would be able to break structs when using the form <code>%{struct | new_key =&gt; new_val}</code> (i.e. without compile time validation of keys).</p>
<p><code>Map.put</code> can be used to break structs already, but at least it’s in the Map module which hints that it’s not the first tool to use for structs.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291207" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-291207" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291207"
                     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="291211" data-post-id="291211">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ConstantBall" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ConstantBall
                    <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" data-username="Nicd" data-post="12" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nicd/48/2357_2.png" class="avatar"> Nicd:</div>
<blockquote>
<p>Structs always have all defined keys present, so inserting a new key into a struct doesn’t make sense and shouldn’t be a supported use case.</p>
</blockquote>
</aside>
<p>Which is precisely why I said an exception should be thrown in the case of structs, exactly as it would when attempting to update an invalid key in a struct. I’m not advocating for its use with structs, only in simple maps which is this discussion’s intention.</p>
<p>I’m also operating under the assumption that the update and insert operators would be different, as they are in Erlang, so I don’t believe the rest of your response applies.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291211" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-291211" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291211"
                     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="291212" data-post-id="291212">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ConstantBall" data-post="11" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/e8c25b/48.png" class="avatar"> ConstantBall:</div>
<blockquote>
<p>I’m only interested in understanding how Elixir came to the conclusion to omit the insert syntax.</p>
</blockquote>
</aside>
<p>I believe you got your answer earlier:</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="3" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>I frequently struggle to remember when to use which operator in the Erlang syntax.</p>
</blockquote>
</aside>
<p>To me that’s the why: to make things more intuitive/simpler. And, the following is the how:</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="3" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>So my goal was to introduce syntax for the struct-like API (i.e. you expect the keys exist and you can only update them) and leave the dictionary-like API (adding and removing keys) in the <code>Map</code> module.</p>
</blockquote>
</aside> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291212" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-291212" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291212"
                     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="291224" data-post-id="291224">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ConstantBall" data-post="13" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/e8c25b/48.png" class="avatar"> ConstantBall:</div>
<blockquote>
<p>update and insert operators would be different, as they are in Erlang</p>
</blockquote>
</aside>
<p>The insert syntax in Erlang is equivalent to <code>:maps.put</code>, right? You could technically <em>only</em> use the insert syntax without the update syntax, and it would always work. I think a more useful syntax would be equivalent to <code>Map.put_new!</code> (which doesn’t exist), that way you would be explicitly saying you want to put a new value that doesn’t exist, or update one that does. That would be inconsistent with the Erlang behaviour, though.</p>
<p>Erlang: You can create new values and update existing values at once, but if you “create” an existing value by mistake, it’ll overwrite it.<br>
Elixir: You can only update existing values, you can’t create new ones.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291224" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-291224" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291224"
                     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="291256" data-post-id="291256">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ConstantBall" data-post="9" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/e8c25b/48.png" class="avatar"> ConstantBall:</div>
<blockquote>
<p>Otherwise, why not restrict its use to only structs where insertions are invalid?</p>
</blockquote>
</aside>
<p>Because there are still many situations where you have a map that behaves like a struct (i.e. it only has a pre-defined set of keys) but you don’t need to define a struct for it. For example, the state of a GenServer.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291256" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-291256" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291256"
                     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="291261" data-post-id="291261">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ConstantBall" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ConstantBall
                    <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>Right. And honestly, I be alright with the Erlang behaviour since it would then be consistent with <code>Map.put</code>/<code>:maps.put</code> and thus with Erlang in general. For me it’s about using the appropriate operator based on what you expect the data to look like at that moment.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291261" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-291261" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291261"
                     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="291263" data-post-id="291263">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ConstantBall" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ConstantBall
                    <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>This is exactly one of the use cases that I encounter which lead me to this question. Usually I’ll have a pre-defined set of keys with one or two optional keys that do not have suitable default values to be included as part of the pre-defined set. In these situations, I’ve felt it would be beneficial to have the insert syntax along with update syntax.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291263" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-291263" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291263"
                     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="291265" data-post-id="291265">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ConstantBall" data-post="11" data-topic="56431">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/e8c25b/48.png" class="avatar"> ConstantBall:</div>
<blockquote>
<p>Why would a second operator automatically double the number of notations? Why couldn’t it just add one more notation?</p>
</blockquote>
</aside>
<p>Since you are the one that challenged the status quo, the onus is on you to give a detailed proposal. Mind you, it needs to be:</p>
<ul>
<li>backward compatible</li>
<li>consistent with the existing syntax</li>
</ul>
<p>In my point of view, the Erlang way makes sense because Erlang has a focus on conceptual clarity. The Elixir way also makes sense because Elixir has a focus on developer ergonomics. Sometimes you cannot achieve both.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291265" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-291265" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291265"
                     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="291266" data-post-id="291266">
  <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>If I was a language maintainer, my problem with such proposals would be that introducing syntax is a slippery slope that might never end.</p>
<p>So you would like to have a map inserting syntax. Cool. That’s reasonable, and I found myself wanting that in the past as well. But then somebody else comes along and says “Hey, what about a new syntax as a shortcut for <code>Map.put_new</code> and <code>Map.put_new_lazy</code> as well? I use these every day in my work!”. And you will find yourself in the very uncomfortable situation of having to explain why introducing new syntax X is reasonable but syntax Y is not.</p>
<p><em>(And let’s not even mention the maintenance burden of every new syntax, which is a very long topic by itself, but suffice to say they carry non-trivial opportunity costs.)</em></p>
<p>I agree with you that Elixir’s current choices and their tradeoffs might seem inconsistent for a newcomer or an outsider but I believe I speak for many people when I say that I’d still prefer knowing those choices and tradeoffs – and them being a reasonably low number – than to have more and more syntax that absolutely will confuse everyone but the biggest syntax advocates (and I’d argue they are likely below 1% of the language’s user base).</p>
<p>Elixir has quirks. All languages do. ¯_(ツ)_/¯ Elixir’s are not many though and are thus graspable and can easily be worked around.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291266" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-291266" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291266"
                     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="291280" data-post-id="291280">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ConstantBall" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ConstantBall
                    <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" data-username="dimitarvp" data-post="20" data-topic="56431">
<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>If I was a language maintainer, my problem with such proposals would be that introducing syntax is a slippery slope that might never end.</p>
</blockquote>
</aside>
<p>I get that, but I just wanted to have a discussion and not pitch a proposal.</p>
<aside class="quote no-group" data-username="dimitarvp" data-post="20" data-topic="56431">
<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>So you would like to have a map inserting syntax. Cool. That’s reasonable, and I found myself wanting that in the past as well. But then somebody else comes along and says “Hey, what about a new syntax as a shortcut for <code>Map.put_new</code> and <code>Map.put_new_lazy</code> as well? I use these every day in my work!”. And you will find yourself in the very uncomfortable situation of having to explain why introducing new syntax X is reasonable but syntax Y is not.</p>
</blockquote>
</aside>
<p>I’m asking why a base functionality for maps that is present in Erlang isn’t supported in Elixir when Elixir delegates most of its map logic to Erlang. Those two that you’re referring to aren’t supported in Erlang’s map literal syntax, so although I see what you’re getting at, I don’t think those comparisons are accurate.</p>
<aside class="quote no-group quote-modified" data-username="dimitarvp" data-post="20" data-topic="56431">
<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>I agree with you that Elixir’s current choices and their tradeoffs might seem inconsistent for a newcomer or an outsider but I believe I speak for many people when I say that I’d still prefer knowing those choices and tradeoffs – and them being a reasonably low number – than to have more and more syntax that absolutely will confuse everyone but the biggest syntax advocates (and I’d argue they are likely below 1% of the language’s user base).</p>
<p>Elixir has quirks. All languages do. ¯<em>(ツ)</em>/¯ Elixir’s are not many though and are thus graspable and can easily be worked around.</p>
</blockquote>
</aside>
<p>I’ve been either writing or code reviewing Elixir on a daily basis at my job for more than a couple of years. I would never claim to be an expert, but I also wouldn’t refer to myself as a newcomer or outsider who is bewildered by how things are done in Elixir relative to other languages. I’m not even sure that a newcomer would have cared enough about Erlang to notice the inconsistency and ask the question.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="291280" 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/why-do-elixir-maps-have-an-update-syntax-but-no-insert-syntax-meanwhile-erlang-has-both/56431/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-291280" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="291280"
                     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>
</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/56431/load_more?page=3">Load more posts (9 remaining)</a>
</div></template></turbo-stream>