<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Karla Dampilag</title>
    <description>The latest articles on Forem by Karla Dampilag (@karladampilag).</description>
    <link>https://forem.com/karladampilag</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F486033%2Fd327518c-fde5-489c-8d1e-c5a1a3868efc.jpg</url>
      <title>Forem: Karla Dampilag</title>
      <link>https://forem.com/karladampilag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/karladampilag"/>
    <language>en</language>
    <item>
      <title>Turn your coding skills into revenue streams 🧑‍💻💰</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Sun, 02 Mar 2025 14:46:33 +0000</pubDate>
      <link>https://forem.com/karladampilag/turn-your-coding-skills-into-revenue-streams-43c7</link>
      <guid>https://forem.com/karladampilag/turn-your-coding-skills-into-revenue-streams-43c7</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/indie_saas_dev" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2284486%2F5251cc0f-f121-4a9c-84d0-235bee3e7bbd.jpg" alt="indie_saas_dev"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/indie_saas_dev/5-side-project-ideas-for-developers-to-monetize-as-micro-saas-in-2025-5ei" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;5 Side Project Ideas for Developers to Monetize as Micro-SaaS in 2025&lt;/h2&gt;
      &lt;h3&gt;Daniel Abel ・ Mar 2&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#startup&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#sideprojects&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>startup</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>You can't get what you want if you don't do this</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Sun, 19 Jun 2022 20:05:49 +0000</pubDate>
      <link>https://forem.com/karladampilag/you-cant-get-what-you-want-if-you-dont-do-this-1b03</link>
      <guid>https://forem.com/karladampilag/you-cant-get-what-you-want-if-you-dont-do-this-1b03</guid>
      <description>&lt;p&gt;If you're asking for something from someone, then you need to do this first.&lt;/p&gt;

&lt;p&gt;If you're in sales, customer support, or anyone talking to users or potential users, &lt;strong&gt;you gotta dial up the listening and empathy meters.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In fact, if you're asking for something from someone, such as but not limited to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up to your platform&lt;/li&gt;
&lt;li&gt;Buy your product&lt;/li&gt;
&lt;li&gt;Leave a review&lt;/li&gt;
&lt;li&gt;Hire you&lt;/li&gt;
&lt;li&gt;Give you a raise&lt;/li&gt;
&lt;li&gt;Give your startup funding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or literally anything else, &lt;strong&gt;then you gotta answer the question, "what's in it for them?"&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in it for them?
&lt;/h2&gt;

&lt;p&gt;I was recently on the receiving end of having someone ask me to do not just one thing, but many things. The interesting part is...&lt;/p&gt;

&lt;p&gt;I didn't even know the guy.&lt;/p&gt;

&lt;p&gt;Someone cold messaged me on LinkedIn to try out their NEW blogging platform, and encouraged me to publish my articles there. I already cross-post my blog posts to tech/dev blogging &amp;amp; community platforms, so he probably found me at one of those places.&lt;/p&gt;

&lt;p&gt;Since the platform he's promoting to me is fairly new, I asked how it's different from the others I'm already using, and what kind of unique value it brings to the people they're trying to onboard, a.k.a. people like me.&lt;/p&gt;

&lt;p&gt;He gave me lengthy details about the company and their platform that didn't answer my question. Unsatisfied, I Googled them myself. Even from their website, I couldn't find their UVP (unique value proposition).&lt;/p&gt;

&lt;p&gt;But whatever, I gave the benefit of the doubt since startups usually polish their messaging, comms, and positioning during these early stages. No big deal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Listening and empathy
&lt;/h2&gt;

&lt;p&gt;I got busy with work and forgot about the platform and our conversation. But to his credit, he consistently followed up with me so I didn't completely forget about it. One day, I was able to find the time to publish one post on their platform, which was weeks after our first contact.&lt;/p&gt;

&lt;p&gt;After more follow-ups from him, he asked if I'm interested to import all my existing articles on their platform. I told him about my experience when I published my first article there:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It was painful to use&lt;/strong&gt; because they had no support for Markdown.&lt;/p&gt;

&lt;p&gt;Markdown is supported on my self-hosted blog as well as on the platforms I use, so all I have to do is copy-paste if I want to cross-post. But this guy's platform only has rich text processing. That means I had to manually format everything when I published my first and only article.&lt;/p&gt;

&lt;p&gt;I asked if they have plans to support Markdown in the future. Obviously so it'll be easier to do what he's asking me to do.&lt;/p&gt;

&lt;p&gt;His response? He thanked me for my interest, gave more promotional speeches about why it's so great to use their platform, then asked me if I can get 3 more of my articles there, and then requested me to update my profile. He managed to say all those in three paragraphs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;He didn't even answer my question.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I decided not to publish the rest of my articles there, which is opposite of what he's asking me to do. It's mostly because I'm too busy these days, and manually formatting articles when I know I can just copy-paste has introduced a huge friction to keep publishing on their platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Communication skills
&lt;/h2&gt;

&lt;p&gt;While writing this article, I had to revisit our conversation to make sure my story is accurate 😛&lt;/p&gt;

&lt;p&gt;I noticed that he actually answered my question at the very end of his essay. It turns out they do support Markup. I felt dumb for not finding that option in their UI. Either that or their UX wasn't the best. Which is which doesn't matter for this article 😉&lt;/p&gt;

&lt;p&gt;But I could have sworn he didn't answer my question when I first read his response. Then I saw an "edited" tag on his message. He might have realized it after he clicked send, then went back and edited his response.&lt;/p&gt;

&lt;p&gt;If that's the case, it was too late. I already read it and decided not to use their platform at the time. I wouldn't even have seen his edit if I didn't feel the need to write about this experience.&lt;/p&gt;

&lt;p&gt;Either that, or I missed his answer the first time. Either way, if he "listened" for real, and had empathy for the person he's talking to, he could have answered my inquiry first, and I would have already published all of my posts to their platform.&lt;/p&gt;

&lt;p&gt;Only then would have been a better time for him to say more promotional text and ask for me to do more things on their platform, because he'd already informed me how seamless it is for me to do all these things he's asked.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's a skill or a muscle to be exercised
&lt;/h2&gt;

&lt;p&gt;I myself fall into the trap of not doing one or all of these things.&lt;/p&gt;

&lt;p&gt;Some of us are naturally gifted at persuation and communication. Most of us aren't. The rest of us has to learn it like any other skill. But in my opinion, this is where we should start - at the basics.&lt;/p&gt;

&lt;p&gt;Answer what's so good about your offer or request that's so valuable to the intended recipient. What's in it for them? Then listen for real, and have empathy throughout the conversation and subsequent interactions.&lt;/p&gt;

&lt;p&gt;Am I a master at these things myself? Absolutely not. But this recent experience of being at the other end, made me realize how important it is to be mindful of our communication and persuation skills. What about you?&lt;/p&gt;

</description>
      <category>career</category>
      <category>startup</category>
      <category>watercooler</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>React - How to show then hide elements after a few seconds</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Sun, 12 Jun 2022 21:04:25 +0000</pubDate>
      <link>https://forem.com/karladampilag/react-how-to-show-then-hide-elements-after-a-few-seconds-2kl8</link>
      <guid>https://forem.com/karladampilag/react-how-to-show-then-hide-elements-after-a-few-seconds-2kl8</guid>
      <description>&lt;p&gt;Ever wondered how to hide elements after a few seconds in React?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem statement:&lt;/strong&gt; I want to show elements and make them disappear after a few seconds in React.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; use &lt;code&gt;setTimeout&lt;/code&gt; method from JavaScript, and hooks from React.&lt;/p&gt;

&lt;p&gt;Achieving this behavior in React is similar to how you'd do it in Vanilla JavaScript - by using &lt;code&gt;setTimeout&lt;/code&gt;. The only difference is you'll also use React hooks to store the visibility state, and set it to appear or disappear.&lt;/p&gt;

&lt;p&gt;Consider this React example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"App"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Show alert&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For now we only have a button. But we want an alert to show after clicking the button. Let's add the markup and necessary hooks for that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;import React from 'react';
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;function App() {
&lt;/span&gt;&lt;span class="gi"&gt;+    const [ isAlertVisible, setIsAlertVisible ] = React.useState(false);
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+    const handleButtonClick = () =&amp;gt; {
+        setIsAlertVisible(true);
+    }
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;    return (
        &amp;lt;div className="App"&amp;gt;
&lt;span class="gd"&gt;-           &amp;lt;button&amp;gt;Show alert&amp;lt;/button&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+           &amp;lt;button onClick={handleButtonClick}&amp;gt;Show alert&amp;lt;/button&amp;gt;
+           {isAlertVisible &amp;amp;&amp;amp; &amp;lt;div className='alert-container'&amp;gt;
+               &amp;lt;div className='alert-inner'&amp;gt;Alert! Alert!&amp;lt;/div&amp;gt;
+           &amp;lt;/div&amp;gt;}
&lt;/span&gt;        &amp;lt;/div&amp;gt;
  );
}
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;export default App;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What we did:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;used &lt;code&gt;useState&lt;/code&gt; hook to create &lt;code&gt;isAlertVisible&lt;/code&gt; and &lt;code&gt;setIsAlertVisible&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;created a &lt;code&gt;handleButtonClick&lt;/code&gt; function for when the button is clicked, and assigned it to the &lt;code&gt;onClick&lt;/code&gt; property of the button.&lt;/li&gt;
&lt;li&gt;added the alert markup, and only show it when &lt;code&gt;isAlertVisible&lt;/code&gt; is true.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We also want to add styles to the alert section, so it'll look more like an alert:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.alert-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.alert-inner&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8px&lt;/span&gt; &lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;-3px&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="m"&gt;70%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;-3px&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="m"&gt;70%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;-moz-box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;-3px&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="m"&gt;70%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to the important part - we want the alert to disappear after a few seconds. Suppose we want the alert to hide after 3 seconds, so we'll use the &lt;code&gt;useTimeout&lt;/code&gt; function, and pass 3000 milliseconds as the second parameter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;import React from 'react';
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;function App() {
&lt;/span&gt;    const [ isAlertVisible, setIsAlertVisible ] = React.useState(false);
&lt;span class="err"&gt;
&lt;/span&gt;    const handleButtonClick = () =&amp;gt; {
        setIsAlertVisible(true);
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+        setTimeout(() =&amp;gt; {
+            setIsAlertVisible(false);
+        }, 3000);
&lt;/span&gt;    }
&lt;span class="err"&gt;
&lt;/span&gt;    return (
        &amp;lt;div className="App"&amp;gt;
           &amp;lt;button onClick={handleButtonClick}&amp;gt;Show alert&amp;lt;/button&amp;gt;
           {isAlertVisible &amp;amp;&amp;amp; &amp;lt;div className='alert-container'&amp;gt;
               &amp;lt;div className='alert-inner'&amp;gt;Alert! Alert!&amp;lt;/div&amp;gt;
           &amp;lt;/div&amp;gt;   
        &amp;lt;/div&amp;gt;}
  );
}
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;export default App;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://i.giphy.com/media/LY8OJcNU2wt7pbOaGg/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/LY8OJcNU2wt7pbOaGg/giphy.gif" width="436" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you have it! Customize your alert to show more content, change the duration, change its style, go crazy 😉&lt;/p&gt;

&lt;p&gt;A good next step is to extract this behavior and turn it into a separate &lt;code&gt;Alert&lt;/code&gt; component. Make it accept different props from the parent, such as duration, content, position, and so on. Then whenever you need to alert a message, you can just re-use this &lt;code&gt;Alert&lt;/code&gt; component.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Test React hooks with React Testing Library - The Correct Mindset</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Sun, 15 May 2022 00:00:00 +0000</pubDate>
      <link>https://forem.com/karladampilag/test-react-hooks-with-react-testing-library-the-correct-mindset-4780</link>
      <guid>https://forem.com/karladampilag/test-react-hooks-with-react-testing-library-the-correct-mindset-4780</guid>
      <description>&lt;p&gt;I noticed a common pitfall with people new to &lt;em&gt;React Testing Library&lt;/em&gt; - testing implementation instead of functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One example would be, trying to test if the useState hook has been called or not. Don't do this! It's going against the design of the react-testing-library.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://testing-library.com/docs/react-testing-library/intro/"&gt;official documentation&lt;/a&gt; even states this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You want to write maintainable tests for your React components. As a part of this goal, you want your tests to avoid including implementation details of your components and rather focus on making your tests give you the confidence for which they are intended. As part of this, you want your testbase to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;In other words, testing internal variables goes against the philosophy of React Testing Library. This library is concerned with what the user sees, and the user doesn't know nor should care about internal variables and their values, and if they've been called or updated.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of what the users should see and expect, then test for those.&lt;/p&gt;

&lt;p&gt;Instead of testing if the React hooks were called, or if they have the correct values, we should test how the UI should behave when the user interacts with the component. That would automatically cover whether or not our React hooks are working as expected.&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;The more your tests resemble the way your software is used, the more confidence they can give you.&lt;/p&gt;— Kent C. Dodds 💿 (&lt;a class="mentioned-user" href="https://dev.to/kentcdodds"&gt;@kentcdodds&lt;/a&gt;) &lt;a href="https://twitter.com/kentcdodds/status/977018512689455106?ref_src=twsrc%5Etfw"&gt;March 23, 2018&lt;/a&gt;
&lt;/blockquote&gt; 
&lt;h2&gt;
  
  
  Real life examples
&lt;/h2&gt;

&lt;p&gt;Think of it this way: each React component serves a purpose, and should act in an expected way. The way we implement how the component will "serve its purpose" may change along the way. You or a colleague might find a better approach in the future, and refactor the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If the component's expected behavior won't change despite these implementation changes, then the changes shouldn't break the tests.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, if you wrote a modal component, then it's supposed to show when you want it, and not show otherwise. How you implement this behavior may change throughout the life of your app. &lt;strong&gt;But at the end of the day, the users will expect it to behave the same.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's why we should test the functionality, not the implementation, when testing React components. Did I say that enough times already?&lt;/p&gt;

&lt;h3&gt;
  
  
  So what should we test specifically?
&lt;/h3&gt;

&lt;p&gt;When thinking of things to test, mimic the way the user would use the application. Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When the component renders, what should the user initially see? This is where you use react-testing-library queries to check if the expected elements such as labels and inputs are present in the DOM.&lt;/li&gt;
&lt;li&gt;If a user types into an input field, the user expects to see the characters present on the input field.&lt;/li&gt;
&lt;li&gt;If it's a dropdown, then the dropdown should show the options when clicked, and then hide the options when an option has been clicked. It should also show the selected value. Again, the library's query functions are provided for this very purpose.&lt;/li&gt;
&lt;li&gt;If you're prompting a user for a number input, then a good test would be checking if the user can input numbers, but not other characters.&lt;/li&gt;
&lt;li&gt;When a user clicks on a clickable element, what should the user see next? A message prompt? A special interaction? A change in behavior? Some other element will show up? Or hide? And so on.&lt;/li&gt;
&lt;li&gt;Fire any events to simulate user actions (e.g. input information in form, click button to submit a form, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A good tip is to make the test resilient to very small changes in implementation, such as changing lower case to upper case for labels, and so on. Remember, test behavior, not implementation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It doesn't mean we should only test the UI behavior when writing any kind of unit test. I'm only talking about testing React components using the react-testing-library, which is concerned with the presentation layer of our code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The other parts of code should still be tested as well. All the data manipulation, computation and other logic should have separate tests.&lt;/p&gt;

&lt;p&gt;Besides, in the first place, the data layer of our code must be separate from our presentation layer (with which React or other UI libraries are concerned). And these other layers should have their own separate tests 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  Actual Examples
&lt;/h2&gt;

&lt;p&gt;Now that you're approaching &lt;em&gt;React Testing Library&lt;/em&gt; with the correct mindset, you're ready to look at concrete examples. For such examples, head back to the library's &lt;a href="https://testing-library.com/docs/react-testing-library/intro/"&gt;documentation&lt;/a&gt;. Another great resource is &lt;a href="https://blog.logrocket.com/a-quick-guide-to-testing-react-hooks-fa584c415407/"&gt;Guide to testing React Hooks&lt;/a&gt;. Their &lt;em&gt;Introducing react-testing-library&lt;/em&gt; section provides very good examples of the behaviors we talked about.&lt;/p&gt;

&lt;p&gt;Happy testing!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How To Learn React JS Quickly</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Thu, 28 Apr 2022 00:00:00 +0000</pubDate>
      <link>https://forem.com/karladampilag/how-to-learn-react-js-quickly-1a0h</link>
      <guid>https://forem.com/karladampilag/how-to-learn-react-js-quickly-1a0h</guid>
      <description>&lt;h2&gt;
  
  
  1. Learn JavaScript first
&lt;/h2&gt;

&lt;p&gt;This is a no-brainer, but let's get it out of the way.&lt;/p&gt;

&lt;p&gt;You can't really learn React fast if you're not familiar with the language that the library is built for.&lt;/p&gt;

&lt;p&gt;I wrote a post listing beginner exercises in React, and even those beginner exercises need JavaScript as a prerequisite. If you skip JavaScript and learn React straightaway, you'll actually make your learning time longer because you skipped the basics, or the pre-requisite.&lt;/p&gt;

&lt;p&gt;Not to mention that if you skip JavaScript, you'll have a hard time knowing which part of your code is just JavaScript and which part is React. How will you debug when you come across errors and bugs?&lt;/p&gt;

&lt;p&gt;So if you want to learn React quickly, then get comfortable with JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  But how much JavaScript do you need for React?
&lt;/h3&gt;

&lt;p&gt;At the very least, you should know the most important ES5 and ES6 concepts (ES5 and ES6 is the first and second major revision to JavaScript):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the let and const keyword&lt;/li&gt;
&lt;li&gt;arrow functions&lt;/li&gt;
&lt;li&gt;template literals&lt;/li&gt;
&lt;li&gt;default parameters&lt;/li&gt;
&lt;li&gt;array and object destructuring&lt;/li&gt;
&lt;li&gt;for-of operator&lt;/li&gt;
&lt;li&gt;find method&lt;/li&gt;
&lt;li&gt;ES5 array methods &lt;/li&gt;
&lt;li&gt;ES5 JSON methods&lt;/li&gt;
&lt;li&gt;ES5 Date methods&lt;/li&gt;
&lt;li&gt;modules (import and export)&lt;/li&gt;
&lt;li&gt;promises&lt;/li&gt;
&lt;li&gt;async / await (not ES5 or ES6, but ECMAScript 2016)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Understand declarative vs. imperative programming
&lt;/h2&gt;

&lt;p&gt;This is the part where I failed, so I'm including it here so you don't have to make the same mistakes.&lt;/p&gt;

&lt;p&gt;React is a declarative library, while JavaScript is an imperative programming language. That means learning React after learning JavaScript requires a bit of a shift in thinking, because they're almost opposite paradigms.&lt;/p&gt;

&lt;p&gt;When I was learning React some years ago, I didn't even know I was doing imperative stuff on my React projects for my portfolio. In one job interview, the interviewer himself pointed it out and told me how it's supposed to be done in React.&lt;/p&gt;

&lt;p&gt;Bless his kind soul.&lt;/p&gt;

&lt;p&gt;I didn't have time to correct my code, but I kept what he said in mind. In another interview at another company, the interviewer pointed out the same section in my code. He asked me what I think I did wrong. Because I remembered what the first interviewer said, I was able to answer this question correctly. The whole interview was more engaging because I could talk more about my code and how to improve it. &lt;strong&gt;I got hired and work there until now&lt;/strong&gt; 😉&lt;/p&gt;

&lt;p&gt;To give you an example of these two different programming paradigms, take a look at exercise #5 at &lt;a href="https://coderfiles.dev/blog/reactjs-coding-exercises/"&gt;9 Beginner React JS Exercise Problems&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Read the docs
&lt;/h2&gt;

&lt;p&gt;For any new library you've decided to use, never skip reading the documentation. If you're just learning how to code, I recommend you also learn how to read and make sense of the documentation of whatever you're trying to learn.&lt;/p&gt;

&lt;p&gt;At work, you'll be using a lot of libraries. You have to get comfortable learning how to use libraries by reading their documentation. You just have to 😉&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Code right away&lt;/li&gt;
&lt;li&gt;Fail&lt;/li&gt;
&lt;li&gt;Finally consult documentation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/ChWovTZiguUC4PGBoV/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/ChWovTZiguUC4PGBoV/giphy.gif" width="428" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I was a junior developer, I solely relied on Stack Overflow and tutorials. I was impatient and jumped straight to coding after scanning their documentation. &lt;b&gt;This led to bad practices and lots of workarounds to force the library to do what I want.&lt;/b&gt; If only I read the docs, I would have implemented the logic better, because I knew the library better. No work arounds, no hacks.&lt;/p&gt;

&lt;p&gt;You'll learn exactly how to use the library in different use cases, its features, limitations, and the creators' recommendations on approaching different scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you don't believe me&lt;/strong&gt;, here's my story:&lt;/p&gt;

&lt;p&gt;We had a new hire that had the same years of working experience as me, who just learned React recently. Her past experience was Angular, and at this time I already had 1-2 years of experience in React.&lt;/p&gt;

&lt;p&gt;Until then, I put so much importance in learning on the job. I thought everything you have to know for the job, you'll eventually learn ALL of it on the job.&lt;/p&gt;

&lt;p&gt;But one time, I got blown away with her solution because I didn't know you could do it like that. When I asked her how she knew [insert whatever she did here. Sorry, I no longer remember what it was], she said, "it’s in the docs".&lt;/p&gt;

&lt;p&gt;While I was correct that you'll learn the ropes on the job, she learned more effectively because she read the documentation first, unlike me 🙂&lt;/p&gt;

&lt;p&gt;I've been working with React for a while now, and yet I still learn new things about the library from time to time. And the first place I go to is the official documentation, because... lesson learned 😉&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Start working on small, tiny projects
&lt;/h2&gt;

&lt;p&gt;You know what they all say in the learn-to-code space - don't get stuck in tutorial hell. And the only way to get out of tutorial hell is to work on your own projects to apply what you've learned from those tutorials.&lt;/p&gt;

&lt;p&gt;If you're having a hard time with your own projects, maybe they're too big. Start small, and then work your way up to more complicated projects.&lt;/p&gt;

&lt;p&gt;I wrote a list of very &lt;a href="https://coderfiles.dev/blog/reactjs-coding-exercises/"&gt;basic React exercise problems&lt;/a&gt; just for this very reason.&lt;/p&gt;

&lt;p&gt;After these exercises, you'd want to move on to a small project.&lt;/p&gt;

&lt;p&gt;For example, check out this step-by-step React tutorial for the Card Memory game: &lt;a href="https://fullstackvault.xyz/blog/react-js-sample-project-step-by-step"&gt;https://fullstackvault.xyz/blog/react-js-sample-project-step-by-step&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's what's typically meant with "small" or "beginner React project".&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Build bigger projects
&lt;/h2&gt;

&lt;p&gt;After gaining confidence with a small React project, it's time to move on to larger React projects.&lt;/p&gt;

&lt;p&gt;If you're struggling with ideas, check out the tutorials and project ideas at &lt;a href="https://fullstackvault.xyz"&gt;https://fullstackvault.xyz&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should you take courses?
&lt;/h3&gt;

&lt;p&gt;Since I got pretty comfortable with JavaScript, I didn't need to pay for any courses to learn React. But I still took a crash course on YouTube, that is basically a long tutorial for a large React project. I would say it propelled my knowledge faster than if I did all my curriculum on my own.&lt;/p&gt;

&lt;p&gt;Yes, the documentation is good for learning the concepts that come with the library. But after that, it's time to put theories into action and solidify what you've learned by making your own projects. That's what the crash course did for me.&lt;/p&gt;

&lt;p&gt;If you're ready to work on big React projects after going through steps 1-4 above, I highly recommend tutorials or courses that cover medium to large-sized React projects that were &lt;b&gt;released recently&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;React is updated very frequently, so you want to avoid outdated and obsolete content. I made a curation of very good resources for React here: &lt;a href="https://fullstackvault.xyz/"&gt;fullstackvault.xyz&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR? How to learn React js quickly
&lt;/h2&gt;

&lt;p&gt;Learn JavaScript first! How much exactly? It’s listed in the first item.&lt;/p&gt;

&lt;p&gt;Second, understand imperative vs. dynamic programming, because learning React after JavaScript requires a paradigm shift. A concrete example plus an exercise is included in item no. 2.&lt;/p&gt;

&lt;p&gt;Third, read the documentation. In item no. 3, I wrote why skipping this step might set you up to learn React ineffectively. So avoid developing bad practices from the get-go by reading the docs.&lt;/p&gt;

&lt;p&gt;Next, get out of tutorial hell by working on your own projects. Start small and then gradually move to bigger and more complex projects. A list of beginner exercises plus a repository of advanced projects are linked in items 4 and 5.&lt;/p&gt;

&lt;p&gt;And finally, if you have any concerns or questions, I’m always happy to help 🙂 Just drop a comment below. Other than that, happy learning!&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>9 Simple (But Important) React JS Coding Exercises You Need To Do As A Beginner</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Tue, 30 Nov 2021 00:00:00 +0000</pubDate>
      <link>https://forem.com/karladampilag/9-simple-but-important-react-js-coding-exercises-you-need-to-do-as-a-beginner-276l</link>
      <guid>https://forem.com/karladampilag/9-simple-but-important-react-js-coding-exercises-you-need-to-do-as-a-beginner-276l</guid>
      <description>&lt;p&gt;You know what they say, if you REALLY want to learn React, build something! Don't get stuck in tutorial hell.&lt;/p&gt;

&lt;p&gt;Well, what if you're not that far into your journey, and still aren't able to build full-blown projects?&lt;/p&gt;

&lt;p&gt;That's what this post is for, which is inspired by the post, &lt;a href="https://dev.to/spencercarli/12-exercises-to-learn-react-native-3ee5"&gt;"12 Exercises to Learn React Native"&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  React JS Exercises
&lt;/h2&gt;

&lt;p&gt;These exercises will help you apply the basic concepts of React through tiny projects. Once you finish all exercises, you'll know you've got the basics down. Then you can start learning more advanced concepts, and build more complicated projects.&lt;/p&gt;

&lt;p&gt;So let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  React JS Coding Challenges
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Exercise 1: Hello World!
&lt;/h3&gt;

&lt;p&gt;Every programming language starter tutorial teaches you how to output "Hello, World!" using the language.&lt;/p&gt;

&lt;p&gt;But this exercise is not just for tradition.&lt;/p&gt;

&lt;p&gt;This will asses if you actually know HTML, which is &lt;strong&gt;one of the many prerequisites before learning React&lt;/strong&gt;. Start by rendering a square with a background color. Inside the square, render "Hello, World!".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focgrorsp4egm4ytti0i9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focgrorsp4egm4ytti0i9.jpg" alt="React JS Coding challenges exercise 1" width="562" height="554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/html/"&gt;HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/css/css_align.asp"&gt;how to center a text inside a div&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 2: Capturing User Clicks
&lt;/h3&gt;

&lt;p&gt;What makes a web app different from a static website? A web app is interactive. Of course, there's more to web apps than capturing clicks, but it's important to start from the basics.&lt;/p&gt;

&lt;p&gt;This exercise gets you started with &lt;strong&gt;event handling, which is a basic concept not only in React but also in JavaScript (which is again another pre-requisite before learning React)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Using the native HTML &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; tag, capture the click event and alert the message, "Clicked!".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Take note that capturing events such as clicks is done differently in React than it is in JavaScript.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/QseBpgmWRAUrgpxtGj/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/QseBpgmWRAUrgpxtGj/source.gif" width="811" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/handling-events.html"&gt;handling events in React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/jsref/met_win_alert.asp"&gt;alert() method&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 3: Custom Component
&lt;/h3&gt;

&lt;p&gt;In the previous exercise, we used the HTML &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; tag. But &lt;strong&gt;much of the power that React provides to us developers is being able to create our own components and reuse them.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You'll be creating more complicated custom components than a simple button in the near future, but we all gotta start somewhere.&lt;/p&gt;

&lt;p&gt;In this exercise, build your own Button component and render it three times. On user click, it should alert which button was clicked:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/4C72sQTzuysQ71m8sw/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/4C72sQTzuysQ71m8sw/source.gif" width="811" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The custom component should accept an &lt;code&gt;onClick&lt;/code&gt; prop. On render, it should render the children betwen the button. This is the text you want for the button.&lt;/p&gt;

&lt;p&gt;Think of it like the HTML &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; tag. Whatever text you place between the opening and closing tag is rendered between the button when you inspect the element in your browser developer console.&lt;/p&gt;

&lt;p&gt;On user click, it should alert which button was clicked.&lt;/p&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/components-and-props.html"&gt;React props and components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/49706823/what-is-this-props-children-and-when-you-should-use-it"&gt;"children" in React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.browserstack.com/guide/inspect-element-in-chrome"&gt;how to inspect element with developer console&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 4: State and Props
&lt;/h3&gt;

&lt;p&gt;So you're comfortable working with props, congratulations! Using props allows us to pass values or functions down to a child component.&lt;/p&gt;

&lt;p&gt;State is another integral concept we must learn in React. It allows us to store values, and React automatically updates our UI when the values change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's one of the many beautiful things with React.&lt;/strong&gt; We don't need to manually handle these things - React does the UI re-rendering for us when a value changes. But we must know how to use the state for this purpose.&lt;/p&gt;

&lt;p&gt;This exercise is simple, and is a very common React tutorial out there. Use the &lt;code&gt;useState&lt;/code&gt; React hook to track how many times a button is clicked, and display the number.&lt;/p&gt;

&lt;p&gt;The number must increment each time the button is clicked:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/My670LXjzJvHTgcjU3/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/My670LXjzJvHTgcjU3/source.gif" width="811" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Helpful link:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/hooks-state.html"&gt;React state hook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 5: Mapping Through A List And Rendering
&lt;/h3&gt;

&lt;p&gt;To get comfortable with React, you must learn declarative programming.&lt;/p&gt;

&lt;p&gt;React is declarative. So you need to think in "declarative programming" whenever you work with React, and this exercise is perfect for that. This is the "opposite" of imperative programming which is the paradigm used in Vanilla JavaScript.&lt;/p&gt;

&lt;p&gt;In this exercise, instead of manually and "imperatively" coding the render of each item in a list, use the map function to "declare" how React should render the list.&lt;/p&gt;

&lt;p&gt;Given an array:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;['dog', 'cat', 'chicken', 'cow', 'sheep', 'horse']&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Use the map function to render them in an unordered list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dog&lt;/li&gt;
&lt;li&gt;cat&lt;/li&gt;
&lt;li&gt;chicken&lt;/li&gt;
&lt;li&gt;cow&lt;/li&gt;
&lt;li&gt;horse&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you learn the concept of rendering declaratively, you'll see how much life becomes easier (overstatement).&lt;/p&gt;

&lt;p&gt;But think of it this way...&lt;/p&gt;

&lt;p&gt;Our example list is not that big, but imagine if the list contains thousands of items, which is true when working with real-life data and real-world applications. &lt;strong&gt;You wouldn't want to manually code each &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; one thousand times, right?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And what if the data changes? This is the case when working with data in production environment. You'll have to change the code again.&lt;/p&gt;

&lt;p&gt;But not when you rendered the list declaratively. When the data changes, and you rendered your data presentation declaratively, a.k.a. the smart way, then your declarative code does the change for you.&lt;/p&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.co/lessons/react-declarative-programming"&gt;Declarative programming vs. imperative programming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"&gt;map() function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/lists-and-keys.html"&gt;rendering lists in React&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 6: Mapping Through A List And Rendering (With A Custom Component)
&lt;/h3&gt;

&lt;p&gt;In exercise 3, we mentioned that part of what makes React so great is that it allows us to create our custom, re-usable components.&lt;/p&gt;

&lt;p&gt;You only created a custom button there. This time, you'll create a custom component that displays each item from exercise 5:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;['dog', 'cat', 'chicken', 'cow', 'sheep', 'horse']&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Instead of using the &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; HTML tags, create a custom component that accepts a list as its prop, and renders it accordingly.&lt;/p&gt;

&lt;p&gt;It's up to you how you want this list will look like. I decided mine to look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e15f5qo8xcnq3wpp31g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e15f5qo8xcnq3wpp31g.jpg" alt="React JS coding exercises screenshot 6" width="181" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the point of creating custom components?&lt;/strong&gt; You'll be able to re-use them. Think of it like creating your own functions.&lt;/p&gt;

&lt;p&gt;Instead of copy-pasting the same lines of code everywhere you need them, you put those blocks of code inside a separate function, and you just call that function whenever you need it.&lt;/p&gt;

&lt;p&gt;This is very good practice because if you need to make changes to your code, you don't need to change it in every place where you used it. You just need to change it in one place.&lt;/p&gt;

&lt;p&gt;That's one of the many benefits of using custom components. There are more reasons to using custom components, which needs a whole new blog post, but this is a good start.&lt;/p&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/components-and-props.html"&gt;React props and components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"&gt;map() function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/lists-and-keys.html"&gt;rendering lists in React&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 7: Building A Form
&lt;/h3&gt;

&lt;p&gt;Unleash some more power from React by building a form. React is great for this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/JtjlF8GzLQZrJnu1st/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/JtjlF8GzLQZrJnu1st/source.gif" width="811" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Build a form that accepts a first name and a last name. And instead of a boring "Submit" button, make a button that says "Greet Me" that when clicked, will alert "Hello [first name] [last name]!".&lt;/p&gt;

&lt;p&gt;Here you will use a combination of concepts from previous exercises, such as using state, and event listening both on text input and button click.&lt;/p&gt;

&lt;p&gt;But there is one specific concept we didn't tackle yet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/forms.html"&gt;React forms and onChange() function&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 8: Rendering JSON
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Most of the time, the structure of the data we're working with in real-world applications aren't simple lists like ['dog', 'cat', 'chicken', 'cow', 'sheep', 'horse'].&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A lot of data is stored in JSON format. This is especially true when you're fetching data from a database.&lt;/p&gt;

&lt;p&gt;JSON stands for JavaScript Object Notation, a type of format for data interchange.&lt;/p&gt;

&lt;p&gt;This type of data is just an object instead of a simpler datatype such as a string.&lt;/p&gt;

&lt;p&gt;For example, an array of JSON objects looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    {
        id: 1,
        setup: "What's the best thing about a Boolean?",
        punchline: "Even if you're wrong, you're only off by a bit"
    },
    {
        id: 2,
        setup: "Why do programmers wear glasses?",
        punchline: "Because they need to C#"
    }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To keep it simple, let's keep it to only two items.&lt;/p&gt;

&lt;p&gt;Using the array of objects above, render the jokes with React.&lt;/p&gt;

&lt;p&gt;Here's how I decided to render mine:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F194tfea6zs23g66qhwrd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F194tfea6zs23g66qhwrd.jpg" alt="React practice problems exercise 8" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tip:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a custom component for rendering each joke.&lt;/li&gt;
&lt;li&gt;Using the map function, map through each object in the array. Use the custom component to render each object.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/js/js_json_intro.asp"&gt;JSON&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/"&gt;Flexbox&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Exercise 9: Working with an API
&lt;/h3&gt;

&lt;p&gt;Last but definitely not the least, work with an API and build a simple frontend:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/YuTVbi0u6xsgTmRcNf/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/YuTVbi0u6xsgTmRcNf/source.gif" width="941" height="1321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every React or any frontend developer must learn how to work with an API. When building applications, you receive data from the backend or an outside source which you will have to present nicely in the UI.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fetch from this API endpoint: &lt;a href="https://random-data-api.com/api/users/random_user?size=10"&gt;https://random-data-api.com/api/users/random_user?size=10&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will return ten random users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here we'll put together everything we did from the previous examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Show each user's basic info in a card.&lt;/li&gt;
&lt;li&gt;When a card is hovered upon, the card flips to show more information about the user.&lt;/li&gt;
&lt;li&gt;There should also be a button that when clicked, will fetch another set of 10 random users, which updates the cards.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here are the steps for this exercise:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetch the data from the URL. You also have to handle converting the JSON response into a JavaScript object in this process. (See Response.json() resource link below)&lt;/li&gt;
&lt;li&gt;Store it in React state.&lt;/li&gt;
&lt;li&gt;Render the data based on the state.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Take note that most APIs return data in the form of JSON. Good thing we already covered JSON in the previous exercise 😄&lt;/p&gt;

&lt;p&gt;Hints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do the fetching inside a useEffect React hook&lt;/li&gt;
&lt;li&gt;Create a custom component for the card, which accepts a user JSON object. Map through the data returned from the API and render each one using the custom component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Helpful links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/what-is-an-api-in-english-please-b880a3214a82/"&gt;What is an API? In English, please&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/how-to-make-api-calls-with-fetch/"&gt;How to use Fetch API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Response/json"&gt;Response.json() function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/hooks-effect.html"&gt;React useEffect hook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We'll also be needing a lot more CSS, especially for the card hover effect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.w3schools.com/howto/howto_css_flip_card.asp"&gt;Card flip effect&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion - React Practice Problems
&lt;/h2&gt;

&lt;p&gt;If you're an aspiring React developer, these exercises will help you understand many concepts that are integral in both React and frontend web development as a whole.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every exercise here is used in my daily life as a React developer. And I hope this helps you get closer to your goal.&lt;/strong&gt; Soon they'll be second nature to you, and you'll be coding them without even thinking about it!&lt;/p&gt;

&lt;p&gt;If you find yourself stuck, or need any help with the exercises, just let me know and I'd be happy to help.&lt;/p&gt;

&lt;p&gt;I'm over at Twitter as well, and I have a newsletter where I send updates for new posts like this.&lt;/p&gt;

&lt;p&gt;Hope you have fun learning!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What do you need help with?</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Sat, 13 Feb 2021 06:41:01 +0000</pubDate>
      <link>https://forem.com/karladampilag/what-do-you-need-help-with-5aol</link>
      <guid>https://forem.com/karladampilag/what-do-you-need-help-with-5aol</guid>
      <description>&lt;p&gt;Let me start: I just started blogging here on dev.to because I want to give back and help fellow humans in the dev community. But I need help knowing what people need help with,exactly. What about you, what do you need help with?&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>discuss</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>A Programmer's Reflection</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Fri, 12 Feb 2021 09:06:50 +0000</pubDate>
      <link>https://forem.com/karladampilag/a-programmer-s-reflection-50en</link>
      <guid>https://forem.com/karladampilag/a-programmer-s-reflection-50en</guid>
      <description>&lt;p&gt;Junior to intermediate developers can relate.&lt;/p&gt;

&lt;h2&gt;
  
  
  It All Started With A Client Meeting
&lt;/h2&gt;

&lt;p&gt;Yesterday, the company I work for had a retrospective meeting with one of our clients. The team at our company that works on that project has met with the team at the client company that handles the project on their end.&lt;/p&gt;

&lt;p&gt;It was scheduled for three hours and we talked about the past year, so obviously a lot of things were brought up and discussed. In the end, one thing in particular stuck out to me more than the other topics. It's not because the rest were unimportant, but because this one is an important realization for me.&lt;/p&gt;

&lt;p&gt;Here's what happened:&lt;/p&gt;

&lt;p&gt;When we came to the topic about the current situation of the project, a colleague of mine, a fellow developer, said something that led to this blog post.&lt;/p&gt;

&lt;p&gt;He said that the system is not ready to use in production. That's interesting to hear, especially since the system is already released to production.&lt;/p&gt;

&lt;p&gt;That's right.&lt;/p&gt;

&lt;p&gt;While we're developing incoming features of the system, our client also rolled out the first version to one of their own clients. This is to test the MVP (minimum viable product), gather feedback, and train these first users to use the new system. That means development of new features and maintenance in production is already happening in parallel.&lt;/p&gt;

&lt;p&gt;We're using the agile methodology, by the way. I'm going to share one of my favorite pieces of content regarding software development. If you won't read the entire article, I'll extract the best part for you:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Back to Basics
&lt;/h2&gt;

&lt;p&gt;"Building software in an agile fashion will always be speedier, team members will be more motivated and overall outcomes will be better compared to the plan-months-ahead waterfall style development. As the benefits are immediate...&lt;/p&gt;

&lt;p&gt;When building a product, do it in an agile way. Do small changes, get immediate feedback, do small iterations and make decisions that allow future changes as much as possible."&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://blog.pragmaticengineer.com/what-agile-really-means/"&gt;What Agile Really Means&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  A Tug of War
&lt;/h2&gt;

&lt;p&gt;Back to the meeting, my colleague proceeded to give examples why he thought the system isn't production-ready. The more detailed he got, the more I realized that his concern is the UI (user interface) and UX (user experience).&lt;/p&gt;

&lt;p&gt;For example, this view is meant to do one thing. But to do that one thing, the user has to click in different places and do more steps, when it could have taken less clicks and less steps.&lt;/p&gt;

&lt;p&gt;He's right, you know. But I'm not gonna talk about why UX is important, because we already know that (it's a whole other topic in itself). What I'm gonna talk about instead is what our CEO said in response to this.&lt;/p&gt;

&lt;p&gt;"Well, first you have to make it work." He's also right. Spoken like a true agile practitioner. Our CEO then elaborated on making whatever you're building to work first. And then you can iterate based on the feedback, provided that you can. But more on this later.&lt;/p&gt;

&lt;p&gt;My colleague repeated his concerns, and added that he studied this topic (I'm guessing formally, in school). And again, he's right. User experience is important.&lt;/p&gt;

&lt;p&gt;Then another colleague said, that you can take your time perfecting every detail like this, and then you turn around and suddenly it's the deadline and you accomplished nothing.&lt;/p&gt;

&lt;p&gt;While my colleagues were going back and forth in their discussions, the first thing that came to my mind is that the system is very big and complex. Despite the MVP out of the way, we still have a LOOOOOT of things on our plate for this project. And because of this, details in the user interface are obviously not going to be a top priority. At least not in this stage of the project, when we still have a lot of bigger features to ship.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Client's Problem
&lt;/h2&gt;

&lt;p&gt;So while our CEO and my colleague were still at it, the client butted in. Can you guess what the client said?&lt;/p&gt;

&lt;p&gt;If you'd ask me, I might guess that he complained why the system isn't built perfectly in the first try.&lt;/p&gt;

&lt;p&gt;But instead, he said that the current system that their clients are using, the same system that our product will replace, is very unstable. It could fail anytime. He didn't say this next part, but that also means that when it does fail, it will cost them and their clients a lot of money.&lt;/p&gt;

&lt;p&gt;He did say that they are under a lot of pressure because of this, that's why they need to rollout ASAP. That's why they already rolled out to the first customer that could accommodate it.&lt;/p&gt;

&lt;p&gt;This just confirmed the point of this blog post, which is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In a perfect world, we can make everything pretty and nice in the beginning. In an ideal world, we have all the time and money we need. But we aren't in a perfect world. We are in the real world, where we have actual real-life constraints.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And in this case, the constraint is that the client has a budget, and they have a deadline.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Do You NEED?
&lt;/h2&gt;

&lt;p&gt;I totally sympathize with my fellow developer colleague who brought up his two cents. He's coming from a position of caring about the product, that's why he had this concern in the first place.&lt;/p&gt;

&lt;p&gt;However, I do agree that as people who implement features, it's important to also see the big picture.&lt;br&gt;
And in this case, the big picture is that replacing their current system with a stable one as soon as possible is the NEED of the client (while having the best UX is not).&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't Be A Race Horse
&lt;/h2&gt;

&lt;p&gt;I'm gonna share a very good metaphor my dad told me in a different situation, but you'd agree it applies here very well.&lt;/p&gt;

&lt;p&gt;Race horses use this thing called "blinders" around their eyes, which prevents them from seeing what's at either side. This helps avoid distraction from other horses that are racing beside them, so they can focus and look ahead.&lt;/p&gt;

&lt;p&gt;If, as software developers, we don't look at the bigger picture, we are like these race horses. We only see one side. For creators, this "one side" is usually whatever we're directly working on. &lt;strong&gt;I suggest we take the "blinders" off, so we could be more effective at what we do.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Developer vs. Engineer
&lt;/h2&gt;

&lt;p&gt;I think this is what separates a software engineer from a software developer. I read something a while back, that at its core, engineering is "solving problem X, given Y and Z, while considering the constraints A, B, and C." A developer develops, an engineer engineers. A developer is concerned about developing a feature of the software. An engineer considers the constraints as well. And we only went over the business constraint. What about all the technical constraints?&lt;/p&gt;

&lt;p&gt;That's why it is the engineers who design what the developers will build. And by "design", I definitely did not mean graphic design, but more on the system design.&lt;/p&gt;

&lt;p&gt;Anyway, as programmers, a familiar pitfall is to get too caught up with our code. We get "married" to it. But what about the big picture? What does the client NEED? Why do they need it? And then ask "why" even more.&lt;/p&gt;

&lt;p&gt;I'm not saying my colleague is stupid (he wouldn't be working at the company as a software developer if he is). I actually go to him for help regarding the parts of our system of which he is an expert. But we are both "juniors". Let me rephrase - we are both VERY juniors compared to our CEO, and it showed. And as we all gain more experience in software development projects, we gain wisdom like these. I surely did, and I'm sharing this so that hopefully I'm not the only one who learns.&lt;/p&gt;

&lt;p&gt;And our CEO? As you might have guessed, he mentioned it's important to look at the big picture. Then he apologized to my colleague for not effectively communicating the big picture to us developers. That is some leadership right there (but again is another topic on its own).&lt;/p&gt;

&lt;h2&gt;
  
  
  Good Enough vs. Perfect
&lt;/h2&gt;

&lt;p&gt;What about the whole, "it's good enough" versus "it's not perfect" debate that I introduced in the beginning?&lt;/p&gt;

&lt;p&gt;Well, &lt;strong&gt;the answer is to prioritize, since we already established that we can't have everything.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a perfect world, we can build our &lt;strong&gt;dream product&lt;/strong&gt; because we have &lt;strong&gt;unlimited time and money&lt;/strong&gt;. We don't. If you ignore that, then nothing is ever finished.&lt;/p&gt;

&lt;p&gt;What about you, did you have a similar experience in your journey as a dev?&lt;/p&gt;

</description>
      <category>development</category>
      <category>devjournal</category>
      <category>programming</category>
    </item>
    <item>
      <title>Dear Code Newbie, Here's A Tip</title>
      <dc:creator>Karla Dampilag</dc:creator>
      <pubDate>Sat, 23 Jan 2021 04:15:48 +0000</pubDate>
      <link>https://forem.com/karladampilag/dear-code-newbie-here-s-a-tip-4c3o</link>
      <guid>https://forem.com/karladampilag/dear-code-newbie-here-s-a-tip-4c3o</guid>
      <description>&lt;p&gt;This is in response to: &lt;a href="https://dev.to/karladampilag/comment/1am1j"&gt;How Do You Take Notes?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclaimer: the points below are more geared toward a code newbie. I'm betting that an experienced programmer won't find this helpful. &lt;strong&gt;But&lt;/strong&gt; if you are one, do let me know if you did this or not, and if it helped, or what worked for you instead.&lt;/p&gt;

&lt;p&gt;Here's what worked for me when I was a code newbie:&lt;/p&gt;

&lt;p&gt;Write. Down. Code. Physically write it down... in your notes.&lt;/p&gt;

&lt;h1&gt;
  
  
  The "Success" Testimonial
&lt;/h1&gt;

&lt;p&gt;A little backstory - I took web development courses back in college. At one point, we learned about an API called &lt;em&gt;XMLHttpRequest&lt;/em&gt;. It's an old tech, but it's just another API that allows you to fetch data from a server.&lt;/p&gt;

&lt;p&gt;Anyway, I wrote the whole thing down in my notebook - from setting up HTTP headers, to sending the request and accepting the response, along with all the magic you could do with the data. You know, typical web dev stuff.&lt;/p&gt;

&lt;p&gt;I read it during my commute to class. I made it my goal to do all those things on the computer without referring to my notes. &lt;/p&gt;

&lt;p&gt;Eventually, a lab test came, and guess what we had to do? You guessed it! Fetch data from some URL, display the "objects" on the browser, and so on. (I remember when using HTML tables to display responsively was the norm. Eugh 😀) Basically, we had to come up with a tiny CRUD app within the time given to us.&lt;/p&gt;

&lt;p&gt;Needless to say, I passed the test since I already knew the process at heart. I remember toying with how I wanted to display the stuff on the screen (the last thing you want to spend time on). Meanwhile, my seatmates were still figuring out how to successfully get the stuff we needed to display.&lt;/p&gt;

&lt;h1&gt;
  
  
  Do Not Copy and Paste, But On Steroids
&lt;/h1&gt;

&lt;p&gt;You've probably heard of the "do not copy and paste" tip from the coding community. &lt;strong&gt;This is in the context that you're learning something new.&lt;/strong&gt; It's not a secret - the new and unfamiliar code you copy-pasted is too easy to forget. But when you write them on paper, you're applying some variation of "do not copy and paste"... it's on steroids.&lt;/p&gt;

&lt;h2&gt;
  
  
  What distractions?
&lt;/h2&gt;

&lt;p&gt;You make it harder to get distracted from your computer (or phone). This is especially true for students who need to study for school. Interestingly, the longer I worked as a developer, the less I kept these kind of notes. It's easy to Google syntaxes and commands nowadays.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond the syntax
&lt;/h2&gt;

&lt;p&gt;But even experienced people in the industry still keep some notes... they're just a different kind of content.&lt;/p&gt;

&lt;p&gt;For example, soon you might need to draw a diagram to help decide where and how to put relationships in your schema. Or you might need some mockups for this new feature you have to build.&lt;/p&gt;

&lt;p&gt;In other words, you spew out quick and "messy" notes of your headspace. These are the kind of content you come up with during the planning and design phases of your work... before they get translated into the more beautiful diagrams and charts for your bosses and clients.&lt;/p&gt;

&lt;p&gt;The point is, the notes may vary from person to person, but the purpose is the same - to get it out there, to make it reside in a place that won't go away. Your brain can only hold so much information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cheat sheets
&lt;/h2&gt;

&lt;p&gt;Last but definitely not the least, you have your personal knowledge bank.&lt;/p&gt;

&lt;p&gt;Remember when you Googled that unfamiliar thing?  You had many tabs open. You then arrived with the answer after putting together some different sources. Well, you could pull out those chunks and keep them in a single place, where you can easily access them when you need them again.&lt;/p&gt;

&lt;p&gt;Another thing - I noticed a popular term that people use is "cheat sheet". So if you've never done this before, here's some examples for inspiration: &lt;a href="https://github.com/typescript-cheatsheets/react"&gt;React + TypeScript Cheatsheets&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The "Failure" Testimonial
&lt;/h1&gt;

&lt;p&gt;Anyway, I felt the need to share this "tip" because I noticed that not everyone does it.&lt;/p&gt;

&lt;p&gt;I don't know why, but even my classmates back in college didn't do this. They took down notes during lectures when we talked about theory, but they never did it during laboratory when we wrote actual code on the computer (and presumably applied the aforementioned theory).&lt;/p&gt;

&lt;p&gt;I don't blame them - I myself didn't always know it was important to write things down. I was thinking, what's the point, I have a copy in my USB drive!&lt;/p&gt;

&lt;p&gt;On my first year in college, we had a &lt;em&gt;Programming Fundamentals&lt;/em&gt; course. To learn (and apply) these so-called "fundamentals", we solved small problems on our computer using the &lt;em&gt;Java&lt;/em&gt; programming language.&lt;/p&gt;

&lt;p&gt;It was fun. We did it all the time, so I found a way to solve the problems faster: I created a template of all boilerplate code, so all I had to do for each new problem is copy and paste the template, and then jump straight to coding my solution. &lt;strong&gt;Good bye boilerplate code, hello speed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One day we had a "test" but there was a catch - no notes allowed. No plugging of USB drives. No Googling. Those were all considered cheating.&lt;/p&gt;

&lt;p&gt;I understood the reasoning - the given test was meant to asses our problem-solving skills, applied through programming. When given a business problem, how would you approach solving it, and how would you translate your solution to code?&lt;/p&gt;

&lt;p&gt;That said, how could you evaluate your real skills if you didn't solve the problem yourself, right? I repeat, this was school, not the real world where copy-pasting is actually common. There's really nothing wrong about it (unless you didn't even bother to understand why the solution worked).&lt;/p&gt;

&lt;p&gt;Anyway, I knew how to solve the given problem. I was excited to implement it, except...&lt;/p&gt;

&lt;p&gt;I couldn't get started because I didn't know the syntax of declaring the main method in a Java class. You know, the freaking&lt;/p&gt;

&lt;p&gt;&lt;code&gt;public static void main(String[] args)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's it! That's literally all I had to type to get started, but alas, I couldn't remember 😀&lt;/p&gt;

&lt;p&gt;Imagine the frustration of knowing how to do steps one to ten but you can't because you're stuck at step zero. In other words, help the poor girl, she's f*cked.&lt;/p&gt;

&lt;p&gt;I want to add, the no-notes rule was kinda stupid, right? I mean, it's stupid to make a test unpassable if the student doesn't know the syntax. In the real world, you can Google the syntax. But then again, it was common for students to cheat. Meaning, a few gifted students already have a copy of the solution in their USB drives. How do they have it, you ask? They copy it from students from an earlier class. These are the students that can graduate but are f*cked once they get a job (if they can get one).&lt;/p&gt;

&lt;h1&gt;
  
  
  A Word of Caution
&lt;/h1&gt;

&lt;p&gt;Eventually, these seemingly tiny things are things you'll naturally memorize as you keep doing them in your day-to-day life... as a student in your classes, or as a developer at your job.&lt;/p&gt;

&lt;p&gt;But in the beginning when you're trying to learn a new language, framework, algorithm, or any new tech... writing things down helps you get familiar with them faster.&lt;/p&gt;

&lt;p&gt;But don't just memorize! Obviously you also have to understand what the code does. In fact, make it more fun - simulate! On that same paper, give it different inputs and come up with the supposed output. If your textbook or course is teaching a concept in Java, and you're learning a different language in parallel, then re-write the solutions in the other language. This way, you'll know if you're truly proficient with that language.&lt;/p&gt;

&lt;p&gt;I'm in no way telling you to write down every single code you come across with. &lt;strong&gt;That just doesn't make any sense.&lt;/strong&gt; It's your job to determine what you think is important, what you think you'll need later, or what you think is fundamental that you'll need all the time. Then ingrain that in your brain (wow it rhymed). See again: &lt;a href="https://github.com/typescript-cheatsheets/react"&gt;example of a really thorough cheat sheet&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What To Expect
&lt;/h1&gt;

&lt;p&gt;Sometimes what you wrote down in the past has finally become second nature to you now. When you revisit those old notes, you'd be ashamed at how noob you were to even need to write those things down. That's good! It means you made progress, you're growing as a programmer.&lt;/p&gt;

&lt;p&gt;Keep growing your knowledge repository, and within months (and years), you'll be amazed at how far you've gone. If you're an absolute newbie, your notes might consist of syntax stuff like how to declare a variable, how to loop over an array, how to assign a value, and so on. In months time, your notes may evolve into a collection of your data models of this new module you're building, and so on. You know, the kind of stuff that you can't possibly keep in your head, so you have to write them down?&lt;/p&gt;

&lt;h1&gt;
  
  
  Parting Words and More Theory
&lt;/h1&gt;

&lt;p&gt;Back to my original story... as a new student, I had an itch to code most of the time, and I couldn't do that during my commute (I had no laptop back then). One can say that reading my physical notes was a way for me to scratch that itch even when I couldn't truly scratch that itch. Sure. But writing those notes and reading them when I had nothing to do... it helped me progress faster than if I just played with my phone during the commute.&lt;/p&gt;

&lt;p&gt;I hope you have as much fun learning as I do. Happy coding!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
