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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s because You are not familiar (yet) with the syntax.</p>
<p>It should be attrs \\ %{} (with 2 backslahes)</p>
<p>It’s just a way to define default value… like attrs = default would be in js.</p>
<p>The cryptic %{} defines a map, and %User{} is a struct. You might see there is a rich set of datatypes.</p>
<ul>
<li><span class="chcklst-box fa fa-square-o"></span> list, THIS IS NOT AN ARRAY!</li>
<li>{} tuple</li>
<li>%{} map</li>
<li>%User{} struct</li>
</ul>
<p>These datatypes are common in FP, and You need to learn properly how to use them.</p>
<p>Instead of chaining, like OOP would do, You find pipes (|&gt;) in Elixir, where You provides data to a functional pipeline. Instead of this-&gt;db-&gt;insert_id() You will find id |&gt; insert_id(), with the Repo pattern.</p>
<p>Please use ``` to wrap your code, it will make it more readable, as in markdown.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208468" 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/any-tips-on-coming-from-php/38545/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-208468" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208468"
                     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="208475" data-post-id="208475">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mkellyxp" data-post="11" data-topic="38545">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mkellyxp/48/22397_2.png" class="avatar"> mkellyxp:</div>
<blockquote>
<p>Thanks! I actually had a demo of this book, but then picked up the Pragmatic Programmers Programming Phoenix &gt; 1.4 book. And i’m starting to see that, this is the issue. I</p>
</blockquote>
</aside>
<p>Programming Phoenix 1.4 is a good book, but definitely not the one you want to start from. It’s like landing in PHP and start learning Laravel or Symphony first <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>The book I recommend you also as an introduction to Phoenix, at the end, but before it teaches you to write applications with Elixir only.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208475" 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/any-tips-on-coming-from-php/38545/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-208475" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208475"
                     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="208477" data-post-id="208477">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I would argue otherwise. I have never written php and my previous experience was with python/java/js. I’m still not as comfortable with lot of elixir/fp stuff, but to me, the elixir syntax is much easier to understand than the php function you have written. It is because I’m now familiar with elixir syntax, similar to how you are familiar with php.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208477" 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/any-tips-on-coming-from-php/38545/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-208477" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208477"
                     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="208478" data-post-id="208478">
  <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 <em>really</em> recommend the <a href="https://elixir-lang.org/getting-started/introduction.html" rel="nofollow">getting started</a> as mentioned above, it goes over pretty much all the syntax of the language, for example here are the links for the <a href="https://elixir-lang.org/getting-started/modules-and-functions.html#default-arguments" rel="nofollow">default arguments</a> and <a href="https://elixir-lang.org/getting-started/keywords-and-maps.html#maps" rel="nofollow">maps</a> that you are having trouble with.</p>
<p>A big, <strong>big</strong> difference between PHP and Elixir is that in Elixir you can actually follow official docs and guides. If you need to know what functions or modules are available to you, go to <a href="https://hexdocs.pm/elixir/Kernel.html" rel="noopener nofollow ugc">HexDocs</a> and look for what you need. You can be sure what you read there works, with examples and all. Unlike PHP docs where you have to scroll down to the comments section to know if what you’re seeing actually works and you’re not about to shoot yourself on the foot.</p>
<p>Also, once you know the basic elixir syntax, the rest of the constructs are quite intuitive. It’s quite well put together imo.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208478" 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/any-tips-on-coming-from-php/38545/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-208478" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208478"
                     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="208485" data-post-id="208485">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mkellyxp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mkellyxp/120/22397_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mkellyxp
                    <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>Thank you.. seems obvious now, but perhaps I was in a bit of a rush <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208485" 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/any-tips-on-coming-from-php/38545/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-208485" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208485"
                     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="208487" data-post-id="208487">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mkellyxp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mkellyxp/120/22397_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mkellyxp
                    <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>Thank you… def helps.  I’m realizing my big mistake was jumping right into a Phoenix book without first taking the time to get to know Elixir itself</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208487" 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/any-tips-on-coming-from-php/38545/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-208487" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208487"
                     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="208490" data-post-id="208490">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Here is your <a href="https://devhints.io/elixir" rel="noopener nofollow ugc">cheatsheet</a> <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="208490" 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/any-tips-on-coming-from-php/38545/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-208490" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208490"
                     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="208491" data-post-id="208491">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Welcome to the community!</p>
<p>My small piece of advice is this: As you go along, get to know and get comfortable with <code>iex</code> (and later, it’s Erlang parent, <code>erl</code>).</p>
<p>Coming from PHP, you’re probably not use to working in a REPL like <code>iex</code>. When developing in PHP, you’re use to using <code>print_r</code>, <code>var_dunp</code> etc., to dump output onto a webpage and/or finding errors in the error log.</p>
<p>When using <code>iex -S mix</code> or <code>iex -S mix phx.server</code> to run an app in development, everything is available to you within <code>iex</code>. Once the app is running, you can inspect and interact with running code and <code>iex</code> is basically just another set of concurrent processes that’s running in the app. Here’s something fun to try. You can even kill it and see it restart: <code>iex(1)&gt; Process.exit(self(), :kill)</code> without having any affect on the running app.</p>
<p>I could go on <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>Once you get past some of the issues you now face, and get use to working this way, you’ll start to wonder how you could ever do app development any other way!</p>
<p>In my daily work with Elixir, <code>iex</code> is an <em>indispensable</em> tool, and with time, I’m sure you’ll start to feel that way too.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208491" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-tips-on-coming-from-php/38545/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-208491" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208491"
                     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="208505" data-post-id="208505">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If you are in a rush<br>
<a href="https://learnxinyminutes.com/docs/elixir/" class="onebox" target="_blank" rel="noopener nofollow ugc">https://learnxinyminutes.com/docs/elixir/</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="208505" 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/any-tips-on-coming-from-php/38545/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-208505" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208505"
                     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="208506" data-post-id="208506">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/8/4/8477cdcd03d5b2ccecb4ab859b6d0c01091d31dc.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/8477cdcd03d5b2ccecb4ab859b6d0c01091d31dc" title="meme" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/original/3X/8/4/8477cdcd03d5b2ccecb4ab859b6d0c01091d31dc.jpeg" alt="meme" data-base62-sha1="iTRHHdAicFeiDFMkTdVPnvo6YGg" width="434" height="600"><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">meme</span><span class="informations">500×690 79.5 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> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="208506" data-batch-url="/posts/batch_likers">
                        16
                      </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/any-tips-on-coming-from-php/38545/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-208506" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="208506"
                     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/38545/load_more?page=3">Load more posts (24 remaining)</a>
</div></template></turbo-stream>