<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anthony Ramirez on Medium]]></title>
        <description><![CDATA[Stories by Anthony Ramirez on Medium]]></description>
        <link>https://medium.com/@tonyjo.ramirez?source=rss-399808790040------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YI9wVWbc8rXWy3cD</url>
            <title>Stories by Anthony Ramirez on Medium</title>
            <link>https://medium.com/@tonyjo.ramirez?source=rss-399808790040------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 17:04:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tonyjo.ramirez/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using the useContext hook in React]]></title>
            <link>https://medium.com/@tonyjo.ramirez/using-the-usecontext-hook-in-react-a5eec1337ee0?source=rss-399808790040------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5eec1337ee0</guid>
            <dc:creator><![CDATA[Anthony Ramirez]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 04:10:52 GMT</pubDate>
            <atom:updated>2023-08-11T04:13:08.505Z</atom:updated>
            <content:encoded><![CDATA[<h4>A solution to endless prop passing</h4><p>If you have used React for any amount of time then you know how important it is to maintain state between parent and child components. The state object is the way we hold data or information for a component in React. For instance if we want to render a users profile in a component we would need to know who that user is, so we would use state to hold that information so we can use it in our component. Normally we would use the useState hook to set the state and then pass the state down into other components using something called props. Here is an example:</p><pre>import { useState } from &quot;react&quot;;<br>import ReactDOM from &quot;react-dom/client&quot;;<br><br>function ParentComponent() {<br>  const [user, setUser] = useState(&quot;Johnny Cash&quot;);<br><br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;{`Welcome Back ${user}!`}&lt;/h1&gt;<br>      &lt;ChildComponent user={user} /&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>function ChildComponent({ user }) {<br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;Top Song&lt;/h1&gt;<br>      &lt;div&gt; {user.song} &lt;/div&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>const root = ReactDOM.createRoot(document.getElementById(&#39;root&#39;));<br>root.render(&lt;ParentComponent/&gt;);</pre><p>In the example above we set the state of the user in the ParentComponent and pass it down to our child component using the {user} prop and render part of that information in the child component.</p><h3>The Issue</h3><p>Now if you are only passing state down through props only one or two levels then the useState hook is perfectly fine. However, many times, especially with user data, we need state to go throughout our whole app. So instead of passing our prop down just one level we could have something like this.</p><pre>import { useState } from &quot;react&quot;;<br>import ReactDOM from &quot;react-dom/client&quot;;<br><br>function ParentComponent() {<br>  const [user, setUser] = useState(&quot;Johnny Cash&quot;);<br><br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;{`Welcome Back ${user}!`}&lt;/h1&gt;<br>      &lt;ChildComponent user={user} /&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>function ChildComponent({ user }) {<br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;First Child&lt;/h1&gt;<br>      &lt;ChildComponent2 user={user}/&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>function ChildComponent2({ user }) {<br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;Second Child&lt;/h1&gt;<br>      &lt;ChildComponent3 user={user}/&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>function ChildComponent3({ user }) {<br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;Third Child&lt;/h1&gt;<br>      &lt;ChildComponent4 user={user}/&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>function ChildComponent4({ user }) {<br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;Forth Child&lt;/h1&gt;<br>      &lt;ChildComponent5 user={user}/&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>function ChildComponent5({ user }) {<br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;Top Song&lt;/h1&gt;<br>      &lt;div&gt; {user.song} &lt;/div&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>const root = ReactDOM.createRoot(document.getElementById(&#39;root&#39;));<br>root.render(&lt;ParentComponent/&gt;);</pre><p>So even though props 2–4 didn’t use the user prop, we still had to pass that prop through so that 5 could use it. This is very tedious, and the farther you get away from the highest parent component the easier it is to lose track of your props and data. This is where the useContext hook is very useful</p><h3>The Workaround</h3><p>The useContext hook allows us to create a state context globally so that we can call the useContext in any other component with out having to pass down props. This is how it works.</p><p>We first import createContext from react and initialize it by setting it to a variable.</p><pre>import { useState, createContext } from &quot;react&quot;;<br>import ReactDOM from &quot;react-dom/client&quot;;<br><br>const Context = createContext()</pre><p>After that we will set our state and wrap our root component in our Context Provider. This will give access to the state to every child component that branches off of our ParentComponent.</p><pre>function ParentComponent() {<br>  const [user, setUser] = useState(&quot;Johnny Cash&quot;);<br><br>  return (<br>    &lt;Context.Provider value={user}&gt;<br>      &lt;h1&gt;{`Welcome Back ${user}!`}&lt;/h1&gt;<br>      &lt;ChildComponent user={user} /&gt;<br>    &lt;/Context.Provider&gt;<br>  );<br>}</pre><p>Now we are ready to use our state context in our child components. All we have to do is import the useContext from react and then call it in our component.</p><pre>import { useState, useContext } from &quot;react&quot;;<br><br>function ChildComponent5() {  <br>  const user = useContext(Context);<br><br>  return (<br>    &lt;&gt;<br>      &lt;h1&gt;Top Song&lt;/h1&gt;<br>      &lt;div&gt; {user.song} &lt;/div&gt;<br>    &lt;/&gt;<br>  );<br>}</pre><h3>Drawbacks</h3><p>Like any good thing, the useContext hook has some draw backs when over used. The biggest drawback to note I think, is that when the context changes all of the components that use that context will re-render. While in a tiny application that doesn’t change state very much, you probably wont feel that being an issue at all, however, in a larger app it will create performance issues. For instance, if you’re working with an open API in your app, many times you are given a limit to how many request you can make to that API. The constant re-rendering from the context change could max out your API request limit and slow down your access to the data in that API.</p><h3>Should I Use It?</h3><p>So given that we now know how to use the useContext hook and some of it’s potential drawbacks, the question we would probably ask is, when should I use the useContext hook?</p><p>That’s a great question. The answer is that it all depends on your applications needs. If you’re building a small application then it will probably be a great blessing. Save your self from senseless prop passing. On the other hand if you have a very large application, you will have to be more judicious where you use it.</p><p>My suggestion would be to plan out your application thoroughly, and organize where you are gonna use it and where it would be harmful. This way you can avoid the pitfalls and avoid some senseless prop passing.</p><h3>Final Words</h3><p>The useContext hook is a very powerful tool when you learn how to use it well. It provides a great solution to endless prop passing throughout your applications. Just be mindful where you use it if you have a really large application you are building.</p><p>If you didn’t notice, our user in my examples above is one of my favorite musicians, The Man in Black, Mr. Johnny Cash. Our final component renders his top song. His top song for me is easily Cocaine Blues. It is a hilarious way to tell a wacky crime of passion story, and giving an example of why you should, “lay off that whiskey, and let that cocaine be.” Hope you enjoy it as much as I do!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fopen.spotify.com%2Fembed%2Ftrack%2F7xrODhgXFNVsRtKoyt5rJo%3Futm_source%3Doembed&amp;display_name=Spotify&amp;url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F7xrODhgXFNVsRtKoyt5rJo&amp;image=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d00001e024a04593b7c149dc7b725683e&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=spotify" width="456" height="152" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2acca04d697af29c0d9306412a0f38c/href">https://medium.com/media/a2acca04d697af29c0d9306412a0f38c/href</a></iframe><h3>Resources</h3><ul><li><a href="https://www.w3schools.com/react/react_usecontext.asp">W3Schools.com</a></li><li><a href="https://react.dev/reference/react/useContext">useContext - React</a></li><li><a href="https://blog.logrocket.com/pitfalls-of-overusing-react-context/">Pitfalls of overusing React Context - LogRocket Blog</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5eec1337ee0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starting OOP]]></title>
            <link>https://medium.com/@tonyjo.ramirez/starting-oop-70f514fc4100?source=rss-399808790040------2</link>
            <guid isPermaLink="false">https://medium.com/p/70f514fc4100</guid>
            <dc:creator><![CDATA[Anthony Ramirez]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 19:14:09 GMT</pubDate>
            <atom:updated>2023-06-30T19:14:09.588Z</atom:updated>
            <content:encoded><![CDATA[<h4>Beginning Object Oriented Programing with Python</h4><p>I started the third phase in my software engineering program at Flatiron School a few weeks ago. After doing front end programming with React.js and JavaScript in the first two phases, I was ready for something new. So in this phase they started us on the back end with Python.</p><p>The main focus for this phase in Python was introducing us to object oriented programming. While there is OOP(object oriented programming) in JavaScript, we didn’t use it in that phase, and the concept makes much more sense with Python. So the question is what is OOP exactly?</p><h3><em>What is it?</em></h3><p>So the gist of OOP is to model a system with a list of “objects”, where each part of the system is represented by one of the objects. Objects consist of date and methods(functions in JS). These objects allow you to interact with code but keeps the same state. Meaning, other parts don’t need to know anything else besides the one object they are interacting with.</p><h3>Classes</h3><p>The way it is broken down is through classes. The class list the data and methods for the class, and that defines what the objects are going to look like. So the data in Python would be listed as attributes or properties, and then methods use that data on the object that it is given. For example here is some pseudo code of the basic structure:</p><pre>class Guitar_Player:<br>    properties<br>        name<br>        guitar<br>        song<br>    methods<br>        play(guitar)<br>        solo(song)</pre><p>So in our Guitar_Player class above we have this:</p><ul><li>three properties: name, guitar, and song</li><li>two methods or functions: play() and solo()</li></ul><p>What this basic structure does is serve as a template for creating our objects of this class, also known as an instance.</p><h3>Instance</h3><p>An instance is an object of the class. It is created with a constructor function. Using our example above, it would look like this in Python:</p><pre>Guitar_Player(&#39;Jimi Hendrix&#39;, &#39;Fender Stratocaster&#39;, &#39;Voodoo Child&#39;)</pre><p>This constructor function calls the class with the three parameters that we need to initialize the properties for creating a new Guitar_Player object.</p><h3>Conclusion</h3><p>There is a lot more to OOP than this (like inheritance, encapsulation etc.), but this is the basic premise. Use classes to group together objects or instances of that class, that can be used across a system without altering the object state.</p><h3>sources</h3><p><a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming">Object-oriented programming - Learn web development | MDN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70f514fc4100" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Effects]]></title>
            <link>https://medium.com/@tonyjo.ramirez/running-effects-bdeb1a6b82cf?source=rss-399808790040------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdeb1a6b82cf</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[useeffect-hook]]></category>
            <dc:creator><![CDATA[Anthony Ramirez]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 17:43:49 GMT</pubDate>
            <atom:updated>2023-06-09T17:56:30.610Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using useEffect( ) in React</h4><figure><img alt="Effects Loop section on a guitar power amp" src="https://cdn-images-1.medium.com/max/1000/1*5UGNjEDbPWwsHmtdFwZy2A.jpeg" /></figure><p>I am a guitar player, and a piece of gear that every guitar player uses is an amp. On most amps there is a section called an effects loop, as seen above. Now without getting bogged down in the weeds of proper signal chain, and all of the things guitar geeks love to obsess over, let me give you a brief explanation of what the effects loop does.</p><p>The effects loop on a guitar amp provides you with the ability to insert effects pedals, typically time based effects like delay, and reverb, in between your guitar and the speakers, so that it “effects” the tone of your guitar and gives you a multitude of sonic options. This is how I think about the useEffect hook in React.</p><h3>Insert useEffect</h3><p>The useEffect hook, like the effects loop on a guitar amp, allows you to insert different “effects” from outside of react, into your react component. These effects are typically something like getting data from a web API or manually updating the DOM.</p><p>The useEffect hook takes in two arguments, a callback function and a dependency array. Here is an example:</p><pre>useEffect(() =&gt; {<br>    fetch(&quot;http://localhost:3000/reverbs&quot;)<br>      .then(resp =&gt; resp.json())<br>      .then(reverbs =&gt; setReverb(reverbs))<br>  }, [])</pre><h3>What effect do I need, reverb, delay, or tremolo?</h3><p>One of the the best things, and at times most stressful things, about playing guitar is picking out what pedals you want to use. There are so many and they can be hard to choose from, but when you find the right one for what you need, it can produce a magical sound. In our useEffect hook, this is what the call back function does, it tells us what effect we are inserting into our component. As seen in the above example, the callback function is a fetch API function that sets the state of our component. So upon the render of our component we fetch our data from the linked API.</p><h3>Too much Reverb</h3><p>Lots of beginner and novice guitar players use their effects as a crutch and don’t really know how to properly control them to shape their tone. As with guitar effects, we need to know how to properly control the useEffect hook. The way we control our useEffect hook is with the dependency array.</p><p>The dependency array sets the parameters of when the effect should occur. Like the knobs on guitar effects pedals regulate how the effects pedal respond, and how much effect we want in our overall tone, the dependency array sets when the effect should fire and run the callback function. In our example, the dependency array is empty. What this means is that we want this effect to fire one time, and we don’t want in to continue to fire. (With fetch API, the useEffect will cause the fetch to endlessly loop without the dependency array being set to empty. Like an annoying feedback loop in the speakers.)</p><h3>Conclusion</h3><p>The useEffect hook, like the amp effects loop, is powerful and super useful to help the “tone” of your components. Learning when and how to use them, and how to properly control them, gives you the ability add a lot of functionality to your component. Below are some resources to help you learn more about the functionality of the useEffects hook.</p><h4>Resources:</h4><p>React Pages: <a href="https://react.dev/reference/react/useEffect">https://react.dev/reference/react/useEffect</a></p><p>W3Schools : <a href="https://www.w3schools.com/react/react_useeffect.asp">https://www.w3schools.com/react/react_useeffect.asp</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdeb1a6b82cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Filling Out Paper Work!]]></title>
            <link>https://medium.com/@tonyjo.ramirez/filling-out-paper-work-cfed790e94d7?source=rss-399808790040------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfed790e94d7</guid>
            <category><![CDATA[html-form]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Anthony Ramirez]]></dc:creator>
            <pubDate>Fri, 19 May 2023 12:22:39 GMT</pubDate>
            <atom:updated>2023-05-19T12:27:28.391Z</atom:updated>
            <content:encoded><![CDATA[<h4>Successfully Using the ‘submit’ Event Listener on an HTML &lt;form&gt;</h4><h4>Brief Introduction</h4><p>When building out our webpages we will want our users to be able to have as close to a tactile experience using the page as possible. For example, we will want them to be able to click on buttons or hover their mouse over an object and the page respond. In the JavaScript code, these functions are called event listeners.</p><p>One of the more common event listeners is a ‘submit’ event. We use these when we want our users to be able to add or update data on the page. For this blog we will be doing optimistic rendering only, meaning we won’t be doing any type of GET or POST request that makes persistent changes to data.</p><h4>Step 1: Make Sure You Have The Right Element</h4><p>Let’s say you are selling a product and you want your users to be able to write and add reviews to the product page. So you will create a &lt;form&gt; where users can write their reviews, and a separate &lt;div&gt; where those newly written reviews would render on the page. In the HTML that might look something like this:</p><pre>&lt;div&gt;<br>  &lt;form id=&quot;form&quot;&gt;<br>    &lt;h3&gt;Add a Review&lt;/h3&gt;<br>    &lt;input id=&quot;review&quot;/&gt; &lt;!--write reviews here--&gt;<br>    &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>  &lt;/form&gt;<br>&lt;/div&gt;<br>&lt;div id=&quot;opinions&quot;&gt;<br>  &lt;!--store reviews here--&gt;<br>&lt;/div&gt;</pre><p>To add the ‘submit’ event to this form we must first grab the form in our JavaScript code. We have to be careful here that we grab the correct HTML element. Many might try to grab the button because it says “submit” on the button, but the button is just part of the form and not the whole form. It becomes even more imperative that we grab the whole form when we begin to write out our function.</p><p>The safest way to make sure you grab the right element is to use the .querySelector() method. This method uses either the element id, or class etc. whichever is most useful, to select the element.</p><pre>const revieForm = document.querySelector(&#39;#form&#39;)<br>// This assigns the #form to the variable reviewForm</pre><h4>Step 2: Add ‘submit’ Event and Callback</h4><p>Now that we have successfully grabbed our form we must now write our eventListener() function. The eventListener() takes in two parameters, an event such as a ‘click’, ‘mouseover’. or in this case a ‘submit’, and a call back function to apply once that ‘submit’ takes place. So here we are going to take our reviewForm variable and then add the eventListener() as follows:</p><pre>reviewForm.addEventListener(&#39;submit&#39;, (event) =&gt; callback(event))</pre><p>Let’s go ahead and also write out our separate callback function. When writing an event listener, the callback function is often referred to as a handler function. So let’s call our submit handler function, handleSubmit().</p><pre>reviewForm.addEventListener(&#39;submit&#39;, (event) =&gt; handleSubmit(event))<br><br>function handleSubmit(e){<br>    const newReview = document.createElement(&#39;p&#39;)<br>    const opinions = document.querySelector(&#39;#opinions&#39;)<br>    <br>    newP.textContent = e.target.reviewForm.value;<br><br>    opinions.appendChild(newReview)<br>}</pre><h4>Step 3: Prevent Default</h4><p>So we have our event listener and with our callback function, so we should be good to go right? Not so fast. Every time we click our submit but nothing renders and the page reloads. This happens because ‘submit’ events have a built in default action in JavaScript that causes it to refresh the page every time an event is submitted. To correct this issue, we have to add another line in our handleSubmit() function called a preventDefault :</p><pre>reviewForm.addEventListener(&#39;submit&#39;, (event) =&gt; handleSubmit(event))<br><br>function handleSubmit(e){<br>    e.preventDefault()<br>    const newReview = document.createElement(&#39;p&#39;)<br>    const opinions = document.querySelector(&#39;#opinions&#39;)<br>    <br>    newReview.textContent = e.target.reviewForm.value;<br><br>    opinions.appendChild(newReview)<br>}</pre><h4>Target Acquired!</h4><p>We have handled the preventDefault, our function should work, but there is one more issue with our function. Our target value is looking at the whole form and not looking directly at the input value of our form. This will likely give you a failed to load resource error in the DOM. So to correct this we must target the value of our input box:</p><pre>&lt;div&gt;<br>  &lt;form id=&quot;form&quot;&gt;<br>    &lt;h3&gt;Add a Review&lt;/h3&gt;<br>    &lt;input id=&quot;review&quot;/&gt; &lt;!--!!!HERE!!!--&gt;<br>    &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>  &lt;/form&gt;<br>&lt;/div&gt;<br>&lt;div id=&quot;opinions&quot;&gt;<br>  &lt;!--store reviews here--&gt;<br>&lt;/div&gt;</pre><p>Now that we know where our new review info is going to come from, we can update our handleSubmit() function:</p><pre>reviewForm.addEventListener(&#39;submit&#39;, (event) =&gt; handleSubmit(event))<br><br>function handleSubmit(e){<br>    e.preventDefault()<br>    const newReview = document.createElement(&#39;p&#39;)<br>    const opinions = document.querySelector(&#39;#opinions&#39;)<br>    <br>    newReview.textContent = e.target.review.value;<br><br>    opinions.appendChild(newReview)<br>}</pre><h4>Conclusion</h4><p>When I first began looking at event listeners in JavaScript, the ‘submit’ events on HTML forms would always cause me the most frustration. I either didn’t target the right value, forgot to do the event.preventDefault(), or would grab the submit button instead of the whole form. Now that I have had some practice, and lots of failures, with these event listeners I am able to write these functions much more efficiently and with way less frustration. I hope you found this helpful, and that it might help you also avoid some common pitfalls when starting to learn these event listeners in JavaScript.</p><h4>Sources:</h4><p><a href="https://developer.mozilla.org/en-US/">MDN</a> pages:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event">HTMLFormElement: submit event - Web APIs | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">EventTarget: addEventListener() method - Web APIs | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault">Event: preventDefault() method - Web APIs | MDN</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfed790e94d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[threeLittleBirds( )]]></title>
            <link>https://medium.com/@tonyjo.ramirez/threelittlebirds-81044c6cc8b1?source=rss-399808790040------2</link>
            <guid isPermaLink="false">https://medium.com/p/81044c6cc8b1</guid>
            <category><![CDATA[codingbootcamp]]></category>
            <dc:creator><![CDATA[Anthony Ramirez]]></dc:creator>
            <pubDate>Tue, 25 Apr 2023 06:32:10 GMT</pubDate>
            <atom:updated>2023-07-21T19:36:08.924Z</atom:updated>
            <content:encoded><![CDATA[<h4>Pushing through coding bootcamp using your Cohort Community, Google, and Proper Testing</h4><p>One of the fears I struggle with on a regular basis is the fear of failure. There have been times in my life that I have been completely frozen by it. I have shut down and quit things that I have started in order to avoid failing, even if those things were beneficial for my life. When I decided to began pursuing a new career in software engineering, that fear of failure began to settle in before I even got started. Quitting my job to enroll full time at Flatiron School, and just trusting that I will eventually be prepared for the job field at the end was very unsettling for me to commit to. Then the intensity of the first few weeks only made that fear grow; it made me wonder if I was still sure this is what I wanted to do.</p><h3><em>Drinking Water From A Fire Hose</em></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2FDearestDistortedAmericangoldfinch&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fthumbs.gfycat.com%2FDearestDistortedAmericangoldfinch-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="320" height="180" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9b9f3d7e06bf4e2858988ded5db067b/href">https://medium.com/media/a9b9f3d7e06bf4e2858988ded5db067b/href</a></iframe><p>Coding bootcamp, especially at the start, is like drinking water from a fire hose. There is more information than you can comprehend at one time, starting from the very first lecture, and before you know it you’re two days behind. It can be an overwhelming, and stressful experience. Eventually I figured out there were some tools I was just neglecting. To borrow an idea from the great Bob Marley, there were “Three Little Birds” that would help remind me not to worry: My cohort community, the great and powerful Google, and learning to properly test my code.</p><h3>Ask Your Cohort-mates: They are smart!</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2FFavorableObeseAkitainu&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fthumbs.gfycat.com%2FFavorableObeseAkitainu-max-1mb.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="500" height="259" frameborder="0" scrolling="no"><a href="https://medium.com/media/b93cd25a1566495fc8684e2656cff214/href">https://medium.com/media/b93cd25a1566495fc8684e2656cff214/href</a></iframe><p>A great resource that I realized I was under utilizing was my first “little bird,” my cohort-mates. As a naturally introverted person I can be a little untrusting and slow to engage strangers, but as I worked through paired programming and zoom meetings, I quickly began to realize that most of us, if not all of us, want to see each other succeed and graduate from our bootcamp. There are some very intelligent, and more advance coders in your cohort that will help in whatever way they can. In my experience, most are willing to work together to solve a problem, gain a better understanding, and help each other grow in our craft. As an example, one cohort-mate recorded a code walkthrough video for me to help me prepare for an exam. If you can’t figure something out ask a cohort-mate. They are a great resource, and it never hurts to just ask.</p><h3>Google It!</h3><p>The second “little bird” I am getting better at using is the great and powerful google. It’s a tool I use probably everyday for all sorts of information but I was not using it effectively for writing code. No matter how advanced you get there is always going to be something you don’t know, whether it’s a particular syntax, or function, there’s too much information to memorize and recall. Thankfully if you give Google good keys, it will point you in the direction of great resources, however, if you feed it a bad search you could be going on a wild goose chase. Avoid searching a long drawn out question, or using too many variables. The best practice is to be as short and concise as possible when describing the information you’re looking for, and Google will point you in the right direction.</p><h3>console.log(“This is the Way”)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xZ7zuqTQpJJmKncr.jpg" /></figure><p>When prepping for my bootcamp I was introduced to my third “little bird,” through the console.log( ) method for testing code in the DOM console. I would use it sparingly, thinking that I would need it less as I progressed in my coding skills. It turns out the more complex things get the more helpful the console.log( ) method (or print( ) in python) becomes. It’s especially useful to ensure that your code works properly as you start to add more complexity into your code. For instance, let’s say you want a button to delete an item on your web page when that button is clicked, console.log() method would be useful to make sure that you’re button works, and that you’re targeting the right element. For example:</p><pre>const input = document.getElementById(&#39;button&#39;);<br><br>funcion logClick(){<br>  console.log(&#39;I was clicked&#39;);<br><br>input.addEventListener(&#39;click&#39;, logClick);<br>//=&gt; &#39;I was clicked&#39;</pre><p>So because we put the console.log() in our call back function on the event listener, the console is giving us as message showing that our button click is functioning.</p><p>As you add multiple layers of functions and events in your code, it becomes imperative that you use the console.log() method as you go through each step to make sure that your code is functioning as it should. It will save you a lot of time, stress, and frustration debugging your code.</p><h3>“Don’t Worry About A Thing!”</h3><p>These are my ‘Three Little Birds” that I have discovered over these fist few weeks of coding bootcamp; singing the message to me that “every little thing is gonna be alright.” Out of the three, I have found that my time working with cohort-mates on something I am struggling with is when I typically have a light bulb type moment with what I am trying to learn. For you it could be something completely different. I am sure that there are many other tools out there you can be used to help you get through your coding bootcamp. Find the tools, tips, and tricks that serve you the best, bring you some peace, and help remind you that everything will be ok.</p><pre>threeLittleBirds();<br>//=&gt;&quot;Don&#39;t worry, about a thing.&#39;Cause ever little thing, is gonna be all right&quot;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fopen.spotify.com%2Fembed%2Ftrack%2F75FYqcxt1YEAtqDLrOeIJn%3Futm_source%3Doembed&amp;display_name=Spotify&amp;url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F75FYqcxt1YEAtqDLrOeIJn&amp;image=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d00001e02811bfdc4f55b3a7484524aaf&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=spotify" width="456" height="152" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fa568c0be89c11b146765d861965849/href">https://medium.com/media/8fa568c0be89c11b146765d861965849/href</a></iframe><p>Sources:</p><p><a href="https://stackoverflow.com/questions/4539253/what-is-console-log#:~:text=on%20this%20post.-,console.,time%20to%20debug%20the%20code.">Stack Overflow</a></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Console/log">MDN log()</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81044c6cc8b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>