<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Learning Journey - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Learning Journey - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sat, 13 Jun 2026 16:41:50 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/learning-journey/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How I Completed 15 freeCodeCamp Certifications in 4 Months: 
A Structured Learning Journey ]]>
                </title>
                <description>
                    <![CDATA[ Can you achieve a massive milestone while you're still in high school other than just getting high grades? You may be thinking: school alone is plenty of work! And it often is. But if you set your min ]]>
                </description>
                <link>https://www.freecodecamp.org/news/freecodecamp-15-certifications-in-4-months-high-school/</link>
                <guid isPermaLink="false">69f212ea6e0124c05e18f7b0</guid>
                
                    <category>
                        <![CDATA[ freeCodeCamp.org ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Learning Journey ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Mohammed Fahd Abrah ]]>
                </dc:creator>
                <pubDate>Wed, 29 Apr 2026 14:17:14 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/95e36f70-6cd4-4349-9fdc-13ce2b73a3b5.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Can you achieve a massive milestone while you're still in high school other than just getting high grades?</p>
<p>You may be thinking: school alone is plenty of work! And it often is. But if you set your mind to it, like I did, you'll be amazed at what you can do.</p>
<p>In this story, I’ll share my journey of working through and receiving 15 freeCodeCamp certifications in just four months.</p>
<h3 id="heading-what-ill-cover">What I'll Cover:</h3>
<ul>
<li><p><a href="#heading-my-beginning-with-the-digital-world">My Beginning with the Digital World</a></p>
</li>
<li><p><a href="#heading-starting-my-journey-with-freecodecamp">Starting My Journey with freeCodeCamp</a></p>
</li>
<li><p><a href="#heading-benefits-of-freecodecamps-methodology">Benefits of freeCodeCamp's Methodology</a></p>
</li>
<li><p><a href="#heading-freecodecamp-learning-paths">freeCodeCamp Learning Paths</a></p>
</li>
<li><p><a href="#heading-1-responsive-web-design-certification">1- Responsive Web Design Certification.</a></p>
</li>
<li><p><a href="#heading-2-javascript-algorithms-and-data-structures">2- JavaScript Algorithms and Data Structures</a></p>
</li>
<li><p><a href="#heading-3-scientific-computing-with-python">3- Scientific Computing with Python</a></p>
</li>
<li><p><a href="#heading-4-data-visualization">4- Data Visualization</a></p>
</li>
<li><p><a href="#heading-5-backend-end-development-and-apis">5- Backend End Development and APIs</a></p>
</li>
<li><p><a href="#heading-6-front-end-development-libraries">6- Front End Development Libraries</a></p>
</li>
<li><p><a href="#heading-7-data-analysis-with-python">7- Data Analysis with Python</a></p>
</li>
<li><p><a href="#heading-8-machine-learning-with-python">8- Machine Learning with Python</a></p>
</li>
<li><p><a href="#heading-9-quality-assurance">9- Quality Assurance</a></p>
</li>
<li><p><a href="#heading-10-information-security">10- Information Security</a></p>
</li>
<li><p><a href="#heading-11-legacy-certifications">11- Legacy Certifications</a></p>
</li>
<li><p><a href="#heading-personal-recommendations">Personal recommendations</a></p>
</li>
</ul>
<h2 id="heading-my-beginning-with-the-digital-world">My Beginning with the Digital World</h2>
<p>I grew up in a family that really believed in life-long learning.</p>
<p>At an early age – around 10 – my father bought me my first laptop.</p>
<p>From there, learning became part of our daily routine. My father approached it with structure and intention. He designed a complete detailed learning plan for me.</p>
<p>Looking back, it was quite ambitious for someone my age. But my father always believed in high standards and expectations.</p>
<p>Still, we didn’t start with programming right away.</p>
<p>At first, we explored different areas and domains. I focused on trying to find something I though was interesting.</p>
<p>But it didn’t take long before we realized how important programming was becoming and how powerful it could be to start early.</p>
<p>So, we decided that I should start learning programming.</p>
<p>I began with HTML, building my very first web page. I was able to build a complete web page using different elements and tags on my own.</p>
<p>It was simple but it worked. That moment felt like a win.</p>
<p>Then I moved on to CSS. I was able to style and arrange the elements on the web page the way I liked. I grasped many CSS techniques and commands that help control the layout and arragement of elements so I could make them look the way I wanted.</p>
<p>After that came JavaScript. That’s when I was able to make things more alive. I started adding movement, interaction, and behavior to my web pages.</p>
<p>And I didn’t stop there.</p>
<p>I stepped into backend development with PHP, beginning to understand how things worked behind the scenes. Alongside that, I started learning SQL to handle databases – an essential part of building real, functional web applications.</p>
<p>Step by step, the picture was becoming clearer.</p>
<p>Before learning about these languages, the web sound like a black box. But after I finished learning them, I started looking at websites from a different angle, and I started recognizing how web pages are made.</p>
<p>All this learning came through a mix of YouTube lessons and structured courses my father invested in for me, like a 50-hour PHP course on Udemy.</p>
<p>I was absorbing a lot, moving from one concept to another, and building small pieces along the way.</p>
<p>But at some point, something clicked: I realized that watching tutorials – even long, detailed ones – wasn’t enough on its own. There was a gap between understanding concepts and building something real. So I decided I needed to dive deeper.</p>
<h2 id="heading-starting-my-journey-with-freecodecamp">Starting My Journey with freeCodeCamp</h2>
<p>I needed to move beyond lessons into building structured, meaningful web applications. Projects that weren’t just exercises, but had real purpose.</p>
<p>Projects with expectations, constraints, and even real stakeholders.</p>
<p>The kind of work that forces you to think, to make decisions, and to take ownership.</p>
<p>Because there’s a big difference between following along with a video… and sitting alone in front of a blank screen, figuring things out step by step.</p>
<p>That shift helped me avoid what many learners fall into: the endless loop of tutorials without real progress (<a href="https://www.freecodecamp.org/news/how-to-break-free-from-tutorial-hell/">Tutorial Hell</a>).</p>
<p>And for the first time, I started to feel what it really means to build.</p>
<p>That’s when I made a clear decision to switch to freeCodeCamp. What drew me in was simple: it wasn’t just lessons. It was practice building real, structured, hands-on projects.</p>
<h2 id="heading-benefits-of-freecodecamps-methodology">Benefits of freeCodeCamp's Methodology</h2>
<p>After completing 15 certifications on freeCodeCamp, I was able to build and launch a full platform called Programming Ocean Academy, focused on Data Science and Artificial Intelligence.</p>
<p>It pushed me to think, to solve problems on my own, and to act like an engineer – not just a learner following instructions.</p>
<p>This wasn’t a small project. It included:</p>
<ul>
<li><p>A fully functional frontend and backend system</p>
</li>
<li><p>More than 25 databases</p>
</li>
<li><p>Over 150 pages</p>
</li>
<li><p>Integrated training platforms</p>
</li>
</ul>
<p>But what mattered more than the scale… was what came next.</p>
<p>Because of the strong logical and programming foundation I had built, transitioning into Data Science and AI felt natural and not overwhelming.</p>
<p>I moved into Python and its ecosystem with confidence. From there, I worked with powerful libraries like scikit-learn, TensorFlow, and PyTorch.</p>
<p>The solid foundation I'd built enabled me to deliver multiple training programs in collaboration with Arab universities, and I've helped train more than 5,000 learners.</p>
<p>Looking back, that shift from consuming content to building real systems and delivering courses was the turning point.</p>
<h2 id="heading-freecodecamp-learning-paths">freeCodeCamp Learning Paths</h2>
<p>Today, I’m happy to share this journey with you and to emphasize something I’ve come to believe deeply: the programs and learning paths offered by freeCodeCamp aren't just courses. They're a structured bridge that'll help take you from being someone who watches tutorials and writes code to someone who builds real applications and creates products that serve people.</p>
<p>Now, you have the context you need to understand the rest of the story.</p>
<p>So let’s begin.</p>
<p>This is where the journey with freeCodeCamp really starts. A journey I would confidently recommend to anyone who wants to enter the world of programming and technology with clarity and direction.</p>
<p>How did it start? And how did I choose my path?</p>
<p>At the beginning, I didn’t approach freeCodeCamp randomly.</p>
<p>I knew that if I wanted real progress, I needed structure.</p>
<p>So instead of jumping between topics, I followed a clear order – one that builds understanding step by step, just like constructing a solid foundation before raising a building.</p>
<p>I asked myself a simple question: What do I need to master first, so everything that comes after becomes easier not harder?</p>
<p>That question influenced everything that followed.</p>
<p>So instead of creating my own path from scratch, <strong>I decided to fully trust the methodology of freeCodeCamp,</strong> following its order of certifications, lessons, and progression exactly as designed.</p>
<p>That decision made everything simpler.</p>
<p>I started from the very beginning and moved step by step.</p>
<p>My journey began with:</p>
<h2 id="heading-1-responsive-web-design-certification">1: <strong>Responsive Web Design Certification.</strong></h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/673b4872-61f7-4f5c-bb34-aca354bb0b49.png" alt="673b4872-61f7-4f5c-bb34-aca354bb0b49" style="display:block;margin:0 auto" width="1327" height="885" loading="lazy">

<p>At that time, I was studying for around 8 hours a day on most days, balancing it with my school responsibilities. It wasn’t always easy, but the structure kept me focused.</p>
<p>During this first phase, I built a strong foundation.</p>
<p>I explored HTML in depth:</p>
<ul>
<li><p>Understanding almost all HTML tags</p>
</li>
<li><p>Knowing the purpose of each element</p>
</li>
<li><p>Learning which attributes belong to which elements</p>
</li>
<li><p>When to use each tag properly</p>
</li>
<li><p>Writing clean, semantic code that follows best practices</p>
</li>
</ul>
<p>Then came CSS. This is where things evolved visually.</p>
<p>I started understanding more deeply how to:</p>
<ul>
<li><p>Style and structure pages</p>
</li>
<li><p>Create modern, clean layouts</p>
</li>
<li><p>Build responsive designs that adapt across devices</p>
</li>
</ul>
<p>But the real test wasn’t the lessons.</p>
<p>To earn the certification, I had to complete five full projects, each one requiring me to apply everything I had learned, solve problems independently, and choose the best possible approach rather than just making things “work.”</p>
<p>That’s where the real learning happened.</p>
<h2 id="heading-2-javascript-algorithms-and-data-structures"><strong>2: JavaScript Algorithms and Data Structures</strong></h2>
<p>For the second certification, JavaScript, things took a different turn.</p>
<p>This is where the web stopped being static.</p>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/08229454-a3ef-438c-b8ce-4016ffed976e.png" alt="08229454-a3ef-438c-b8ce-4016ffed976e" style="display:block;margin:0 auto" width="1324" height="890" loading="lazy">

<p>I learned how to make pages interactive and alive. I learned how to control behavior, respond to user actions, and build logic that does something. But more importantly, I spent time learning how to think logically.</p>
<p>JavaScript pushed me into algorithmic thinking:</p>
<ul>
<li><p>Breaking problems into smaller steps</p>
</li>
<li><p>Writing logic in a structured, methodical way</p>
</li>
<li><p>Building solutions that are not just correct but clean and scalable</p>
</li>
</ul>
<p>And after that phase, I didn’t stop at just using freeCodeCamp's curriculum.</p>
<p>I wanted to go deeper.</p>
<p>So I started solving programming challenges on platforms like Codewars and Edabit. Those challenges sharpened my thinking even more. They forced me to face unfamiliar problems and figure things out without guidance.</p>
<h2 id="heading-3-scientific-computing-with-python"><strong>3: Scientific Computing with Python</strong></h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/9ee958bb-c122-4d74-a598-6a8b1f39e257.png" alt="9ee958bb-c122-4d74-a598-6a8b1f39e257" style="display:block;margin:0 auto" width="1318" height="882" loading="lazy">

<p>Then came the third stage of the journey.</p>
<p>This phase was different. Python had its own elegance, its own logic, and a strong connection to mathematics and data.</p>
<p>It opened a completely new way of thinking.</p>
<p>Through hands-on projects, I learned how to work with data using powerful tools like NumPy, pandas, and Matplotlib. And I didn’t just learn how to use these tools. I got familiar with what they enable.</p>
<p>I practiced:</p>
<ul>
<li><p>Analyzing data</p>
</li>
<li><p>Exploring patterns</p>
</li>
<li><p>Visualizing insights</p>
</li>
<li><p>Thinking statistically</p>
</li>
<li><p>Moving from raw data to meaningful conclusions</p>
</li>
</ul>
<p>I began to understand how data can be transformed into real insights That’s when my skills started to become more powerful.</p>
<p>My first real encounter with Python and data analysis was through freeCodeCamp.</p>
<p>Unlike web development – which I had explored earlier through different resources – this was my first entry point into the world of data.</p>
<p>And for that, I honestly give freeCodeCamp a lot of credit. It didn’t just introduce me to new tools. It introduced me to a completely new way of thinking.</p>
<h2 id="heading-4-data-visualization">4: <strong>Data Visualization</strong></h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/5e54f5bd-ffab-4ff7-a485-fcf5ec3fd60b.png" alt="5e54f5bd-ffab-4ff7-a485-fcf5ec3fd60b" style="display:block;margin:0 auto" width="1316" height="877" loading="lazy">

<p>This phase added a new dimension. It wasn’t just about working with data anymore – it was about communicating it's meaning.</p>
<p>I learned how to transform raw numbers into clear, meaningful visualizations. I explored how to create graphs that don’t just look good but help you understand what’s going on beneath the surface.</p>
<p>That experience was incredibly valuable</p>
<p>It built a foundation that later made my transition from web development into data science and AI much smoother.</p>
<p>And once again, I must acknowledge the role of freeCodeCamp. Because during this phase working with tools like Python, Matplotlib, and pandas, I began to truly understand the importance of data visualization and analysis.</p>
<p>I started to carry this mindset back into the world of web development:</p>
<ul>
<li><p>Into databases</p>
</li>
<li><p>Into SQL tables</p>
</li>
<li><p>Into how data is structured, queried, and interpreted</p>
</li>
</ul>
<p>I realized that data isn't just something you store. Its value comes from how well you can understand it, analyze it, and use it.</p>
<p>And for stakeholders, this is just as critical as storage, security, and privacy because without insight, data alone means very little.</p>
<p>This distinction is incredibly important for every developer to understand.</p>
<p>In the world of web development, the focus is often on storing data, securing it, and making sure it’s accessible. But in the world of data analysis, scientific computing, and statistical modeling, the focus shifts completely.</p>
<p>It becomes about studying the data itself transforming it from something silent… into something that speaks. Something that guides decisions. Something that helps you improve systems, refine products, and make smarter long-term choices.</p>
<p>That shift in perspective changed the way I handled everything.</p>
<h2 id="heading-5-backend-end-development-and-apis">5: <strong>Backend End Development and APIs</strong></h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/b776d911-3511-4f49-b877-23a991a23cef.png" alt="b776d911-3511-4f49-b877-23a991a23cef" style="display:block;margin:0 auto" width="1336" height="899" loading="lazy">

<p>This was a new world.</p>
<p>Even though I had previous experience with PHP and SQL from Udemy, this path introduced me to a different ecosystem which is modern, fast, and widely used in real-world applications.</p>
<p>Of course, the beginning wasn’t easy. I had no prior experience with tools like Node.js or MongoDB. It felt unfamiliar at first, and there was a learning curve.</p>
<p>But this is where freeCodeCamp stood out again.</p>
<p>They didn’t just throw you alone into the deep end. They supported the journey.</p>
<p>I found dedicated courses on their YouTube channel like a full Node.js course (around 8 hours) and a MongoDB course (around 4 hours).</p>
<p>I went through both of them completely. Step by step, things started to make sense. I built a solid foundation, returned to the certification path, and this time I was ready.</p>
<p>I completed all the challenges and projects successfully, from the first attempt.</p>
<p>And that experience taught me something important: sometimes the path forward isn’t about pushing harder, it’s about stepping back, strengthening your foundations, and then coming back stronger.</p>
<p>One of the most interesting parts of this stage was discovering the difference between how data is handled in SQL versus MongoDB.</p>
<p>It wasn’t just a technical difference, but a shift in mindset.</p>
<p>With SQL, everything is structured, relational, and predefined. With MongoDB, things are more flexible, document-based, and dynamic.</p>
<p>Learning to work with both gave me a broader perspective on how to design and manage data depending on the problem at hand.</p>
<h2 id="heading-6-front-end-development-libraries">6: Front End Development Libraries</h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/23248ac0-2711-41a5-aa14-bc42deda294d.png" alt="23248ac0-2711-41a5-aa14-bc42deda294d" style="display:block;margin:0 auto" width="1323" height="882" loading="lazy">

<p>This was one of the most enjoyable phases. It felt creative, fast, and powerful.</p>
<p>I explored frameworks and libraries like:</p>
<ul>
<li><p>jQuery</p>
</li>
<li><p>React</p>
</li>
<li><p>Vue.js</p>
</li>
</ul>
<p>To strengthen my understanding, I followed additional courses on the freeCodeCamp YouTube channel, making sure I had the right foundations before tackling the projects and passing the certification requirements.</p>
<p>What stood out to me the most during this phase was something new: for the first time, I truly learned how to control HTML and CSS through JavaScript in a structured and scalable way.</p>
<p>This wasn’t just about styling anymore, but it was about building dynamic interfaces, managing state, and creating responsive user experiences.</p>
<p>And honestly, this was the first time I grasped this concept deeply.</p>
<h2 id="heading-7-data-analysis-with-python">7: Data Analysis with Python</h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/a3d99b60-0cf3-4245-bd68-d36385ff4fa9.png" alt="a3d99b60-0cf3-4245-bd68-d36385ff4fa9" style="display:block;margin:0 auto" width="1316" height="875" loading="lazy">

<p>Here, things became more precise.</p>
<p>I explored how to:</p>
<ul>
<li><p>Choose the right type of visualization depending on the data</p>
</li>
<li><p>Analyze datasets using tools like Excel, NumPy, and pandas</p>
</li>
<li><p>Create advanced visualizations using libraries like D3.js</p>
</li>
</ul>
<p>I was learning how to think with data, how to read it, question it, and turn it into something meaningful.</p>
<h2 id="heading-8-machine-learning-with-python">8: Machine Learning with Python</h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/d2f391be-ff8c-48f5-82c6-682cb44b164f.png" alt="d2f391be-ff8c-48f5-82c6-682cb44b164f" style="display:block;margin:0 auto" width="1314" height="876" loading="lazy">

<p>This new learning path was deeper, more abstract. Sometimes even unfamiliar compared to everything I had learned before.</p>
<p>For the first time, I wasn’t just writing code to build applications. I was building models that learn from data.</p>
<p>Working with tools like TensorFlow, I began to understand how data, mathematics, and algorithms come together to create intelligent systems.</p>
<p>Everything I had learned through freeCodeCamp started to reflect beyond programming itself.</p>
<p>I noticed the impact in school:</p>
<ul>
<li><p>In mathematics, logic became clearer</p>
</li>
<li><p>In digital technology, concepts felt more intuitive</p>
</li>
<li><p>Even in subjects like physics and chemistry, problem-solving became easier</p>
</li>
</ul>
<p>Because at its core, my way of thinking had changed. My logical reasoning had become stronger. Working with algorithms and mathematical expressions no longer felt difficult. Instead it felt natural.</p>
<p>One of the most meaningful outcomes of this journey came during high school. A teacher trusted me with a responsibility I didn’t expect: To explain programming lessons to my classmates.</p>
<p>And I did.</p>
<p>Not just by repeating information but by simplifying it, structuring it, and making it understandable. That moment I discovered that learning deeply allows you to teach clearly.</p>
<p>And then came a new and powerful phase: building the engineering mindset.</p>
<p>At this stage, everything started to come together. It was about thinking differently.</p>
<p>An engineering mindset built on:</p>
<ul>
<li><p>Strong logical foundations</p>
</li>
<li><p>Real project experience</p>
</li>
<li><p>Understanding how systems behave, not just how code runs</p>
</li>
</ul>
<p>And this introduced me to the upcoming certifications.</p>
<h2 id="heading-9-quality-assurance"><strong>9: Quality Assurance</strong></h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/e3e7e442-342a-4495-844b-13aaa439a126.png" alt="e3e7e442-342a-4495-844b-13aaa439a126" style="display:block;margin:0 auto" width="1320" height="880" loading="lazy">

<p>I spent time learning how to write code that's not only functional but reliable, maintainable, and scalable.</p>
<p>Using tools, and practices like Chai.js, I began to:</p>
<ul>
<li><p>Test applications properly</p>
</li>
<li><p>Catch errors early</p>
</li>
<li><p>Ensure systems run smoothly under different conditions</p>
</li>
</ul>
<p>And this is where the real transformation started happening. I started moving from being someone who writes code to someone who builds systems.</p>
<h2 id="heading-10-information-security"><strong>10: Information Security</strong></h2>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/424fd621-e6a2-45fb-9ba2-759ddc72ba12.png" alt="424fd621-e6a2-45fb-9ba2-759ddc72ba12" style="display:block;margin:0 auto" width="1315" height="877" loading="lazy">

<p>Through the cybersecurity path on freeCodeCamp, I was introduced to a completely new dimension of software development: thinking about protecting systems, not only building them blindly.</p>
<p>I picked up essential concepts and practical skills using tools like:</p>
<ul>
<li><p>Helmet.js to secure web applications</p>
</li>
<li><p>Python for penetration testing and security analysis</p>
</li>
<li><p>Socket.IO for handling real-time interactions securely</p>
</li>
</ul>
<p>As part of this path, I worked on building five projects including a password cracker. It wasn’t just a technical exercise –&nbsp;it was a way to develop a real security mindset. To understand vulnerabilities, risks, and how attackers think so you can build systems that are stronger and safer.</p>
<p>Then I got into the legacy learning courses:</p>
<h2 id="heading-11-legacy-certifications"><strong>11: Legacy Certifications</strong></h2>
<h3 id="heading-front-end">Front End:</h3>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/4d9a6031-969b-43d9-9233-a79ca7768276.png" alt="4d9a6031-969b-43d9-9233-a79ca7768276" style="display:block;margin:0 auto" width="1333" height="903" loading="lazy">

<h3 id="heading-back-end">Back End:</h3>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/376f3c22-faf9-4993-8992-56cd37ce9f37.png" alt="376f3c22-faf9-4993-8992-56cd37ce9f37" style="display:block;margin:0 auto" width="1352" height="901" loading="lazy">

<h3 id="heading-data-visualization">Data Visualization:</h3>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/88688464-913f-4666-a507-0f15343256a2.png" alt="88688464-913f-4666-a507-0f15343256a2" style="display:block;margin:0 auto" width="1313" height="877" loading="lazy">

<h3 id="heading-full-stack">Full Stack:</h3>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/6e47be72-babe-44fa-8249-265b7dcfe9be.png" alt="6e47be72-babe-44fa-8249-265b7dcfe9be" style="display:block;margin:0 auto" width="1332" height="902" loading="lazy">

<h3 id="heading-legacy-cybersecurity-amp-quality-assurance">Legacy Cybersecurity &amp; Quality Assurance:</h3>
<img src="https://cdn.hashnode.com/uploads/covers/69ce92860ff860b6de01ed93/408a7525-e89d-4090-b317-844c1b6ef954.png" alt="408a7525-e89d-4090-b317-844c1b6ef954" style="display:block;margin:0 auto" width="1325" height="885" loading="lazy">

<p>This phase was incredibly valuable.</p>
<p>It felt like a consolidation of everything I had learned, a chance to revisit key concepts with more maturity and deeper understanding. These certifications focused more on what truly matters in each path, with diverse and practical projects that strengthened both my skills and confidence.</p>
<p>If I had to summarize this entire journey in one idea, it would be this: learning by building changes everything.</p>
<p>This core methodology of freeCodeCamp enabled me to:</p>
<ul>
<li><p>Solve real problems</p>
</li>
<li><p>Build actual products</p>
</li>
<li><p>Connect learning with real-world impact</p>
</li>
</ul>
<p>It moved me beyond theory into practice.</p>
<h2 id="heading-personal-recommendations">Personal Recommendations</h2>
<p>Based on my experience, I strongly recommend freeCodeCamp to anyone who wants to:</p>
<ul>
<li><p>Develop programming skills</p>
</li>
<li><p>Strengthen logical thinking</p>
</li>
<li><p>Improve problem-solving ability</p>
</li>
<li><p>Build real-world applications</p>
</li>
</ul>
<p>Because when learning is built on the right methodology, the results are not just visible they are transformative.</p>
<p>Here are <a href="https://programming-ocean.com/knowledge-hub/freecodecamp-atlas.php">resources</a> about freeCodeCamp programs and certifications that structured my learning journey.</p>
<h3 id="heading-contact-me">Contact Me:</h3>
<p><a href="https://github.com/MOHAMMEDFAHD"><strong>GitHub</strong></a></p>
<p><a href="https://www.linkedin.com/in/mohammed-abrah-6435a63ba/"><strong>Linkedin</strong></a></p>
<p><a href="https://x.com/programmingoce"><strong>X</strong></a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Why Many Beginner Self-Taught Developers Struggle (And What to Do About It) ]]>
                </title>
                <description>
                    <![CDATA[ Self‑taught developers often begin with the same “starter pack”: a laptop, internet access, and sheer determination. What they lack, however, is structured guidance, a defined curriculum, or any form  ]]>
                </description>
                <link>https://www.freecodecamp.org/news/why-many-beginner-self-taught-developers-struggle-and-what-to-do-about-it/</link>
                <guid isPermaLink="false">69e66a12c9501dd0101793f9</guid>
                
                    <category>
                        <![CDATA[ Learning Journey ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Self-taught  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Beginner Developers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ learning ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Great John ]]>
                </dc:creator>
                <pubDate>Mon, 20 Apr 2026 18:01:54 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/76b41ea4-5375-4393-ad06-a0e53b53d23a.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Self‑taught developers often begin with the same “starter pack”: a laptop, internet access, and sheer determination. What they lack, however, is structured guidance, a defined curriculum, or any form of pedagogical support.</p>
<p>This absence of direction makes the journey significantly harder. Faced with an overwhelming abundance of online resources, many beginners become confused about where to start and often attempt to learn everything at once.</p>
<p>This is where the struggle with knowledge retention begins.</p>
<p>Not because they lack intelligence or effort, but because they're learning in a way that contradicts how the human brain actually works.</p>
<p>They dive into tutorials and courses without understanding the mechanism of the brain – that is, how the brain processes, stores, and retrieves information. As a result, much of what they learn simply doesn’t stick.</p>
<h3 id="heading-how-the-brain-processes-information">How the Brain Processes Information</h3>
<p>So what's the connection between the brain and learning how to code, you might ponder?</p>
<p>The connection is direct and unavoidable.</p>
<p>Coding isn't learned through willpower or motivation — though both matter — or by spending countless hours watching tutorials.</p>
<p>It's learned through the brain’s ability to process, store, and retrieve information.</p>
<p>Every variable, function, data structure, or debugging pattern must pass through the brain’s cognitive systems before it becomes usable knowledge.</p>
<p>If your learning process doesn't align with how the brain naturally acquires and organises information, your retention will collapse, no matter how determined you are.</p>
<p>Now imagine you’re trying to fill a bucket with water. You keep pouring and pouring, but the bucket has tiny holes at the bottom. No matter how much effort you put in, the water keeps leaking out. You might blame yourself for not pouring fast enough, or you might try switching to a bigger jug, but the real problem isn’t your effort — it’s the bucket.</p>
<p>The water is the information you’re trying to learn.</p>
<p>The bucket is your brain’s memory system.</p>
<p>The holes in the bucket are the natural forgetting mechanisms of the brain: cognitive overload, limited working memory, and other constraints that make retention difficult.</p>
<p>If you don’t understand these mechanisms, you can pour in as much information as you want, but most of it will leak out.</p>
<p>Not because you’re incapable, but because you’re learning in a way that contradicts how the brain actually retains knowledge.</p>
<h3 id="heading-the-role-of-academic-learning-theories">The Role of Academic Learning Theories</h3>
<p>Since learning ultimately takes place in the brain, an important question is: How does the human brain acquire, organize, and apply knowledge and why does the typical self‑taught learning process clash with these principles?</p>
<p>This is where academic learning theories become indispensable. These frameworks explain how the brain actually acquires, retains, and applies complex information and they offer a scientific roadmap for learning more effectively. Without understanding these principles, self‑taught developers unintentionally work against the brain’s natural architecture.</p>
<p>The purpose of this article is to unpack these essential learning theories and apply them directly to the beginner self‑taught developer’s journey.</p>
<p>By understanding how the brain processes information, beginners can structure their learning more intentionally, retain knowledge more reliably, and move toward becoming competent developers with far greater confidence and clarity.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a href="#heading-cognitive-load-theory-clt">Cognitive Load Theory (CLT)</a></p>
<ul>
<li><p><a href="#heading-working-memory">Working Memory</a></p>
</li>
<li><p><a href="#heading-millers-law">Miller's Law</a></p>
</li>
<li><p><a href="#heading-chunking">Chunking</a></p>
</li>
<li><p><a href="#heading-long-term-memory">Long-term memory</a></p>
</li>
<li><p><a href="#heading-schema">Schema</a></p>
</li>
<li><p><a href="#heading-intrinsic-load-the-natural-difficulty-of-the-task">Intrinsic Load: The Natural Difficulty of the Task</a></p>
</li>
<li><p><a href="#heading-extraneous-load-the-mental-noise">Extraneous Load: The Mental Noise</a></p>
</li>
<li><p><a href="#heading-germane-load-the-construction-work">Germane Load: The Construction Work</a></p>
</li>
</ul>
</li>
<li><p><a href="#heading-ebbinghaus-forgetting-curve">Ebbinghaus Forgetting Curve.</a></p>
</li>
<li><p><a href="#heading-how-the-theory-of-spaced-repetition-works">How the Theory of Spaced Repetition Works</a></p>
</li>
<li><p><a href="#heading-theory-of-deliberate-practice">Theory of Deliberate Practice</a></p>
</li>
<li><p><a href="#heading-what-is-blooms-taxonomy">What is Bloom's Taxonomy?</a></p>
<ul>
<li><a href="#heading-focused-mode-vs-diffuse-mode">Focused Mode vs Diffuse Mode</a></li>
</ul>
</li>
<li><p><a href="#heading-conclusion">Conclusion</a></p>
</li>
<li><p><a href="#heading-references">References</a></p>
</li>
</ul>
<h2 id="heading-cognitive-load-theory-clt">Cognitive Load Theory (CLT)</h2>
<p>Learning a new concept often requires mental effort by the brain to process newly acquired information. This effort exerted by the brain is known as cognitive load, a term coined by Australian educational psychologist John Sweller in 1988 during his study on how the brain acquires and retains information (Sweller, 1988).</p>
<p>Since then, his work has been expanded upon by other researchers. Notably, Dylan Wiliam famously tweeted in 2017 that Cognitive Load Theory (CLT) is "the single most important thing for teachers to know" (Dylan William, 2017).</p>
<p>You might wonder again: What does this have to do with me? As a beginner self‑taught developer, the answer is simple: you're both the teacher and the student.</p>
<p>So this is the most important theory you should know. In this self-tutoring journey, you're tasked with designing your own curriculum, choosing your own resources, pace your own learning, and evaluating your own progress.</p>
<p>Without understanding how cognitive load affects your ability to absorb and retain information, you may unintentionally overload your brain and sabotage your own learning.</p>
<p>Before we get into the nitty-gritty of CLT, there are important concepts masterminded by David Geary that you'll need to grasp to sufficiently understand this concept : “that which can be learnt” (biologically primary knowledge), “that which can be taught”(biologically secondary knowledge) (Geary, 2007, 2008).</p>
<p>According Geary (2007, 2008), "biologically primary knowledge" consists of "instinctual" skills that the brain is evolved to pick up naturally without formal schooling.</p>
<p>Examples include learning a first language, recognizing faces, or basic social navigation.</p>
<p>"Biologically secondary knowledge", on the other hand, consists of cultural and technical skills, like reading and writing, that are necessary for society but don't come naturally to the brain.</p>
<p>This is because we aren't "wired" to pick these up automatically. Instead, they require formal instruction and schools to pass them down.</p>
<p>Therefore, coding is a prime example of biologically secondary knowledge. The human brain is remarkably plastic, but it didn't evolve to interpret syntax, manage memory allocation, or debug logical loops.</p>
<p>These are cultural inventions, not natural instincts. Unlike learning to walk or speak your native language (which are biologically primary skills) you can't learn to code simply by “being around” computers.</p>
<p>Recognising that the human brain is not instinctively prepared for coding allows you to change your strategy. Once you accept that coding concepts are not “natural,” you can finally approach them with the structured, deliberate effort they require.</p>
<p>The second set of concepts beginner self-taught developers should know and understand are working memory, Miller's Laws, chunking, long-term memory, and schemas.</p>
<h3 id="heading-working-memory">Working Memory</h3>
<p>Working memory is where thinking happens. It's the active mental workspace where you hold information while you process it. When you encounter concepts like syntax, loops, functions, or an if/elseif statement for the first time, all of that information sits inside your working memory. The problem is that working memory is extremely limited and fragile.</p>
<p>When you first learn to code, your working memory functions like a small mental desk where only a few items can be placed at once.</p>
<p>Imagine trying to assemble a piece of IKEA furniture on a tiny coffee table. If you spread out the instruction manual, the screws, the wooden panels, and the tools all at the same time, the table becomes cluttered instantly. You start losing track of which part goes where, not because you’re incapable, but because the surface you’re working on is too small to hold everything at once.</p>
<p>Working memory behaves the same way. When you’re learning new concepts – like arrays, loops, functions, or error handling – each idea takes up space on that mental desk. If you then overload it, the desk becomes overcrowded.</p>
<p>Once it exceeds its capacity, things begin to fall off, and your ability to retain collapses.</p>
<p>It’s not a lack of intelligence. It’s simply the natural limit of working memory.</p>
<p>Now this collapse happens because you went against the threshold your working memory can hold. This is backed up by research that shows that working memory can typically process only 5–9 pieces of information at any given time (Miller, 1956). This is known as Miller’s Law.</p>
<h3 id="heading-millers-law">Miller's Law</h3>
<p>In 1956, George Miller found that the average human can hold about seven items (plus or minus two) in working memory at once, even some recent research has stated the number is even lower about four item (Nelson Cowan, 2001).</p>
<p>So imagine you encounter a tutorial that introduces the following concepts all at the same time: a Route, a Controller, a Model, a Migration, a View, a Request, Helper files, Jobs and Queues, Middleware, Roles and Permissions, and a Service Provider. If you attempt to hold all of these in your mind simultaneously, you'll inevitably hit Miller’s Wall, as your working memory becomes overloaded, and you'll likely forget the first concept long before you reach the last.</p>
<p>So how do you handle complex tasks if the brain can only juggle 4–9 items at once?</p>
<p>You use chunking — the process of grouping small pieces of information into a single, meaningful unit.</p>
<h3 id="heading-chunking">Chunking</h3>
<p>Chunking is the brain’s strategy for compressing complexity. Instead of forcing working memory to hold a dozen unrelated items, you reorganise them into a few coherent structures. This reduces cognitive load, prevents overload, and allows you to work with far more information than your raw working‑memory limits would normally allow.</p>
<p>Let's consider an example:</p>
<p>A beginner learning Laravel might see Route, Controller, Model, Migration, and View as five separate, overwhelming items. To a beginner, each one feels like a distinct cognitive burden. But an experienced developer doesn't treat them as isolated concepts. Instead, they're understood as a single meaningful unit: the MVC pattern. Instead of holding five items in working memory, the expert holds one.</p>
<p>This raises an important question: how does a beginner know that these five elements belong together when they have only just encountered them?</p>
<p>It's crucial to emphasise that chunking isn't automatic. It depends on recognising meaningful relationships between concepts, and beginners typically lack the prior knowledge needed to perceive those relationships early on.</p>
<p>But as learners repeatedly encounter the same sequence during the learning process, they begin to notice consistent patterns. Over time, the brain’s natural tendency to seek structure enables them to identify which components reliably operate together, allowing these elements to gradually fuse into a single, meaningful chunk.</p>
<p>For example, when I first followed a Laravel e-commerce tutorial, I noticed that for every new resource the tutor created –&nbsp;Payment, Cart, KYC, and Contact – the same pattern was repeated: a Controller, a Model, and a View were always created together.</p>
<p>After encountering this sequence several times, it became clear that these components consistently belonged together as a set. Over time, I began to perceive the Controller, Model, and View not as separate elements, but as a single, integrated unit.</p>
<p>So beginners may not be able to chunk effectively on day one because they lack the prior knowledge needed to recognise what belongs together. But with time, and repeated encounters across different contexts, these individual pieces fuse into stable mental units stored in long‑term memory.</p>
<p>What feels overwhelming at first eventually becomes effortless, not because the task became simpler, but because your internal representation became more organised.</p>
<p>This is the power of chunking: it transforms scattered pieces of information into organised units that fit comfortably within the limits of working memory.</p>
<p>Without chunking, beginners drown in details. With chunking, they gain the cognitive space needed to understand, retain, and apply what they learn.</p>
<h3 id="heading-long-term-memory">Long-term memory</h3>
<p>Unlike working memory, long‑term memory has virtually infinite capacity. The goal of all study is to move information from the cramped working memory into the vast long‑term memory.</p>
<p>Here is the real secret: you don’t learn in working memory – you only process there.</p>
<p>True learning is the permanent change that happens in long‑term memory.</p>
<h3 id="heading-schema">Schema</h3>
<p>Once stored in long-term memory, information becomes part of a schema — a mental map or filing system that organizes related ideas.</p>
<p>For example, when you finally learn that Laravel is an MVC framework, you aren’t just memorizing three letters. You're building a schema that tells your brain: Models handle data, Views handle presentation, and Controllers handle logic.</p>
<p>Once a schema is built, it can be pulled into working memory as a single chunk, effectively bypassing Miller’s Law.</p>
<p>This is how experts think effortlessly while beginners feel overwhelmed.</p>
<p>And this is why Garnett (2020) argues that "being competent or lacking competence in something depends entirely on how secure the retrieval of knowledge held in the schema is".</p>
<p>Now that the foundations of working memory, long‑term memory, schemas, and chunking are clear, we can turn to another set of concepts every self‑taught developer must understand: intrinsic load, extraneous load, and germane load. These three components make up the full structure of Cognitive Load Theory, and they determine whether learning feels manageable or overwhelming.</p>
<h3 id="heading-intrinsic-load-the-natural-difficulty-of-the-task">Intrinsic Load: The Natural Difficulty of the Task</h3>
<p>Intrinsic load refers to the inherent complexity of the material itself. Some concepts are simply harder than others because they contain more interacting elements that must be processed at the same time.</p>
<p>In Laravel, understanding a simple Route has low intrinsic load.</p>
<p>But concepts like Dependency Injection or Polymorphic Relationships have high intrinsic load because they involve multiple layers of abstraction and interdependent ideas.</p>
<p>You can't change the intrinsic load of a concept, but you can manage it by breaking the idea into smaller, more digestible sub‑tasks. This is why good teaching — and good self‑teaching — always begins with simplification and sequencing.</p>
<p>Simplification means stripping a concept down to its essential parts so the learner isn't overwhelmed by unnecessary detail.</p>
<p>Sequencing means introducing parts in a logical order, where each step builds on the previous one. This helps reduce unnecessary cognitive load and allows learners to devote more mental effort (germane load) to building schemas.</p>
<p>It’s like meeting someone new, and they tell you their name and it happens to be your mother’s name. Instantly, your brain forms a connection. You associate this new person’s name with the strong, deeply stored memory of your mother.</p>
<p>Because that schema already exists in your long-term memory, the new information “attaches” to it. Later, when you try to recall the name, you don’t struggle, you simply think of your mother, and the name comes back easily.</p>
<p>While many believe self‑taught developers struggle because they lack immediate, reliable, personal guidance, there's actually a hidden advantage in this predicament. When a teacher explains a concept, even if they try their best to “chunk” the information, they can't truly know the student’s internal limits — how much intrinsic load the learner can handle, how quickly they can process new ideas, or how much prior knowledge they can activate.</p>
<p>This is where self‑taught developer quietly shines. Because you are both the teacher and the student, you know your own cognitive limits better than anyone else. You can slow down when something feels heavy, pause when working memory is overloaded, and chunk information in a way that perfectly matches your personal capacity.</p>
<p>You can simplify a concept to its bare essentials and sequence it at a pace that aligns with your own understanding.</p>
<h3 id="heading-extraneous-load-the-mental-noise">Extraneous Load: The Mental Noise</h3>
<p>Extraneous load is the enemy of the self‑taught developer. It's the mental effort wasted on tasks that don't contribute to actual learning. This is where a self-taught developer's strength must truly shine.</p>
<p>A teacher in a classroom is responsible for removing any distractions that might derail a child or slow down their assimilation of knowledge. As a self-taught developer, that responsibility falls entirely on you. You must identify these distractions and eliminate them.</p>
<p>As a self-taught developer myself, I use specific strategies to ensure I stay focused. Before starting any course, I spend time reading the comment section to see what others have experienced. If I see complaints about low audio quality, unclear explanations, or tutorials that move too fast, I immediately abandon that course and look for one with better reviews.</p>
<p>Anything that might derail my progress must be removed. If you spend half of your mental energy trying to figure out all of these, you only have the remaining half available for understanding the logic of the code. And remember: when learning new concepts, we use working memory, which is fragile.</p>
<p>As your own “inner teacher,” you must eliminate this noise so your limited working memory can focus entirely on the material that matters.</p>
<h3 id="heading-germane-load-the-construction-work">Germane Load: The Construction Work</h3>
<p>Germane load is the productive mental effort used to build and refine schemas — the mental structures that make future learning easier.</p>
<p>This is the “Aha!” moment when new information connects meaningfully to what you already know.</p>
<p>For example, germane load appears when you realise that a Database Migration is essentially a version‑control system for your table structure.</p>
<p>That insight is schema construction in action.</p>
<p>Teachers are often advised to help manage a child's germane load. One way they do this is by connecting the new idea being taught to an existing concept.</p>
<p>By doing this, they help the student build schemas: mental frameworks that organise and interpret information.</p>
<p>For a self-taught developer, this means instead of memorizing a new syntax in isolation, you look for a 'hook' in something you already understand.</p>
<p>For example, if you already know how a physical filing cabinet works, understanding Arrays or Objects in code becomes much easier.</p>
<p>You aren't learning from scratch – you're simply "plugging" new data into an old socket. This reduces the mental strain and makes the new knowledge stick permanently.</p>
<p>But this can only happen when intrinsic load is properly managed and extraneous load is removed.</p>
<p>It's important to note that, unlike intrinsic and extraneous load, germane load isn't an independent type of cognitive load.</p>
<p>Instead, it represents the portion of your working memory that remains available to handle the element interactivity associated with intrinsic load.</p>
<p>In other words, germane load is the mental energy you have left for learning once the unnecessary noise is stripped away.</p>
<p>Understanding cognitive load explains why learning can feel overwhelming in the moment, but it doesn't explain why knowledge fades after the moment has passed. For that, we turn to another foundational principle in learning science: the Ebbinghaus Forgetting Curve.</p>
<h2 id="heading-ebbinghaus-forgetting-curve">Ebbinghaus Forgetting Curve</h2>
<p>If you remember the bucket analogy, this curve represents one of the holes at the bottom — the brain’s natural tendency to let information leak away unless it's reinforced.</p>
<p>In the late 19th century, Hermann Ebbinghaus discovered that human memory follows a predictable pattern of decline. After learning something new, we forget most of it astonishingly quickly — often within hours — unless the information is revisited. The forgetting curve shows that memory retention drops sharply at first and then continues to decline more slowly over time.</p>
<p>Studies based on Ebbinghaus’ forgetting curve found that without a conscious effort to retain newly acquired information, we lose approximately 50% of new information within 24 hours, and up to 90% within a week (Clearwater, 2024).</p>
<p>In other words, the brain is designed to discard information that isn't reinforced.</p>
<p>For self‑taught developers, this has profound implications.</p>
<p>You may understand a Laravel controller today, spatial roles and permission concepts, and so on – but if you don't revisit it, practice it, or apply it within the next few hours, your brain will naturally let it fade.</p>
<p>This is not a sign of weakness or lack of talent. It's simply how human brain works.</p>
<p>The forgetting curve also explains why tutorials feel deceptively easy the moment you're going through them.</p>
<p>While watching, everything seems clear — but a week later, the same concepts feel unfamiliar.</p>
<p>The knowledge never made it into long‑term memory because you didn't revisit, practice, or connect it to existing schemas.</p>
<p>Since the human brain is designed to forget anything that isn't repeated, repetition becomes the signal that tells the brain, “This matters — keep it.”</p>
<p>This is why, when you meet someone for the first time and they tell you their name, you'll almost certainly forget it unless you consciously repeat it to yourself several times. If you don’t reinforce it, you end up asking — often with embarrassment — “Sorry, what was your name again?”</p>
<p>The same principle applies to learning code: without deliberate repetition, the brain simply lets the information fade. However, with a technique called spaced repetition, retention is significantly improved .</p>
<h2 id="heading-how-the-theory-of-spaced-repetition-works">How the Theory of Spaced Repetition Works</h2>
<p>Spaced repetition is a learning technique grounded in cognitive psychology that involves reviewing information at increasingly spaced intervals to strengthen long‑term memory retention.</p>
<p>It's based on the principle that memory decays predictably over time — as demonstrated by the Ebbinghaus Forgetting Curve — and that strategically timed reviews or repetition interrupt this decay, making the memory more durable with each repetition.</p>
<p>This idea is what gave birth to Anki-Flash cards.</p>
<p>Imagine you're trying to memorise the time complexity of different algorithms.</p>
<p>This is a classic "dry" academic topic that's easy to forget.</p>
<p>To understand why spaced repetition is so powerful, consider a familiar scenario. You spend Sunday night staring at a chart of Big‑O complexities for four hours. By Monday’s review, you can recall most of them. By Friday, only a few remain. Two weeks later, the entire chart has vanished from memory.</p>
<p>Spaced repetition reverses this process by reviewing information at the precise moment it's about to be forgotten. Instead of cramming Big‑O notation in a single session, you revisit it across expanding intervals:</p>
<ol>
<li><p>Day 1 (Initial Learning): You study the Big‑O chart and understand each complexity class.</p>
</li>
<li><p>Day 2 (First Review): You test yourself. If you recall an item correctly, you schedule the next review three days later. If you miss it, you review it again the following day.</p>
</li>
<li><p>Day 5 (Second Review): You encounter the material again. Because you still remember it, the interval expands to ten days.</p>
</li>
<li><p>Day 15 (Third Review): Your memory has begun to fade, but the moment you see the prompt, the concept resurfaces. This slight struggle to retrieve the information is precisely what strengthens long‑term retention.</p>
</li>
<li><p>Day 45 (Fourth Review): By now, the memory is deeply consolidated. Concepts like O(log⁡n) feel as natural and accessible as your own phone number.</p>
</li>
</ol>
<p>Through this process, spaced repetition transforms fragile, short‑term awareness into durable, long‑term knowledge. Each review interrupts the forgetting curve, reinforces the schema, and reduces the cognitive load required to recall the concept in the future.</p>
<p>For self-taught developers, spaced repetition can take many forms. You might rewrite code from memory, re‑implement a feature days later, build small variations of the same concept, or return to the concept after working on different tasks.</p>
<p>Every review strengthens the schema and reduces the cognitive load required to recall it. Over time, what once felt complex becomes automatic — not because the concept changed, but because your brain reorganised it into a stable, efficient structure.</p>
<p>As you can see, learning isn't a single event but a cycle of exposure, forgetting, and reinforcement.</p>
<p>Mastery comes not from seeing something once, but from returning to it until it becomes part of your cognitive architecture.</p>
<p>But we must be careful with repetition. Doing the same thing over and over again doesn't guarantee improvement. In fact, mindless repetition can trap you at the same level indefinitely.</p>
<p>This is where the theory of deliberate practice becomes essential, as it emphasises increasing the level of challenge, focusing on specific weaknesses, and actively seeking feedback so that each repetition leads to measurable improvement rather than just familiarity.</p>
<h2 id="heading-theory-of-deliberate-practice">Theory of Deliberate Practice</h2>
<p>Developed by psychologist K. Anders Ericsson, it argues that expertise is not the result of talent but of high‑quality, intentional practice (Ericsson, 1993). This type of practice is fundamentally different from simply doing something repeatedly.</p>
<p>He coined the term "deliberate practice" while researching how people become experts. Studying experts from several different fields, he dismantled the myth that expert performers have unusual innate talents.</p>
<p>Instead, he discovered that experts attain their high performance through how they practice: it's a deliberate effort to become an expert. This effort is characterized by breaking down required skills into smaller parts and practicing these parts repeatedly.</p>
<p>According to Anders Ericsson, Deliberate Practice requires:</p>
<ol>
<li><p>Clear goals</p>
</li>
<li><p>Immediate feedback</p>
</li>
<li><p>Tasks that stretch your ability just beyond your comfort zone</p>
</li>
<li><p>Full concentration and effort</p>
</li>
</ol>
<p>The main tenet of Deliberate Practice is that tasks must stretch your ability just beyond your comfort zone. This is paramount to the advancement of learning.</p>
<p>Imagine a child being taught 1+1 every day. That child will never grow beyond basic arithmetic. Anders Ericsson calls this "Arrested Development" (Ericsson, Nandagopal and Roring, 2005). For that child to grow to become a mathematician, their knowledge must be stretched.</p>
<p>The takeaway for developers is a play on the DRY principle (Don’t Repeat Yourself): If you are only repeating what you already know without stretching yourself, you aren't growing. This "stretch" is the extra edge that Deliberate Practice adds to Spaced Repetition.</p>
<p>Building a simple to-do list, a calculator, or a weather app over and over again won't take you anywhere. You already know how to do those.</p>
<p>To truly grow, you must stretch yourself. Instead, try a project that integrates new ideas, like building a mini-app where the weather data affects your to-do list. For example, if the API shows it's raining, the app automatically hides outdoor tasks and calculates the time you'll save or the indoor tasks you should prioritize instead.</p>
<p>This forces you to handle complex logic and state management, moving you beyond simple repetition into true mastery.</p>
<p>This ability to create brings me to the last theory: Bloom's Taxonomy.</p>
<h2 id="heading-what-is-blooms-taxonomy">What is Bloom's Taxonomy?</h2>
<p>Bloom’s Taxonomy provides a hierarchy of cognitive skills that learners move through as they develop mastery. It begins with the simplest tasks and progresses toward the most complex:</p>
<ol>
<li><p>Remember – recalling facts or syntax</p>
</li>
<li><p>Understand – explaining concepts in your own words</p>
</li>
<li><p>Apply – using knowledge in real situations</p>
</li>
<li><p>Analyze – breaking problems into parts</p>
</li>
<li><p>Evaluate – judging solutions or comparing approaches</p>
</li>
<li><p>Create – building original systems or applications</p>
</li>
</ol>
<p>Most self‑taught developers get stuck in the first two levels. They memorize syntax and understand examples, but they struggle to apply, analyze, or create.</p>
<p>This isn't because they lack ability. Rather, it's because they haven't been taught that learning must progress through these stages.</p>
<p>Bloom’s Taxonomy gives structure to the learning journey.</p>
<p>It reminds self-taught developers that mastery isn't achieved by watching tutorials but by climbing the ladder from remembering → understanding → applying → analyzing → evaluating → creating (with an emphasis on Creation).</p>
<p>Creation is one of the most difficult yet most transformative experiences in your journey as a developer. It forces you to think abstractly, confront ambiguity, and notice dimensions of a problem that tutorials rarely reveal.</p>
<p>When you build something real, the neatness of the theory in your head collapses, and you begin to see its true complexity. You must then devise strategies to navigate these challenges, and through this process, you learn.</p>
<p>And as with anything worthwhile, the process isn't smooth. You'll encounter bugs — not just one or two, but hundreds. Yet this is precisely how real knowledge is built. Every bug you solve becomes a permanent entry in your long‑term memory.</p>
<p>The next time you see that error, you won’t panic. Instead, you’ll recognise it instantly and know exactly where it’s coming from and how to fix it.</p>
<p>Some self‑taught developers encounter a few bugs and never return to their projects again, concluding that “coding isn’t for me.”</p>
<p>After trying several fixes and seeing no progress, they abandon the work and look for something else. But this is the wrong conclusion. The problem is rarely a lack of talent — it's a misunderstanding of how the brain behaves under cognitive strain.</p>
<h3 id="heading-focused-mode-vs-diffuse-mode">Focused Mode vs Diffuse Mode</h3>
<p>When you spend a long time wrestling with a bug, you may be experiencing mental fixation or functional fixedness.</p>
<p>This is when your brain becomes locked into a single line of reasoning, repeating the same logic path over and over because it feels like the right direction. The longer you stare at the problem, the deeper the cognitive rut becomes. You develop tunnel vision, making it almost impossible to see alternative solutions.</p>
<p>This is where understanding how the brain operates becomes essential.</p>
<p>According to Oakley (2014), the brain works in two primary modes:</p>
<ol>
<li><p>Focused Mode: Ideal for executing a known formula or following a clear procedure, terrible for discovering a new approach or breaking out of a mental rut.</p>
</li>
<li><p>Diffuse Mode: This is activated when you step away — walking, showering, relaxing, or sleeping.</p>
</li>
</ol>
<p>In this second mode, the brain enters a “big‑picture” state where neural connections stretch across different regions.</p>
<p>The background processes continue working on the problem without the restrictive tunnel vision of conscious focus.</p>
<p>This phenomenon is known as incubation.</p>
<p>This is why solutions often appear when you’re not actively thinking about the problem. You step away, and suddenly the answer emerges, not because you stopped working, but because a different part of your brain started working for you.</p>
<p>The reality is that many developers never allow for incubation. While you step away from the problem, your brain performs subconscious synthesis: it clears out the noise (Extraneous Load) and lets the core logic (Germane Load) settle. When you return, the “wrong” paths you were obsessing over have faded, and the correct path which was there all along often finally becomes visible.</p>
<p>This is why developers must deliberately allow for incubation. We can take some lessons from great minds of the past:</p>
<p>Henri Poincaré famously struggled with Fuchsian functions for weeks. It was only during a geological excursion when he had completely forgotten about the mathematics that the solution appeared with “perfect certainty” the moment he stepped onto an omnibus. His breakthrough did not come from more effort, but from stepping away long enough for diffuse mode to take over.</p>
<p>Friedrich August Kekulé experienced something similar after years of wondering why benzene’s carbon atoms didn't fit a linear structure.</p>
<p>If some of the greatest minds in history stepped away from their problems and found solutions in diffuse mode, why should developers treat themselves any differently?</p>
<p>Now that you're familiar with some key learning strategies –&nbsp;Cognitive Load Theory, Spaced Repetition, and Bloom's Taxonomy –&nbsp;creating or building a project from the ground up should be your next task. It will help you curate, retrieve, organise, and seal in all that diverse knowledge you've gathered as a self-taught developer.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article, we explored why the human brain isn't instinctively wired to understand programming. Coding is a biologically secondary skill, which means it doesn't develop naturally through immersion but requires explicit instruction, structure, and patience.</p>
<p>We also talked about the limits of working memory, the importance of chunking, and the need to manage cognitive load so that learning remains possible rather than overwhelming.</p>
<p>We then analyzed the three components of Cognitive Load Theory –&nbsp;intrinsic, extraneous, and germane load –&nbsp;and discussed how each influences the learning process. Reducing extraneous load is especially crucial for self‑taught developers, as it frees up mental resources for meaningful understanding.</p>
<p>From there, we turned to the Ebbinghaus Forgetting Curve, which demonstrates how quickly newly learned information fades without reinforcement.</p>
<p>To counter this natural forgetting, we introduced Spaced Repetition, a method that strengthens memory by reviewing material at expanding intervals. We also examined Deliberate Practice, which pushes learners just beyond their comfort zone to promote genuine skill development, and Bloom’s Taxonomy, which outlines the stages of cognitive growth from remembering to creating.</p>
<p>Finally, we emphasized the importance of knowing when to step back. The brain operates in both focused and diffuse modes, and effective learning requires movement between the two. Breaks are not signs of weakness but essential components of consolidation and insight.</p>
<p>Together, these theories form a comprehensive framework for learning to code with scientific precision. When self‑taught developers understand how their brain learns, forgets, and grows, they can design a learning process that isn't only more efficient but far more sustainable.</p>
<p>With all this new knowledge, one truth is certain: focus, determination, and consistency are the forces that transform theory into mastery.</p>
<p>Learning science can guide the process, but only sustained effort turns knowledge into skill.</p>
<h2 id="heading-references">References</h2>
<ol>
<li><p>Clearwater, L. (2024). <em>Understanding the Science Behind Learning Retention | Reports | What We Think | Indegene</em>. [online] <a href="http://www.indegene.com">www.indegene.com</a>. Available at: <a href="https://www.indegene.com/what-we-think/reports/understanding-science-behind-learning-retention">https://www.indegene.com/what-we-think/reports/understanding-science-behind-learning-retention</a>.</p>
</li>
<li><p>Dylan Wiliam [@dylanwiliam]. (2017, January 25). <em>I’ve come to the conclusion Sweller’s Cognitive Load Theory is the single most important thing for teachers to know</em> [Tweet]. X. <a href="https://x.com/dylanwiliam/status/824682504602943489">https://x.com/dylanwiliam/status/824682504602943489</a></p>
</li>
<li><p>Ericsson, K. A., Krampe, R. T., &amp; Tesch-Römer, C. (1993).<br><em>The role of deliberate practice in the acquisition of expert performance.</em><br><strong>Psychological Review, 100(3), 363–406.</strong></p>
</li>
<li><p>Garnett, S. (2020.). <em>Cognitive Load Theory A handbook for teachers</em>. [online] Available at: <a href="https://www.crownhouse.co.uk/assets/look-inside/9781785835018.pdf">https://www.crownhouse.co.uk/assets/look-inside/9781785835018.pdf</a>.</p>
</li>
<li><p>Geary, D. C. (2007). <em>An evolutionary perspective on learning disability in mathematics</em>. Developmental Neuropsychology, 32(1), 471–519. <a href="https://doi.org/10.1080/87565640701360924">https://doi.org/10.1080/87565640701360924</a></p>
</li>
<li><p>Geary, D. C. (2008). <em>An evolutionarily informed education science</em>. Educational Psychologist, 43(4), 179–195. <a href="https://doi.org/10.1080/00461520802392133">https://doi.org/10.1080/00461520802392133</a></p>
</li>
<li><p>George A. Miller (1956). <em>The magical number seven, plus or minus two: Some limits on our capacity for processing information</em>. Psychological Review, 63(2), 81–97. <a href="https://doi.org/10.1037/h0043158">https://doi.org/10.1037/h0043158</a></p>
</li>
<li><p>Nelson Cowan (2001). <em>The magical number 4 in short-term memory: A reconsideration of mental storage capacity</em>. Behavioral and Brain Sciences, 24(1), 87–114. <a href="https://doi.org/10.1017/S0140525X01003922">https://doi.org/10.1017/S0140525X01003922</a></p>
</li>
<li><p>Oakley, B. (2014). <em>A Mind for Numbers: How to Excel at Math and Science (Even If You Flunked Algebra).</em> New York: TarcherPerigee.</p>
</li>
<li><p>Sweller, J. (1988). Cognitive Load during Problem Solving: Effects on Learning. <em>Cognitive Science</em>, [online] 12(2), pp.257–285. doi:<a href="https://doi.org/10.1207/s15516709cog1202_4">https://doi.org/10.1207/s15516709cog1202_4</a>.</p>
</li>
</ol>
<p>‌</p>
<p>‌</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Go From Hello World to Building Real-World Applications ]]>
                </title>
                <description>
                    <![CDATA[ Many developers start learning programming by building simple projects like todo apps, calculators, and basic CRUD applications. These projects are useful at the beginning, as they help you understand how a programming language works and give you the... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-go-from-hello-world-to-building-real-world-applications/</link>
                <guid isPermaLink="false">697d098607632dbd100433e8</guid>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Beginner Developers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Learning Journey ]]>
                    </category>
                
                    <category>
                        <![CDATA[ coding ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Spruce Emmanuel ]]>
                </dc:creator>
                <pubDate>Fri, 30 Jan 2026 19:41:58 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769802056548/2b1b2ede-5f7f-423f-b6ee-19e0c0ac7b43.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Many developers start learning programming by building simple projects like todo apps, calculators, and basic CRUD applications. These projects are useful at the beginning, as they help you understand how a programming language works and give you the confidence to start building things. But for many developers, progress stops there.</p>
<p>Real world applications aren’t just about showing data on a screen. They solve real problems, work with real users, and handle situations that don’t always go as planned. This is where many developers struggle.</p>
<p>When I review junior developers’ résumés, I notice a common pattern: the projects section is often filled with beginner apps that look very similar. In today’s job market, this is usually not enough. Employers want to see that you can build something useful, something people would actually use.</p>
<p>The goal of this article is to help you move past simple Hello World projects like todo apps, calculators, and basic CRUD applications. By the end, you’ll understand how to approach building real applications that solve real problems and feel closer to what is built in the real world.</p>
<p>You might be wondering why you should listen to me.</p>
<p>Over the last 10 years, I’ve spent a lot of time building, breaking, and rebuilding software. I have experimented, failed many times, and eventually built applications that thousands of people use every day. A few weeks ago, I launched one of my own SaaS products and watched real users use it at scale, with over a thousand active users during peak hours, without the system crashing.</p>
<p>I’m sharing this because I’ve been where you are now.</p>
<p>If you continue reading, you will:</p>
<ul>
<li><p>Learn from real experience building applications used by real users</p>
</li>
<li><p>Learn what not to do, based on years of mistakes and lessons</p>
</li>
<li><p>Learn what actually works and what helps you stand out as a junior developer</p>
</li>
<li><p>Clear up common misconceptions that slow people down</p>
</li>
</ul>
<p>This article is not about theory. It’s about building real things.</p>
<p>To drive this point home, we’ll build a real world application that solves a real problem and is used by real people. Along the way, you’ll learn how to come up with real application ideas, how to build them with simple tools, and how to serve them to many users.</p>
<p>If this sounds like something you’re up for, then let’s get started.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><p><a class="post-section-overview" href="#heading-you-probably-think-you-dont-know-enough">You Probably Think You Don’t Know Enough</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-find-real-world-application-ideas">How to Find Real World Application Ideas</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-what-are-we-going-to-build">What Are We Going to Build</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-prerequisites">Prerequisites</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-1-setting-up-the-backend">Step 1: Setting Up the Backend</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-2-adding-background-removal-to-the-backend">Step 2: Adding Background Removal to the Backend</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-3-building-the-frontend">Step 3: Building the Frontend</a></p>
<ul>
<li><a class="post-section-overview" href="#heading-running-and-testing-the-application-locally">Running and Testing the Application Locally</a></li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-step-4-putting-the-backend-on-the-internet">Step 4: Putting the Backend on the Internet</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-deploying-the-backend-on-cloud-run">Deploying the Backend on Cloud Run</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-updating-the-frontend-to-use-the-live-backend">Updating the Frontend to Use the Live Backend</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-step-5-making-the-backend-and-frontend-work-together-cors">Step 5: Making the Backend and Frontend Work Together CORS</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-6-putting-the-frontend-on-the-internet">Step 6: Putting the Frontend on the Internet</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-final-thoughts-what-you-just-built-matters">Final Thoughts What You Just Built Matters</a></p>
</li>
</ol>
<h2 id="heading-you-probably-think-you-dont-know-enough"><strong>You Probably Think You Don't Know Enough</strong></h2>
<p>Before we begin, I want to clear up the most common misconception beginners have.</p>
<p>Many developers believe they don’t know enough to start building real world applications. They think they need to learn more JavaScript, more Python, or another framework before they are ready. Some even think learning React is the final step that will suddenly make everything click.</p>
<p>This belief is very common, but it’s not true.</p>
<p>If you know how to write HTML, CSS, and a simple loop or function in any programming language, you already have most of what it takes to build a real world application. This tutorial is proof of that.</p>
<p>That’s why I am writing this article. Not to tell you to learn more first, but to show you how far you can go with what you already know.</p>
<h2 id="heading-how-to-find-real-world-application-ideas">How to Find Real World Application Ideas</h2>
<p>One question beginners ask a lot is, “What kind of apps should I build?”</p>
<p>This is rarely talked about, but it matters more than most people think.</p>
<p>A simple rule is this: build things that already exist.</p>
<p>Look at the apps you use every day, especially the simple ones. Tools that do one thing well. If you find yourself using an app often, that app is solving a real problem.</p>
<p>For example, people use background removers to clean up images. They use URL shorteners to share links. They use notes apps to save quick thoughts. None of these ideas are new, but they are real.</p>
<p>You don’t need to invent something original. You need to understand a problem and build a working solution for it.</p>
<p>When you replicate real tools, you naturally learn how real applications are structured. You also end up with projects that make sense on a résumé, because they solve problems people recognize.</p>
<p>That’s exactly what we are going to do in this tutorial.</p>
<h2 id="heading-what-are-we-going-to-build">What Are We Going to Build?</h2>
<p>I’ll tell you now, it is not going to be another Hello World application. We’re going to be building a background remover web application.</p>
<p>This is the kind of tool people actually use. Designers use it for images, content creators use it for thumbnails, and developers build similar features into real products. It works with real files, real data, and real results.</p>
<p>If you want to see the final result before we start building, you can try the working app here: <a target="_blank" href="https://iamspruce.github.io/background-remover/">https://iamspruce.github.io/background-remover/</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769502551999/c2bdf45f-8768-4dc8-a816-6fa9a05dc15b.png" alt="The background remover application we are about to build" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<p>We’ll build this app using simple tools on purpose. Plain HTML, CSS, and JavaScript for the frontend, and Python for the backend. No heavy frameworks and no complicated setup.</p>
<p>Before we continue, let me clear up <strong>another common misconception.</strong></p>
<p>Many developers believe that for an application to be taken seriously, it must be built with complex frameworks. In my experience building applications for clients around the world over the last 10 years, not a single client has ever asked me what framework I used.</p>
<p>They only cared about one thing: Did it work, and did it solve their problem?</p>
<p>Users won’t care how your app is built. They care that it works. If HTML, CSS, and JavaScript can solve the problem, there’s no reason to wait months just to learn a new framework.</p>
<p>Now that we understand <em>why</em> we’re building this app and <em>what</em> problem it solves, it’s time to start writing code.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before we start writing code, let’s quickly talk about what you need.</p>
<p>This tutorial is not for absolute beginners, but it’s also not super advanced. If you’ve built small things before and you want to build something that actually feels real, you’re in the right place.</p>
<h3 id="heading-what-you-should-already-know">What You Should Already Know</h3>
<p>You should be comfortable with:</p>
<ul>
<li><p>Basic HTML: You know what inputs, buttons, images, and divs do.</p>
</li>
<li><p>Basic CSS: You can style a page and make it look presentable.</p>
</li>
<li><p>Basic JavaScript: You know how to listen for a button click and send a request using <code>fetch</code>.</p>
</li>
</ul>
<p>That’s enough to follow along.</p>
<p>You don’t need React or any other frontend framework.</p>
<h3 id="heading-backend-knowledge">Backend Knowledge</h3>
<p>For the backend, you don’t need to be a Python expert.</p>
<p>You just need to understand that:</p>
<ul>
<li><p>Python can run a server</p>
</li>
<li><p>A server can receive requests</p>
</li>
<li><p>A server can send back responses</p>
</li>
</ul>
<p>Everything else will be explained as we go.</p>
<h3 id="heading-tools-you-need">Tools You Need</h3>
<p>Make sure you have these installed:</p>
<ul>
<li><p>Python 3.9 or newer</p>
</li>
<li><p>Git</p>
</li>
<li><p>A code editor like VS Code</p>
</li>
<li><p>A browser</p>
</li>
</ul>
<p>No Docker knowledge or cloud experience required.</p>
<h3 id="heading-github-account-important">GitHub Account (Important)</h3>
<p>We’ll deploy the backend directly from GitHub, so you’ll need a GitHub account.</p>
<p>If you’ve never pushed a project to GitHub or hosted one before, I’ve already written a <a target="_blank" href="https://www.freecodecamp.org/news/host-your-first-project-on-github/">beginner-friendly guide</a> you can follow first.</p>
<p>Read that article, then come back here.</p>
<h3 id="heading-a-quick-mindset-check">A Quick Mindset Check</h3>
<p>This is not a copy-paste tutorial. You will see real errors. Things may break. That’s normal. That’s how real applications are built.</p>
<p>Now that we’re clear on what you need, let’s start writing code.</p>
<p>We’ll begin with the backend. This is an important decision, so let’s explain it properly.</p>
<h2 id="heading-step-1-setting-up-the-backend">Step 1: Setting Up the Backend</h2>
<h3 id="heading-what-is-a-backend-and-why-do-we-need-one">What Is a Backend and Why Do We Need One?</h3>
<p>A backend is a program that runs on a server and does the heavy work for an application.</p>
<p>In our case, the heavy work is image processing. Removing a background from an image requires libraries that can’t run inside the browser. Browsers are designed for safety and user interaction, not for this kind of processing.</p>
<p>That’s why we need a backend.</p>
<p>The backend will:</p>
<ul>
<li><p>Receive an image from the user</p>
</li>
<li><p>Remove the background</p>
</li>
<li><p>Send the processed image back</p>
</li>
</ul>
<p>The frontend will simply talk to this backend later.</p>
<h3 id="heading-keeping-things-simple-on-purpose">Keeping Things Simple on Purpose</h3>
<p>Because this might be your first real project, we’re going to keep the backend as simple as possible.</p>
<ul>
<li><p>One programming language (Python)</p>
</li>
<li><p>One backend file</p>
</li>
<li><p>No complex folder structure</p>
</li>
<li><p>No advanced concepts</p>
</li>
</ul>
<p>This is intentional. Real world applications don’t have to start out complex. They typically start small and grow.</p>
<h3 id="heading-project-structure">Project Structure</h3>
<p>Create a new folder called:</p>
<pre><code class="lang-bash">background-remover
</code></pre>
<p>Inside it, create a folder for the backend:</p>
<pre><code class="lang-bash">background-remover/
  backend/
</code></pre>
<p>Move into the backend folder:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> background-remover/backend
</code></pre>
<p>Now create a virtual environment:</p>
<pre><code class="lang-bash">python -m venv env
</code></pre>
<p>A virtual environment keeps this project’s dependencies separate from everything else on your computer. This is standard practice and something you’ll see in real projects.</p>
<p>Now activate it:</p>
<p>macOS or Linux:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> env/bin/activate
</code></pre>
<p>Windows:</p>
<pre><code class="lang-bash">env\Scripts\activate
</code></pre>
<p>Now create a folder for your application code:</p>
<pre><code class="lang-bash">mkdir api
</code></pre>
<p>Your structure should now look like this:</p>
<pre><code class="lang-bash">background-remover/
  backend/
    env/
    api/
</code></pre>
<p>At this stage, nothing looks impressive yet. That’s normal.</p>
<h3 id="heading-installing-fastapi">Installing FastAPI</h3>
<p>We’ll use FastAPI to build the backend API.</p>
<p>Install it together with Uvicorn, which is the server that runs our app:</p>
<pre><code class="lang-bash">pip install fastapi uvicorn
</code></pre>
<p>FastAPI allows us to define endpoints clearly and with very little code, which is perfect for us.</p>
<h3 id="heading-creating-the-first-backend-file">Creating the First Backend File</h3>
<p>Inside the <code>api</code> folder, create a file called <code>main.py</code>.</p>
<p>Add the following code:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> fastapi <span class="hljs-keyword">import</span> FastAPI

app = FastAPI()

<span class="hljs-meta">@app.get("/health")</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">health</span>():</span>
    <span class="hljs-keyword">return</span> {<span class="hljs-string">"status"</span>: <span class="hljs-string">"ok"</span>}
</code></pre>
<p>Let’s pause and understand what this does.</p>
<ul>
<li><p>We created a FastAPI application</p>
</li>
<li><p>We added a <code>/health</code> endpoint</p>
</li>
<li><p>This endpoint simply returns a message</p>
</li>
</ul>
<p>Before building real features, developers always confirm that their server actually runs. That is exactly what this endpoint is for.</p>
<h3 id="heading-running-the-server">Running the Server</h3>
<p>From inside the <code>backend</code> folder, start the server:</p>
<pre><code class="lang-bash">uvicorn api.main:app --reload
</code></pre>
<p>Now open a new terminal and run:</p>
<pre><code class="lang-bash">curl http://localhost:8000/health
</code></pre>
<p>You should see:</p>
<pre><code class="lang-bash">{<span class="hljs-string">"status"</span>:<span class="hljs-string">"ok"</span>}
</code></pre>
<p>This is an important moment.</p>
<p>You now have:</p>
<ul>
<li><p>A running backend server</p>
</li>
<li><p>A real HTTP endpoint</p>
</li>
<li><p>A response coming from your own code</p>
</li>
</ul>
<p>This is how real backend services start.</p>
<h3 id="heading-why-we-did-this-first">Why We Did This First</h3>
<p>At this point, you might wonder why we didn’t jump straight into background removal.</p>
<p>The reason is simple: if the server doesn’t run, nothing else matters.</p>
<p>By starting with a health endpoint, we removed uncertainty. We know the server works. Everything we add next is built on top of something we already know is working.</p>
<p>Now that the foundation is in place, we can move on to the real feature.</p>
<h2 id="heading-step-2-adding-background-removal-to-the-backend">Step 2: Adding Background Removal to the Backend</h2>
<p>Before we write any code here, we need to clear up an important misconception.</p>
<h3 id="heading-a-common-misconception-about-machine-learning">A Common Misconception About Machine Learning</h3>
<p>When people hear “background removal,” they often think machine learning is too advanced for them.</p>
<p>In real world development, this is almost never how it works.</p>
<p>You aren’t expected to build machine learning models yourself. You use libraries created by others and focus on integrating them correctly.</p>
<p>That is exactly what we’re doing here.</p>
<h3 id="heading-installing-the-background-removal-library">Installing the Background Removal Library</h3>
<p>Install the required packages:</p>
<pre><code class="lang-bash">pip install rembg pillow onnxruntime
</code></pre>
<ul>
<li><p><code>rembg</code> handles the background removal</p>
</li>
<li><p><code>pillow</code> helps us work with images</p>
</li>
</ul>
<p>For our purposes here, you don’t need to understand how these libraries work internally. You only need to know how to use them.</p>
<h3 id="heading-adding-the-background-removal-endpoint">Adding the Background Removal Endpoint</h3>
<p>Now update <code>main.py</code> so it looks like this:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> fastapi <span class="hljs-keyword">import</span> FastAPI, UploadFile, File
<span class="hljs-keyword">from</span> rembg <span class="hljs-keyword">import</span> remove
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> io

app = FastAPI()

<span class="hljs-meta">@app.get("/health")</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">health</span>():</span>
    <span class="hljs-keyword">return</span> {<span class="hljs-string">"status"</span>: <span class="hljs-string">"ok"</span>}

<span class="hljs-meta">@app.post("/remove-bg")</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">remove_bg</span>(<span class="hljs-params">file: UploadFile = File(<span class="hljs-params">...</span>)</span>):</span>
    image_bytes = <span class="hljs-keyword">await</span> file.read()
    image = Image.open(io.BytesIO(image_bytes))

    output = remove(image)

    buffer = io.BytesIO()
    output.save(buffer, format=<span class="hljs-string">"PNG"</span>)
    buffer.seek(<span class="hljs-number">0</span>)

    <span class="hljs-keyword">return</span> buffer.getvalue()
</code></pre>
<p>Let’s explain this carefully.</p>
<ul>
<li><p>The endpoint accepts an uploaded image</p>
</li>
<li><p>The image is read into memory</p>
</li>
<li><p>The background is removed</p>
</li>
<li><p>The result is saved as a PNG with transparency</p>
</li>
<li><p>The image is returned to the client</p>
</li>
</ul>
<p>This endpoint is the core of our application.</p>
<h3 id="heading-testing-the-endpoint-with-curl">Testing the Endpoint With curl</h3>
<p>Before building the frontend, we’ll test the backend directly.</p>
<p>Run this command:</p>
<pre><code class="lang-javascript">curl -X POST \
  -F <span class="hljs-string">"file=@person.jpg"</span> \
  <span class="hljs-attr">http</span>:<span class="hljs-comment">//localhost:8000/remove-bg \</span>
  --output result.png
</code></pre>
<p>Open <code>result.png</code>. If you see the background removed, then the backend is complete.</p>
<p>At this point, you have built a backend that:</p>
<ul>
<li><p>Accepts real user input</p>
</li>
<li><p>Processes real data</p>
</li>
<li><p>Returns a meaningful result</p>
</li>
</ul>
<p>This is a real backend.</p>
<h3 id="heading-where-we-are-now">Where We Are Now</h3>
<p>Let’s pause and summarize:</p>
<ul>
<li><p>We set up a backend server</p>
</li>
<li><p>We confirmed that it runs</p>
</li>
<li><p>We added a real feature</p>
</li>
<li><p>We tested it without a frontend</p>
</li>
</ul>
<p>This is exactly how real developers work.</p>
<p>In the next section, we’ll build a simple frontend that talks to this backend and turns it into something users can interact with.</p>
<h2 id="heading-step-3-building-the-frontend-what-the-user-actually-sees">Step 3: Building the Frontend (What the User Actually Sees)</h2>
<p>At this point, our backend is working.</p>
<p>It can receive an image, remove the background, and send the result back. But right now, only developers can use it, because it requires terminal commands.</p>
<p>To make this useful to actual (non-technical) people, we need a frontend.</p>
<p>The frontend is simply the part of the application users see and interact with in their browser.</p>
<h3 id="heading-clearing-a-common-misconception-about-frontends">Clearing a Common Misconception About Frontends</h3>
<p>Many beginners think building a frontend means learning a framework first.</p>
<p>This is not true.</p>
<p>Frameworks help later, but they aren’t required to build real applications. Under the hood, every frontend still comes down to HTML, CSS, and JavaScript.</p>
<p>That’s why we are using plain HTML, CSS, and JavaScript here. No React, no build tools, no setup. Just the basics.</p>
<h3 id="heading-what-our-frontend-will-do">What Our Frontend Will Do</h3>
<p>Our frontend has one job. It will:</p>
<ul>
<li><p>Let the user select an image</p>
</li>
<li><p>Send that image to the backend</p>
</li>
<li><p>Receive the processed image</p>
</li>
<li><p>Show it on the screen</p>
</li>
<li><p>Allow the user to download it</p>
</li>
</ul>
<p>That’s all.</p>
<p>If it does these things correctly, it’s a real frontend.</p>
<h3 id="heading-creating-the-frontend">Creating the Frontend</h3>
<p>Go back to the root of your project and create three files:</p>
<pre><code class="lang-bash">index.html
styles.css
app.js
</code></pre>
<p>This simple setup is very common. Each file has a clear responsibility, which makes the code easier to understand.</p>
<h3 id="heading-writing-the-html-page">Writing the HTML Page</h3>
<p>Open <code>index.html</code> and add the following:</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Background Remover<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"styles.css"</span> /&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Background Remover<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"file"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"imageInput"</span> /&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"removeBtn"</span>&gt;</span>Remove Background<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"result"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"resultImage"</span> /&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"downloadLink"</span> <span class="hljs-attr">download</span>&gt;</span>Download Image<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"app.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>Right now, this page won’t do anything interesting. That’s expected.</p>
<p>HTML only describes what should be on the page. The behavior comes from JavaScript, which we’ll add after we add some styling.</p>
<h3 id="heading-adding-some-basic-styling">Adding Some Basic Styling</h3>
<p>Open <code>styles.css</code> and add this:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">body</span> {
  <span class="hljs-attribute">font-family</span>: sans-serif;
  <span class="hljs-attribute">max-width</span>: <span class="hljs-number">600px</span>;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">40px</span> auto;
}

<span class="hljs-selector-tag">button</span> {
  <span class="hljs-attribute">margin-top</span>: <span class="hljs-number">10px</span>;
}

<span class="hljs-selector-class">.result</span> {
  <span class="hljs-attribute">margin-top</span>: <span class="hljs-number">20px</span>;
}

<span class="hljs-selector-tag">img</span> {
  <span class="hljs-attribute">max-width</span>: <span class="hljs-number">100%</span>;
}

<span class="hljs-selector-id">#downloadLink</span> {
  <span class="hljs-attribute">display</span>: none;
  <span class="hljs-attribute">margin-top</span>: <span class="hljs-number">10px</span>;
}
</code></pre>
<p>This is not about making things look fancy.</p>
<p>The goal here is simply to make the page readable and pleasant to use. Many real internal tools look no better than this. (And you can always improve the styling later if you want.)</p>
<h3 id="heading-connecting-the-frontend-to-the-backend">Connecting the Frontend to the Backend</h3>
<p>Now we’ll write the JavaScript that makes everything work.</p>
<p>Open <code>app.js</code> and add the following code:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> imageInput = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"imageInput"</span>);
<span class="hljs-keyword">const</span> removeBtn = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"removeBtn"</span>);
<span class="hljs-keyword">const</span> resultImage = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"resultImage"</span>);
<span class="hljs-keyword">const</span> downloadLink = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"downloadLink"</span>);

removeBtn.addEventListener(<span class="hljs-string">"click"</span>, <span class="hljs-keyword">async</span> () =&gt; {
  <span class="hljs-keyword">const</span> file = imageInput.files[<span class="hljs-number">0</span>];

  <span class="hljs-keyword">if</span> (!file) {
    <span class="hljs-keyword">return</span>;
  }

  <span class="hljs-keyword">const</span> formData = <span class="hljs-keyword">new</span> FormData();
  formData.append(<span class="hljs-string">"file"</span>, file);

  <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">"http://localhost:8000/remove-bg"</span>, {
    <span class="hljs-attr">method</span>: <span class="hljs-string">"POST"</span>,
    <span class="hljs-attr">body</span>: formData,
  });

  <span class="hljs-keyword">const</span> blob = <span class="hljs-keyword">await</span> response.blob();
  <span class="hljs-keyword">const</span> imageUrl = URL.createObjectURL(blob);

  resultImage.src = imageUrl;
  downloadLink.href = imageUrl;
  downloadLink.style.display = <span class="hljs-string">"inline"</span>;
});
</code></pre>
<p>Let’s slow down and explain what’s happening here:</p>
<ul>
<li><p>We read the image selected by the user</p>
</li>
<li><p>We wrap it in <code>FormData</code> so it can be sent to the backend</p>
</li>
<li><p>We send it to our <code>/remove-bg</code> endpoint</p>
</li>
<li><p>We receive the processed image back</p>
</li>
<li><p>We display it and prepare it for download</p>
</li>
</ul>
<p>This is the moment where the frontend and backend finally talk to each other.</p>
<h3 id="heading-running-the-frontend-with-live-server">Running the Frontend With Live Server</h3>
<p>Before testing, make sure your backend is still running.</p>
<p>Now, instead of opening <code>index.html</code> directly, use the <strong>Live Server</strong> extension in VS Code.</p>
<p>If you don’t have it installed, just open VS Code extensions, search for “Live Server”, and then install it. Then right click on <code>index.html</code> and click “Open with Live Server”.</p>
<p>This starts a small local server for the frontend.</p>
<p>Why does this matter?</p>
<p>Many browser features work better when files are served through a server instead of opened directly from the file system. Using Live Server also matches how real frontends are served.</p>
<h3 id="heading-testing-the-full-application-locally">Testing the Full Application Locally</h3>
<p>Now choose an image and click the button.</p>
<p>If everything is working:</p>
<ul>
<li><p>The image is sent to the backend</p>
</li>
<li><p>The background is removed</p>
</li>
<li><p>The result appears on the page</p>
</li>
<li><p>The download link shows up</p>
</li>
</ul>
<p>Take a moment here. You have just built:</p>
<ul>
<li><p>A backend that processes real data</p>
</li>
<li><p>A frontend that talks to it</p>
</li>
<li><p>A complete application running locally</p>
</li>
</ul>
<p>This is already more than a “Hello World” project.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769503437045/6a984e58-cee9-4255-84aa-76ee26b805b3.png" alt="The application running locally after connecting the frontend and backend and removing background from an image" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<h3 id="heading-clearing-one-more-misconception">Clearing One More Misconception</h3>
<p>Some beginners look at this and think: “This feels too simple to be a real app.”</p>
<p>This is another misconception. Real applications aren’t defined by complexity. They’re defined by usefulness. If your app solves a real problem and people can use it, it’s a real application.</p>
<p>In the next section, we’ll take this exact app and put it on the internet so anyone can use it.</p>
<h2 id="heading-step-4-putting-the-backend-on-the-internet">Step 4: Putting the Backend on the Internet</h2>
<p>Right now, your backend is running on your computer.</p>
<p>That means:</p>
<ul>
<li><p>It works only for you</p>
</li>
<li><p>If you close your laptop, it stops</p>
</li>
<li><p>If someone opens your frontend, it cannot reach your backend</p>
</li>
</ul>
<p>To fix this, we need to run the backend on a computer that is <strong>always online</strong>.</p>
<p>This process is called <strong>deployment</strong>.</p>
<h3 id="heading-a-simple-way-to-think-about-deployment">A Simple Way to Think About Deployment</h3>
<p>Deployment does <strong>not</strong> mean writing new code.</p>
<p>It simply means this: instead of running your backend on your laptop, you run it on another computer that never sleeps.</p>
<p>Everything we do next exists only to make that happen.</p>
<h3 id="heading-why-we-arent-using-netlify-or-vercel">Why We Aren’t Using Netlify or Vercel</h3>
<p>You might be wondering why we aren’t using Netlify or Vercel. Those platforms are great, but they’re mainly for <strong>frontends</strong>.</p>
<p>They work best when your app is:</p>
<ul>
<li><p>Static HTML, CSS, and JavaScript</p>
</li>
<li><p>A frontend framework like React or Vue</p>
</li>
<li><p>Small serverless functions</p>
</li>
</ul>
<p>Our backend is different. It’s a <strong>Python server</strong> that:</p>
<ul>
<li><p>Stays running</p>
</li>
<li><p>Accepts image uploads</p>
</li>
<li><p>Processes images</p>
</li>
<li><p>Uses heavy native libraries for background removal</p>
</li>
</ul>
<p>This kind of backend needs a <strong>real server</strong>, not a lightweight serverless function.</p>
<p>That’s why Netlify and Vercel aren’t a good fit here.</p>
<h3 id="heading-why-were-using-cloud-run">Why We’re Using Cloud Run</h3>
<p>Instead, we’re using <strong>Cloud Run</strong>.</p>
<p>Cloud Run lets us run real backend servers on Google’s infrastructure without managing servers ourselves.</p>
<p>We’re using it because:</p>
<ul>
<li><p>It supports full Python backends</p>
</li>
<li><p>It deploys directly from GitHub</p>
</li>
<li><p>It handles scaling and servers for us</p>
</li>
<li><p>It works well with heavy workloads</p>
</li>
<li><p>It’s beginner-friendly</p>
</li>
</ul>
<p>Most importantly, it lets you deploy a <strong>real backend</strong> without learning cloud commands or CI/CD pipelines.</p>
<h3 id="heading-preparing-the-backend-for-cloud-run">Preparing the Backend for Cloud Run</h3>
<p>Before deploying, we need to make sure our backend is ready.</p>
<h4 id="heading-creating-requirementstxt">Creating <code>requirements.txt</code></h4>
<p>Inside the <code>backend</code> folder, create a file called <code>requirements.txt</code>.</p>
<p>Add this:</p>
<pre><code class="lang-go">fastapi
uvicorn
rembg
pillow
onnxruntime
</code></pre>
<p>This file tells Cloud Run which Python libraries to install.</p>
<h3 id="heading-creating-a-github-repository">Creating a GitHub Repository</h3>
<p>Cloud Run deploys directly from GitHub, so our code must live there.</p>
<p>From the project root, run:</p>
<pre><code class="lang-go">git init
git add .
git commit -m <span class="hljs-string">"Initial background remover project"</span>
git branch -M main
git remote add origin YOUR_REPO_URL
git push -u origin main
</code></pre>
<p>This <strong>single repository</strong> will be used for both backend and frontend.</p>
<h3 id="heading-deploying-the-backend-on-cloud-run">Deploying the Backend on Cloud Run</h3>
<p>Now open your browser and go to <strong>Google Cloud Console</strong>.</p>
<h4 id="heading-1-create-a-new-project">1. Create a New Project</h4>
<p>Open <a target="_blank" href="https://console.cloud.google.com">Google Cloud Console</a> and click New Project. Give it a name (for example: <code>background-remover</code>) and then click Create.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749541636/778464de-2c95-4f7e-9505-9729a84f2001.png" alt="Creating a new Google Cloud project" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<h4 id="heading-2-open-cloud-run">2. Open Cloud Run</h4>
<p>Use the search bar at the top and search for <strong>Cloud Run.</strong> Then open it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749581066/9078ae2e-fa00-4dfa-be04-383d9702bb90.png" alt="Cloud Run overview page" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<p>Cloud Run will automatically enable the required APIs.</p>
<p>You will be asked to set up billing. Google gives you $300 free credit, which is more than enough for this tutorial.</p>
<h4 id="heading-3-start-creating-the-service">3. Start Creating the Service</h4>
<p>Click Create Service and choose Deploy continuously from a repository.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749636809/348f720a-b1b1-46e4-9eab-48928adeb2f3.png" alt="Creating a Cloud Run service from a repository" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<h4 id="heading-4-connect-your-github-account">4. Connect Your GitHub Account</h4>
<p>Select <strong>GitHub</strong> as the repository provider and authenticate your GitHub account. Then install Google Cloud Build on your GitHub account. Choose <strong>only the repository</strong> you want to deploy.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749686780/89571b5e-0bd7-4127-82d2-b9445a5044e4.png" alt="Installing Google Cloud Build on GitHub" class="image--center mx-auto" width="2272" height="1664" loading="lazy"></p>
<p>This allows Google Cloud to build and deploy your code automatically.</p>
<h4 id="heading-5-select-the-repository">5. Select the Repository</h4>
<p>Then choose the repository you just installed Cloud Build on and select the <code>main</code> branch.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749745522/a9f95c4b-7fd3-480d-bae1-7ae92bcdd52f.png" alt="Selecting the GitHub repository" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<h4 id="heading-6-configure-the-build">6. Configure the Build</h4>
<p>Now comes the important part: building the context directory.</p>
<p>Set this to:</p>
<pre><code class="lang-bash">backend
</code></pre>
<p>This tells Cloud Run:</p>
<blockquote>
<p>“My backend code lives inside the <code>backend</code> folder.”</p>
</blockquote>
<p>For the entry command, enter:</p>
<pre><code class="lang-bash">uvicorn api.main:app --host 0.0.0.0 --port 8080
</code></pre>
<p>This is how Cloud Run starts your FastAPI server.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749801126/87676cce-3e75-4244-b32f-401f782d7c85.png" alt="Build configuration for the backend" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<h4 id="heading-7-configure-container-resources">7. Configure Container Resources</h4>
<p>Our backend runs a <strong>background-removal model</strong>, which is heavy.</p>
<p>So we must increase resources.</p>
<ul>
<li><p>Change memory from <strong>512 MB → 2 GB</strong></p>
</li>
<li><p>Set CPU to <strong>4</strong></p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749870471/a24e5d37-af21-48a6-b720-b6748d478b6d.png" alt="Increasing memory and CPU" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<p>This ensures the model can load and run properly.</p>
<h4 id="heading-8-deploy">8. Deploy</h4>
<p>Now click <strong>Create</strong>.</p>
<p>Cloud Run will:</p>
<ul>
<li><p>Build your app</p>
</li>
<li><p>Install dependencies</p>
</li>
<li><p>Create a container</p>
</li>
<li><p>Deploy it to the internet</p>
</li>
</ul>
<p>You’ll see logs showing the build and deployment process.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749916316/5eb276f6-01c1-413c-aeb7-13a8d34dbbe2.png" alt="Cloud Build running" class="image--center mx-auto" width="2614" height="1848" loading="lazy"></p>
<p>This can take a few minutes. That’s normal.</p>
<h3 id="heading-checking-that-the-backend-is-live">Checking That the Backend Is Live</h3>
<p>Once deployment finishes, Cloud Run will show you a <strong>public URL</strong>.</p>
<p>Test it:</p>
<pre><code class="lang-bash">curl https://YOUR_CLOUD_RUN_URL/health
</code></pre>
<p>If you see:</p>
<pre><code class="lang-bash">{<span class="hljs-string">"status"</span>:<span class="hljs-string">"ok"</span>}
</code></pre>
<p>Your backend is officially live on the internet.</p>
<p>Pause here for a second.</p>
<p>You just deployed a real backend. Congratulations.</p>
<h3 id="heading-updating-the-frontend-to-use-the-live-backend">Updating the Frontend to Use the Live Backend</h3>
<p>Open <code>app.js</code>.</p>
<p>Replace:</p>
<pre><code class="lang-bash">http://localhost:8000/remove-bg
</code></pre>
<p>With:</p>
<pre><code class="lang-bash">https://YOUR_CLOUD_RUN_URL/remove-bg
</code></pre>
<p>Save the file and reload the frontend.</p>
<h2 id="heading-step-5-making-the-backend-and-frontend-work-together"><strong>Step 5: Making the Backend and Frontend Work Together</strong></h2>
<p>At this point, we have two things:</p>
<ul>
<li><p>A backend running on the internet</p>
</li>
<li><p>A frontend running in the browser</p>
</li>
</ul>
<p>Now we want them to talk to each other.</p>
<p>Open your frontend, select an image, and click the button. You’ll notice that it still doesn’t work. This is expected.</p>
<h3 id="heading-what-is-happening-here">What Is Happening Here?</h3>
<p>Your frontend is running on one address, while your backend is running on another address.</p>
<p>Browsers are very strict about this. By default, a browser will block requests from one website to another unless the backend explicitly allows it. This is a security feature.</p>
<p>This rule is called <strong>CORS</strong>.</p>
<h3 id="heading-clearing-a-common-misconception-about-cors">Clearing a Common Misconception About CORS</h3>
<p>When beginners see a CORS error, they often think something is broken.</p>
<p>Nothing is broken. CORS is simply the browser saying: “I need the backend to confirm that this frontend is allowed to talk to it.”</p>
<p>So all we need to do is tell the backend: “It’s okay for requests to come from my frontend.”</p>
<h3 id="heading-allowing-only-our-frontend-not-everyone">Allowing Only Our Frontend (Not Everyone)</h3>
<p>Instead of allowing requests from everywhere, we’ll allow requests only from our frontend. This is a good habit to learn early.</p>
<p>Open <code>backend/api/main.py</code>.</p>
<p>Add this import at the top:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> fastapi.middleware.cors <span class="hljs-keyword">import</span> CORSMiddleware
</code></pre>
<p>Then, after creating the FastAPI app, add this:</p>
<pre><code class="lang-python">app.add_middleware(
    CORSMiddleware,
    allow_origins=[
        <span class="hljs-string">"http://127.0.0.1:5500"</span>,
        <span class="hljs-string">"http://localhost:5500"</span>
    ],
    allow_methods=[<span class="hljs-string">"POST"</span>],
    allow_headers=[<span class="hljs-string">"*"</span>],
)
</code></pre>
<p>Why these URLs?</p>
<p>If you’re using the Live Server extension, your frontend is usually served on port <code>5500</code>. These are the addresses your browser is using locally.</p>
<p>We’re telling the backend: “Only accept requests from this frontend.”</p>
<p>That is exactly what we want.</p>
<h3 id="heading-redeploying-the-backend">Redeploying the Backend</h3>
<p>Any time you change backend code, you need to redeploy it.</p>
<p>Since our backend is deployed on Cloud Run and set up with automatic deploy, redeploying is simple, all you need to do is push your changes.</p>
<p>From the project root, run:</p>
<pre><code class="lang-go">git add .
git commit -m <span class="hljs-string">"Add CORS configuration"</span>
git push
</code></pre>
<p>Cloud Run will automatically detect the change and redeploy your backend.</p>
<p>Wait for the deployment to finish. Once it’s done, your backend will now allow requests from your local frontend.</p>
<h3 id="heading-testing-again">Testing Again</h3>
<p>Reload your frontend in the browser.</p>
<p>Select an image and click the button. This time, it should work.</p>
<p>You just handled a real browser security rule that every production app runs into. That alone is a huge learning step.</p>
<h2 id="heading-step-6-putting-the-frontend-on-the-internet-github-pages">Step 6: Putting the Frontend on the Internet (GitHub Pages)</h2>
<p>Right now, your frontend works only on your computer.</p>
<p>Just like the backend earlier, this means no one else can use it.</p>
<p>Let’s fix that.</p>
<h3 id="heading-why-github-pages">Why GitHub Pages?</h3>
<p>Our frontend is:</p>
<ul>
<li><p>Just HTML, CSS, and JavaScript</p>
</li>
<li><p>No backend code</p>
</li>
<li><p>No build step</p>
</li>
</ul>
<p>This makes it perfect for GitHub Pages. GitHub Pages can host static sites for free, and it’s very beginner friendly.</p>
<h3 id="heading-preparing-the-frontend-for-deployment">Preparing the Frontend for Deployment</h3>
<p>Make sure all your frontend files are inside the frontend folder:</p>
<pre><code class="lang-javascript">frontend/
  index.html
  styles.css
  app.js
</code></pre>
<p>Open app.js and make sure the backend URL is the Cloud Run URL, not localhost.</p>
<pre><code class="lang-javascript">fetch(<span class="hljs-string">"https://YOUR_CLOUD_RUN_URL/remove-bg"</span>, {
  <span class="hljs-attr">method</span>: <span class="hljs-string">"POST"</span>,
  <span class="hljs-attr">body</span>: formData,
});
</code></pre>
<p>Save the file.</p>
<h3 id="heading-pushing-the-frontend-to-github">Pushing the Frontend to GitHub</h3>
<p>We already created a GitHub repository earlier, so we’ll reuse it.</p>
<p>From the project root, run:</p>
<pre><code class="lang-javascript">git add .
git commit -m <span class="hljs-string">"Add frontend and prepare for GitHub Pages"</span>
git push
</code></pre>
<h3 id="heading-enabling-github-pages">Enabling GitHub Pages</h3>
<ol>
<li><p>Go to your repository on GitHub.</p>
</li>
<li><p>Open Settings.</p>
</li>
<li><p>Click Pages.</p>
</li>
</ol>
<p>Under Source, select:</p>
<ol>
<li><p>Branch: main</p>
</li>
<li><p>Folder: /(root)</p>
</li>
</ol>
<p>Save everything. After a few seconds, GitHub will give you a URL. This URL is now your frontend on the internet.</p>
<h3 id="heading-updating-cors-for-the-live-frontend">Updating CORS for the Live Frontend</h3>
<p>Now that the frontend is live, go back to backend/api/main.py.</p>
<p>Replace the local origins with your GitHub Pages URL:</p>
<pre><code class="lang-python">allow_origins=[
    <span class="hljs-string">"https://YOUR_GITHUB_USERNAME.github.io"</span>
]
</code></pre>
<p>Commit and push the change:</p>
<pre><code class="lang-bash">git add .
git commit -m <span class="hljs-string">"Update CORS for GitHub Pages"</span>
git push
</code></pre>
<p>Cloud Run will redeploy the backend automatically.</p>
<h3 id="heading-final-test">Final Test</h3>
<p>Open your GitHub Pages URL.</p>
<p>Upload an image, remove the background, and download the result.</p>
<p>Everything is now live.</p>
<h2 id="heading-where-you-are-now">Where You Are Now</h2>
<p>Let’s be very clear about what you just did.</p>
<p>You:</p>
<ul>
<li><p>Built a real backend</p>
</li>
<li><p>Deployed it to the internet</p>
</li>
<li><p>Built a frontend</p>
</li>
<li><p>Deployed it to the internet</p>
</li>
<li><p>Fixed real production issues</p>
</li>
<li><p>Connected everything properly</p>
</li>
</ul>
<p>This is not a demo project. This is a real application.</p>
<p>In the final section, we’ll wrap things up, talk about what you learned, and where you can go next.</p>
<h2 id="heading-final-thoughts-what-you-just-built-matters">Final Thoughts: What You Just Built Matters</h2>
<p>At this point, it is worth stopping and looking back at what you have actually done.</p>
<p>You didn’t just follow steps. You didn’t just copy code. You built a real application.</p>
<h3 id="heading-lets-be-clear-about-what-you-accomplished">Let’s Be Clear About What You Accomplished</h3>
<p>You started with nothing more than basic tools and ideas.</p>
<p>By the end of this tutorial, you:</p>
<ul>
<li><p>Built a backend that processes real data</p>
</li>
<li><p>Used a machine learning tool without fear or overthinking</p>
</li>
<li><p>Exposed a backend to the internet</p>
</li>
<li><p>Built a frontend with plain HTML, CSS, and JavaScript</p>
</li>
<li><p>Connected the frontend and backend properly</p>
</li>
<li><p>Deployed both parts so real users can access them</p>
</li>
</ul>
<p>This is exactly how real applications are built, just at a smaller and more manageable scale.</p>
<h3 id="heading-why-this-is-no-longer-a-beginner-project">Why This Is No Longer a “Beginner Project”</h3>
<p>Many projects are called beginner projects, but they stop at showing things on a screen.</p>
<p>This one does not.</p>
<p>Your app:</p>
<ul>
<li><p>Accepts real input</p>
</li>
<li><p>Performs real work</p>
</li>
<li><p>Runs on real servers</p>
</li>
<li><p>Handles real browser rules</p>
</li>
<li><p>Can be shared with anyone</p>
</li>
</ul>
<p>That is the difference between learning syntax and building software.</p>
<h3 id="heading-the-most-important-lesson-in-this-tutorial">The Most Important Lesson in This Tutorial</h3>
<p>The most important thing you should take away from this is not the project you built.</p>
<p>It is this: You didn’t need to “know more” before you started.</p>
<p>You learned by building. You figured things out as they appeared. You fixed problems when they showed up.</p>
<p>That is how experience is gained. No one has experience before building real applications. No one lacks experience after building many of them.</p>
<h3 id="heading-what-you-can-do-next">What You Can Do Next</h3>
<p>This project isn’t the end. It’s a starting point.</p>
<p>Here are a few ideas you can explore next, using what you already know:</p>
<ul>
<li><p>Improve the user interface</p>
</li>
<li><p>Add loading states and better feedback</p>
</li>
<li><p>Restrict image size or file types</p>
</li>
<li><p>Add simple rate limiting</p>
</li>
<li><p>Build another small tool that solves a real problem</p>
</li>
</ul>
<p>You don’t need to jump to frameworks yet.</p>
<p>If you can build a few more projects like this, frameworks will make a lot more sense when you meet them.</p>
<h3 id="heading-one-last-thought">One Last Thought</h3>
<p>If this was your first real project, you should be proud of yourself.</p>
<p>You moved past tutorials, built something useful, and put it on the internet. That’s the line many developers never cross.</p>
<p>Now that you have crossed it, the next one will be easier.</p>
<p>So keep building!</p>
<h3 id="heading-source-code-and-live-demo">Source Code and Live Demo</h3>
<p>If you want to explore the full project or build on top of it, you can find everything here.</p>
<ul>
<li><p>Live application: <a target="_blank" href="https://iamspruce.github.io/background-remover/">https://iamspruce.github.io/background-remover/</a></p>
</li>
<li><p>GitHub repository: <a target="_blank" href="https://github.com/iamspruce/background-remover">https://github.com/iamspruce/background-remover</a></p>
</li>
</ul>
<p>If you have questions, reach me on X at <a target="_blank" href="https://x.com/sprucekhalifa"><code>@sprucekhalifa</code></a>. I write practical tech articles like this regularly.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ From Failure to International Success: How Online Learning Platforms Saved My Life ]]>
                </title>
                <description>
                    <![CDATA[ It is better to be a samurai in a garden than an agricultural worker in a war - Miyamoto Musashi In this article, I’ll share my story. When I was younger, I thought I was destined to be a failure in life. To be isolated from everyone. But years late... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-online-learning-platforms-saved-my-life/</link>
                <guid isPermaLink="false">67ed3edd597c0ff6bdcf4c45</guid>
                
                    <category>
                        <![CDATA[ Learning Journey ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Online education ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Personal growth   ]]>
                    </category>
                
                    <category>
                        <![CDATA[ learning ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Tiago Capelo Monteiro ]]>
                </dc:creator>
                <pubDate>Wed, 02 Apr 2025 13:42:53 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1743601355025/2f8c32a4-c451-4860-b4e2-f02b690fb928.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <blockquote>
<p>It is better to be a samurai in a garden than an agricultural worker in a war - Miyamoto Musashi</p>
</blockquote>
<p>In this article, I’ll share my story.</p>
<p>When I was younger, I thought I was destined to be a failure in life. To be isolated from everyone. But years later, I realized I was actually destined for success.</p>
<p>I went from wasting thousands of hours playing video games to giving a lecture to medical professionals called “Trustworthy AI: The Role of Small Models in Critical Systems.”</p>
<p>And I went from being told I was dumber than most people based on an IQ test I took as a 14 year old low self-esteem kid, to becoming a frequent contributor to freeCodeCamp. I’ve written articles on interpretable AI, applied math, and advanced tech. And these articles have now reached more than 200,000 people worldwide.</p>
<p><strong>And this is just the beginning.</strong></p>
<p>When it comes to education, I owe gratitude to three people and the organizations they lead:</p>
<ul>
<li><p>Salman Khan, founder of Khan Academy</p>
</li>
<li><p>Quincy Larson, founder of freeCodeCamp</p>
</li>
<li><p>Andrew Ng, co-founder of Coursera and founder of DeepLearning.AI</p>
</li>
</ul>
<p>I also owe a lot to the great author of the book Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones – James Clear.</p>
<p>I’m sharing my story to inspire others who are struggling in their lives just like I was.</p>
<p>I’m also writing this for those who know me or will know me personally, so that they can understand where my determination comes from and why I am relentless.</p>
<h3 id="heading-heres-what-ill-cover">Here’s what I’ll cover:</h3>
<ol>
<li><p><a class="post-section-overview" href="#heading-where-i-was-misery-depression-and-isolation">Where I Was: Misery, Depression, and Isolation</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-my-transformation-learning-triple-integrals-and-programming">My Transformation: Learning Triple Integrals and Programming</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-one-of-the-best-choices-in-my-life-why-i-chose-electrical-and-computer-engineering">One of the Best Choices in My Life: Why I Chose Electrical and Computer Engineering</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-being-restless-and-determined-my-work-ethic-in-university">Being Restless and Determined: My Work Ethic in University</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-my-projects-while-in-nova-fct-ai-projects-international-student-organizations-and-freecodecamp-articles">My Projects while in NOVA FCT: AI Projects, International Student Organizations, and freeCodeCamp Articles</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-my-personal-philosophy-at-21-years-old-and-view-on-envy-and-negativity">My Personal Philosophy at 21 Years Old and View on Envy and Negativity</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-where-i-am-today-a-fraction-of-what-i-have-achieved">Where I Am Today: A Fraction of What I Have Achieved</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-final-thoughts-have-an-adaptive-grand-strategy-for-your-life">Final Thoughts: Have an Adaptive Grand Strategy for Your Life</a></p>
</li>
</ol>
<h2 id="heading-where-i-was-misery-depression-and-isolation">Where I Was: Misery, Depression, and Isolation</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743425427463/49388c13-8c05-41ae-878b-316de0e3ed56.jpeg" alt="Photo by <a href=&quot;https://unsplash.com/@nmbalanial?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash&quot;>Nikko Balanial</a> on <a href=&quot;https://unsplash.com/photos/water-droplets-on-glass-window-4XSdSFgKm8k?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash&quot;>Unsplash</a>       " class="image--center mx-auto" width="2703" height="1850" loading="lazy"></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@nmbalanial?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Nikko Balanial</a> <a target="_blank" href="https://unsplash.com/@nmbalanial?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">on Unsplash</a></p>
<blockquote>
<p>"As it turns out, it was that very rock bottom that became the firmest foundation I had ever planted my feet on." — Mandy Hale</p>
</blockquote>
<p>Five years ago, I was in a different place and was a completely different person.</p>
<p>Like many teenagers, I started playing video games and became addicted to them. Over time, games became an escape from reality and all my problems, including my bad grades and many other issues.</p>
<p>At age 14, I still held ambitions in my heart. I dreamed of being someone who would help others, maybe as a doctor or an engineer.</p>
<p>But after an IQ and vocational guidance test, I was told that I was incapable of doing these things. That I lacked the intelligence needed. That it was unrealistic for me to pursue these types of degrees.</p>
<p>Eventually, and because of many comments, opinions, and expectations of others, I began to believe in this lie for years.</p>
<p>Over time, depressed and constantly escaping reality, my grades plummeted and I got worse and worse. And this only made the prospect of going to college less and less likely.</p>
<p>By 11th grade, I was:</p>
<ul>
<li><p>Extremely shy and anxious</p>
</li>
<li><p>Struggling academically</p>
</li>
<li><p>Over 2000 hours in video games on two games alone:</p>
<ul>
<li><p>1000 hours in GTA V</p>
</li>
<li><p>1000 hours in Destiny 2</p>
</li>
</ul>
</li>
</ul>
<p>2000 hours equals nearly 83 days.</p>
<p>This means that in these two games, I lost more than two months of my life.</p>
<p>But from these wasted hours, I learned English. This became crucial when learning online.</p>
<p>In January 2020, I was tired of everything. In particular, I was sick of the misery of always being at the bottom and of so much negativity towards and around me.</p>
<p>So I made these vows to myself for the rest of my life:</p>
<ul>
<li><p>Never again would I worry or care about what other people say about me.</p>
</li>
<li><p>I would no longer accept the limitations imposed by others or myself on my growth.</p>
</li>
<li><p>And as for the limitations I imposed on myself, I would rethink to see if they were really impossible or if I could actually conquer them.</p>
</li>
</ul>
<p>As a result, I started relearning and learning everything by myself to make sure I succeeded in the national exams.</p>
<h2 id="heading-my-transformation-learning-triple-integrals-and-programming">My Transformation: Learning Triple Integrals and Programming</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743425550115/3f61c996-1a20-415f-bc89-65eaf3119799.jpeg" alt="3f61c996-1a20-415f-bc89-65eaf3119799" class="image--center mx-auto" width="3000" height="2000" loading="lazy"></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@joshuaearle?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Joshua Earle</a> <a target="_blank" href="https://unsplash.com/@joshuaearle?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">on Unsplash</a></p>
<blockquote>
<p><em>"The expert in anything was once a beginner."</em><br>— Helen Hayes</p>
</blockquote>
<p>I started going through chemistry exercises in the 10th and 11th grades using books from school and YouTube videos. In two weeks, I relearned or learned most of the material I needed to know.</p>
<p>I started doing the same for mathematics, something I always found hard due to a lack of basic foundational mathematics knowledge.</p>
<p>I found it hard, that was, until I discovered Khan Academy.</p>
<p>With the Khan Academy, I rebuilt myself, going from struggling with basic math to mastering double and triple integrals, all within five to six months.</p>
<p>My method was simple:</p>
<ul>
<li><p>Study a little bit every day.</p>
</li>
<li><p>Take detailed notes</p>
</li>
<li><p>Redo quizzes or units tests until I scored more than 90%</p>
<ul>
<li>For topics that I found harder or failed to understand, I did the practice exercizes</li>
</ul>
</li>
<li><p>Use YouTube to close any knowledge gaps</p>
</li>
</ul>
<p>For example, for <a target="_blank" href="https://www.khanacademy.org/math/algebra">Algebra I</a>, where I started to relearn math, I say how many units there were. Each unit had a certain number of topics. As of 2025, Algebra I has, from units with mastery exercises, 89 topics.</p>
<p>For those 89 topics, I watched the videos and did the quizzes. According to my scores, I would either go on to the next video (if I felt confident), or stop, rewatch the video, go through the same material on YouTube, do practice exercises, and then try to do the quiz again.</p>
<p>I decided that I needed to do at least three topics every day. This way, by doing 3 topics per day, I could finish Algebra I by the end of one month.</p>
<p>But I was so motivated and so focused on it that I did more than 3 topics per day.</p>
<p>I did the same for Algebra II, and all the others until <a target="_blank" href="https://www.khanacademy.org/math/ap-calculus-bc">College Calculus BC</a>.</p>
<p>Some days, I completed more than 8 topics. Other days, I struggle to even do 2. But I made sure that I mastered mathematics and its foundation for the rest of my life.</p>
<p>This was not just about grades. It was about regaining belief and confidence in myself.</p>
<p>I also read many books, primarily self-help, to make myself better. Over the years, I have started reading fewer self-help books and have started focusing on non-fictional books that explain to me how the world works.</p>
<h3 id="heading-covid-19-accelerating-my-learning-in-programming-and-machine-learning"><strong>COVID-19: Accelerating My Learning in Programming and Machine Learning</strong></h3>
<p>When the pandemic hit, I started accelerating my learning in other areas, like programming and physics. In many online classes, I didn’t pay attention as well as I should’ve – and I found myself prioritizing self study on topics I found more important. And I always used my time to learn more about programming.</p>
<p>I learned Python and C through free YouTube courses for beginners on freeCodeCamp’s channel.</p>
<p>This was where I first learned Python.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/rfscVS0vtbw" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<p>And C:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/KJgsSFOSQv0" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<p>Soon after exploring C programming, I realized that programming languages are just tools. Once you master one, others come more naturally.</p>
<p>I studied data science tutorials on the web and on YouTube. This way, I learned how to import Python libraries in virtual environments. I also began building projects with Python libraries I found interesting and made it a habit to explain every line of code to myself as if I were the teacher.</p>
<p>For example, I started working with the <a target="_blank" href="https://scikit-learn.org/stable/index.html">scikit learn</a> Python library to make simple linear and logistic models that could make make predictions.</p>
<p>I also decided to explore Deep Learning and taught myself how to work with <a target="_blank" href="https://www.arduino.cc/">Arduino</a> and circuits. In other words, I learned how to train the architecture of neural networks to predict things.</p>
<p>I found this hard to master compared to triple integrals at the time!</p>
<p>But this way, I understood one very important thing about Deep Learning: to truly understand and master it, I needed to know, deeply, some difficult mathematics concepts. And I also needed to learn quickly about the new research coming out.</p>
<h2 id="heading-one-of-the-best-choices-in-my-life-why-i-choose-electrical-and-computer-engineering">One of the Best Choices in My Life: Why I Choose Electrical and Computer Engineering</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743426438035/92ee17a4-c537-4922-82cc-cbb42c564baa.jpeg" alt="92ee17a4-c537-4922-82cc-cbb42c564baa" class="image--center mx-auto" width="3888" height="2592" loading="lazy"></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@nicolasthomas?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Nicolas Thomas</a> <a target="_blank" href="https://unsplash.com/@nicolasthomas?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">on Unsplash</a></p>
<blockquote>
<p><em>"Opportunities multiply as they are seized."</em><br>— Sun Tzu</p>
</blockquote>
<p>After completing the Portuguese national mathematics exam in the 12th grade, I chose Electrical and Computer Engineering (ECE). I choose this area, because it would challenge me and allow me to gain the skills to learn and apply new mathematics by myself without anyone teaching me.</p>
<p>It was also broad:</p>
<ul>
<li><p>If I liked, I could follow an electrical engineering area. Like circuits, power systems, or telecommunications.</p>
</li>
<li><p>If an electrical engineering subarea was not in my best interest, I could follow a computer science path or apply math in banking or other areas where people who know applied math work.</p>
</li>
</ul>
<p>The ECE degree also allwed me to unite the following areas:</p>
<ul>
<li><p>Advanced Mathematics</p>
</li>
<li><p>Programming (from low-level like assembly and C to high-level like Python)</p>
</li>
<li><p>Physics (circuits, robotics, communication systems)</p>
</li>
</ul>
<p>I wanted to become someone who not only mastered knowledge but could also create new systems and ideas from it.</p>
<p>I knew that I was laying the foundation for something greater than just academic success.</p>
<h3 id="heading-what-did-i-gain-exactly"><strong>What Did I Gain Exactly?</strong></h3>
<p>Over time, I learned the many skills I needed to understand all the new AI research coming out after completing AI specializations.</p>
<p>I also learned hard math and applied mathematics areas such as:</p>
<ul>
<li><p>Partial differential equations: how they can represent and model real phenomena, like the economy of a country.</p>
</li>
<li><p>Pure harmonic analysis: Fourier and Laplace transformations and how integral transformations allow us to see problems in other ways.</p>
</li>
<li><p>Complex analysis: application of derivatives and integrals in a complex domain, with real and imaginary numbers.</p>
</li>
<li><p>Numerical analysis: how math used to approximate analytical math is used by computers to get faster results.</p>
</li>
<li><p>Signal and control theory: how the architecture of systems is studied to ensure rocket, train, and car control systems are stable, despite possible disturbances in the systems.</p>
</li>
</ul>
<p>Not to mention physics classes like:</p>
<ul>
<li><p>Classical mechanics</p>
</li>
<li><p>Electromagnetism</p>
</li>
</ul>
<p>While these topics may not be applied in depth to AI, learning them helped me develop an incredible intuition into systems thinking. It also greatly improved my ability to learn hard STEM concepts on my own.</p>
<h2 id="heading-being-restless-and-determined-my-work-ethic-in-university">Being Restless and Determined: My Work Ethic in University</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743421252923/58fa0581-1312-4577-b186-b61a0d7ecac1.png" alt="Me at 18 years old" class="image--center mx-auto" width="460" height="460" loading="lazy"></p>
<p>Me at 18 years old</p>
<blockquote>
<p>"Success is the sum of small efforts, repeated day in and day out." — Robert Collier</p>
</blockquote>
<p>I adopted a very rigorous work ethic.</p>
<p>When my work ethic failed to achieve what I wanted, I adapted with more knowledge and learned very deeply what I did wrong so as not to repeat it.</p>
<p>For example, in the first semester, my first grades were not the best. So, I read:</p>
<ul>
<li><p>Deep Work</p>
</li>
<li><p>The Effective Executive: The Definitive Guide to Getting the Right Things Done</p>
</li>
<li><p>How to Become a Straight-A Student: The Unconventional Strategies Real College Students Use</p>
</li>
</ul>
<p>These books taught me how to focus and prioritize what needed to be done. This became essential as I entered one of the most demanding phases of my life.</p>
<p>In addition, I used Notion as a management system and Google Calendar as a schedule system.</p>
<p>Every week, I transferred next week's tasks from Google Calendar to Notion. This way, I never forgot anything and never worried about forgetting anything.</p>
<p>I had two simple scalable systems that worked very well for managing everything I did.</p>
<p>In the scheduling system, I would place certain events on repeat, for example:</p>
<ol>
<li><p>Every week:</p>
<ul>
<li>Read the top articles of the week on Subreddits dedicated to programming and others topics so I could keep learning and growing. Same with communities on Stack Exchange Network.</li>
</ul>
</li>
</ol>
<ul>
<li>Read new articles on IEEE Spectrum and learn as much as possible about what is happening currently.</li>
</ul>
<ol start="2">
<li><p>Every two weeks:</p>
<ul>
<li>Plan my studying according to time available, as well as all class and other resources I could get for tests, projects, and exams.</li>
</ul>
</li>
<li><p>Every month:</p>
<ul>
<li>Review my annual objectives and prioritize what was important and urgent to do in that month. Also, review new opportunities that appeared that aligned with my objectives this year and in my life.</li>
</ul>
</li>
</ol>
<p>This way, I was always aligned and efficient. And all this was from a Notion database.</p>
<p>Very often, I started working at 8:00am and continued until around 9:00 or 10:30am, when my classes often started. At that time, I studied, did student organization work, completed online courses and specializations, worked on AI projects, wrote freeCodeCamp articles, and many tasks.</p>
<p>I went beyond studying just the subjects from my degree:</p>
<ul>
<li><p>I also studied history, economics, and geopolitics to understand the hidden incentives that shape the world.</p>
</li>
<li><p>I developed the habit of studying the architecture of things, from political systems to technology, understanding how they work to design better systems.</p>
</li>
<li><p>I attended many free online and university events to learn as much as possible.</p>
</li>
</ul>
<p>I also treated weekends as opportunities to grow and work, and did not stop. This was not possible 100% of the time, but most days I was able to do so.</p>
<p>In this way, I completed Coursera’s prestigious Deep Learning Specialization, a very important achievement in my journey.</p>
<p>I also read many books and listened to podcasts while taking public transportation, ensuring that no time was wasted.</p>
<h2 id="heading-my-projects-while-in-nova-fct-ai-projects-international-student-organizations-and-freecodecamp-articles">My Projects While in NOVA FCT: AI Projects, International Student Organizations, and freeCodeCamp Articles</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743422159743/81944517-ee5d-4cd3-a84a-fd9726391175.jpeg" alt="81944517-ee5d-4cd3-a84a-fd9726391175" class="image--center mx-auto" width="2016" height="1512" loading="lazy"></p>
<p>Me at 21 years old.</p>
<blockquote>
<p><em>"The strength of the team is each individual member. The strength of each member is the team."</em><br>— Phil Jackson</p>
</blockquote>
<p>International student organizations often offer opportunities that are rarely found in local college clubs.</p>
<p>These student organizations are also often better managed than some local clubs, which can sometimes suffer from internal politics focused on titles rather than making a real contribution to society.</p>
<p>For this reason, I sought international organizations that pushed members towards real impact and development.</p>
<p>After a while, I became interested in BEST (Board of Engineering Students of Technology), a large international organization of student organizations spread over 80 groups around European universities. I joined the local group, BEST Almada, one of the 80 local BEST groups across Europe that helps foster the development of students through courses and events.</p>
<p>I also became deeply involved in the IEEE, the world’s largest non-profit professional association, where I served as the Vice-Chair of the IEEE NOVA Student Branch. Currently, I contribute nationally in the IEEE Portugal Section by creating videos for social media.</p>
<p>Thanks to IEEE, I was able to go to the IEEE Melecon conference in Porto last year to speak with some amazing scientists and researchers.</p>
<p>Here’s a key thing I learned from IEEE that I want to share: Communication, alignment of expectations between everybody, and knowing how to navigate social dynamics is crucial for any project or initiative to succeed. Of course, the culture of the organization and a lot of other variables are important as well. But I believe communication is one of the most important and critical factors.</p>
<p>Along this path, I worked on projects like Eurostatify AI, which aimed to provide European public data insights and hidden patterns that are accessible to researchers and policymakers. I also led the Doctor AI Project as part of a Hackathon in March 2023, where I developed two AI bots using Flutter and the ChatGPT API to help doctors make better decisions.</p>
<p>Each step helped me forge myself into someone capable of inspiring and leading others. I also taught complex topics in my freeCodeCamp articles, such as how CPUs work in depth, interpretable AI, quantum AI, and even how to design a control system for rockets.</p>
<p>I was involved in local student clubs before I realized the value of joining international organizations. In Europe, these organizations bring unique opportunities, are usually better managed than local groups. They’re a great place for developing soft skills as well.</p>
<p>So in the end, joining international student organizations was one of the best decisions of my university life.</p>
<h2 id="heading-my-personal-philosophy-at-21-years-old-and-view-on-envy-and-negativity">My Personal Philosophy at 21 Years Old and View on Envy and Negativity</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743425739851/135f7a2a-edab-48a4-91ee-e8aa3ed8c416.jpeg" alt="135f7a2a-edab-48a4-91ee-e8aa3ed8c416" class="image--center mx-auto" width="5953" height="3969" loading="lazy"></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@giamboscaro?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Giammarco Boscaro</a> <a target="_blank" href="https://unsplash.com/@giamboscaro?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">on Unsplash</a></p>
<blockquote>
<p><em>"Freedom lies in being bold."</em><br>— Robert Frost</p>
</blockquote>
<p>Here’s one thing I’ve learned over the years: You need to make your own path. Chasing social status and falling prey to social pressures isn’t worth it, and you shouldn’t be blinded by these things. True freedom comes from defining your own path. Developing relationships with professors and mentors, learning from books, and taking advantage of solid free learning resource are all things that can help you go further in life.</p>
<p>But what about envy and negativity from others?</p>
<p>Well, unfortunately these will always be part of our lives. Being envious is human nature, and various forms of negativity will likely continue to exist. Anyone who works and achieves any level of success will inevitably attract envy and negativity.</p>
<p>The best response is not to react and to ignore it completely. Just keep growing.</p>
<p>Some people will disappear, mock you, envy you, or hate you – but just try to let it all go. Keep walking your path.</p>
<p>Time is precious. Don’t waste it on:</p>
<ul>
<li><p>Meaningless opinions</p>
</li>
<li><p>Video games</p>
</li>
<li><p>Distractions</p>
</li>
</ul>
<p>I find it sad that, despite living in such an exciting time, and despite unprecedented access to knowledge and education, advances in technology, and immense global connectivity, some people still choose to hate and be envious of others. But as I said before, it’s human nature and there is little we can do about it.</p>
<p>Just remember: you have opportunities today that previous generations could only dream of. Take advantage of them to the fullest and worry about your own personal growth.</p>
<h2 id="heading-where-i-am-today-a-fraction-of-what-i-have-achieved">Where I am Today: A Fraction of What I Have Achieved</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743428837578/9f5359be-4cca-4840-b74c-ca78b44b8672.jpeg" alt="9f5359be-4cca-4840-b74c-ca78b44b8672" class="image--center mx-auto" width="1537" height="1533" loading="lazy"></p>
<p>Me in a Tesla factory in Silicon Valley</p>
<blockquote>
<p><em>"I am not a product of my circumstances. I am a product of my decisions."</em><br>— Stephen R. Covey</p>
</blockquote>
<p>At 21, I am finishing my degree in Electrical and Computer Engineering at NOVA FCT.</p>
<p>So far:</p>
<ul>
<li><p>I’ve been accepted into the Silicon Valley Fellowship Program: Only 18 out of 600 are accepted to visit Silicon Valley's top companies and universities.</p>
</li>
<li><p>I’ve delivered a talk to doctors about AI called "Trustworthy AI - The Role of Small AI Models in Critical Systems.". Before this, I delivered other smaller talks.</p>
</li>
<li><p>I’ve completed Coursera AI specializations such as the Deep Learning Specialization from DeepLearning.AI and Reinforcement Learning Specialization from the University of Alberta.</p>
</li>
<li><p>In IEEE (the largest non-profit professional association in the world), I served as the vice chair of my faculty IEEE NOVA SB student branch, and I am now an IEEE PT Officer, creating videos for social media.</p>
</li>
<li><p>I’ve had twenty articles published on freeCodeCamp since 2023 that have accumulated around 200,000 views. They are related to advanced applied math, AI, and technology. (Link below)</p>
</li>
<li><p>I’ve been recognized as a Top Open Source Contributor for freeCodeCamp in 2022, 2023, and 2024</p>
</li>
</ul>
<h2 id="heading-final-thoughts-have-an-adaptive-grand-strategy-for-your-life">Final Thoughts: Have an Adaptive Grand Strategy for Your Life</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743421784759/80ba16f2-fef7-4a4d-82b9-9287d7b43e53.jpeg" alt="80ba16f2-fef7-4a4d-82b9-9287d7b43e53" class="image--center mx-auto" width="1080" height="1293" loading="lazy"></p>
<p>Silicon Valley Fellowship post about me</p>
<blockquote>
<p><em>"What you do makes a difference, and you have to decide what kind of difference you want to make."</em><br>— Jane Goodall</p>
</blockquote>
<p>My life objective was and still the same when I was 14, 7 years ago:</p>
<ul>
<li>Help as many people as possible. In their opportunities to make their life’s better and in making society better for future generations that will come after mine.</li>
</ul>
<p><strong>My strongest advice for anyone: Have a grand strategy for your life.</strong></p>
<p>A grand strategy is a type of long-term strategy in which nations align power and resources to achieve their objectives. You must align your actions, skills, and knowledge towards your purpose.</p>
<p>I used to be afraid of public speaking and so many other things. Not anymore.</p>
<p>Now, I know I am destined to contribute, inspire, and leave a mark on other people's lives for the better.</p>
<p>If you feel stuck, remember:</p>
<ul>
<li><p>You can change! It will be hard. Many people will not want it.</p>
</li>
<li><p>Ignore all that and focus on yourself.</p>
</li>
</ul>
<p>It takes effort, patience and courage, but it is possible.</p>
<p><strong>Thanks to all organizations for the opportunity to contribute to society and grow as a person:</strong></p>
<ul>
<li><p>NOVA School of Science and Technology and its student association, AEFCT</p>
</li>
<li><p>IEEE Portugal Section</p>
</li>
<li><p>Silicon Valley Fellowship</p>
</li>
<li><p>BEST and BEST Almada</p>
</li>
<li><p>Magma Studio</p>
</li>
</ul>
<p>I also want to thank all the university professors at NOVA FCT who taught me, especially the ones from the department of electrical and computer engineering.</p>
<p>Finally, I want to express my gratitude to Portuguese society. Not long ago, in Portugal, pursuing higher education, especially in STEM, was inaccessible to many. Thanks to the efforts of past generations, today, young people like me can pursue these opportunities and contribute back to society.</p>
<p><strong>This is just the beginning of my impact on society.</strong></p>
<p>My FreeCodeCamp blog:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.freecodecamp.org/news/author/tiagomonteiro/">https://www.freecodecamp.org/news/author/tiagomonteiro/</a></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Make Flowcharts and Bring Joy to your Coding ]]>
                </title>
                <description>
                    <![CDATA[ Coding can be intense. Especially when you are knee-deep in debugging or trying to map complex projects. For many developers — novice and pros alike — it is not uncommon to spend hours staring at code, looking for answers that won’t come. You may hav... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-make-flowcharts-with-mermaid/</link>
                <guid isPermaLink="false">67852099c122b063bd5743eb</guid>
                
                    <category>
                        <![CDATA[ flow diagrams ]]>
                    </category>
                
                    <category>
                        <![CDATA[ coding tips ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Learning Journey ]]>
                    </category>
                
                    <category>
                        <![CDATA[ learning to code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ effective coding ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ evaristo.c ]]>
                </dc:creator>
                <pubDate>Mon, 13 Jan 2025 14:18:01 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736777856399/98a5d535-280e-4496-b0fb-67ad5a1b401d.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Coding can be intense. Especially when you are knee-deep in debugging or trying to map complex projects. For many developers — novice and pros alike — it is not uncommon to spend hours staring at code, looking for answers that won’t come.</p>
<p>You may have tried every trick you know but still feel lost. But have you tried creating a visual representation of the problem so you can see how the code actually works?</p>
<p>I’m talking about using a <strong>flowchart</strong>.</p>
<p>In this article, you’ll learn how flowcharts work along with some common symbols and labels you can use in your flowcharts. We’ll also discuss some popular diagramming tools you can use to create flowcharts more easily. Finally, we’ll walk through how to actually build a flowchart so you can start using them in your projects.</p>
<h3 id="heading-table-of-contents">Table of Contents</h3>
<ul>
<li><p><a class="post-section-overview" href="#heading-what-is-a-flowchart">What is a Flowchart?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-a-flowcharts-symbology-the-limitations-of-symbols-and-solutions">A Flowchart’s Symbology, the Limitations of Symbols, and Solutions</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-common-symbols-and-labels-used-in-flowcharts">Common Symbols and Labels Used in Flowcharts</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-add-shapes-to-your-flowchart-generalization-vs-refinement">How to Add Shapes to Your Flowchart: Generalization vs Refinement</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-popular-diagramming-tools-for-creating-flowcharts">Popular Diagramming Tools for Creating Flowcharts</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-build-a-flowchart-methodology-and-example">How to Build a Flowchart – Methodology and Example</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-what-is-a-flowchart">What is a Flowchart?</h2>
<p>Simply put, a flowchart is a diagrammatic representation of an algorithm. It’s called a <em>flow</em>chart because it not only represents the steps but also depicts the direction the “job” flows as tasks are transferred to the next entity.</p>
<p>In many cases, a flowchart is considered part of a larger family of diagrams, usually referred to as <strong>flow diagrams</strong>. And although both names are commonly used, we’ll stick to the use of flowcharts to represent algorithms for now.</p>
<p>Here’s an example of a flowchart:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732568840505/37302d26-7815-468c-86cf-45fbae2e843a.webp" alt="An example of a flow diagram from https://www.visual-paradigm.com/tutorials/flowchart-tutorial/" class="image--center mx-auto" width="731" height="499" loading="lazy"></p>
<p>You’ll notice that it uses certain different shapes and colors – we’ll discuss these further below.</p>
<h3 id="heading-how-common-are-flowcharts-these-days">How Common Are Flowcharts These Days?</h3>
<p>“<em>Aren’t they from the time of, like, Cobol?</em>” you might ask. Well, yes they are – and from even before that. Flow diagrams were quite popular from their introduction in the 1920’s all the way to the 1970’s. But their use started to fall off soon after that.</p>
<p>So you might wonder: are developers actually using flowcharts – or any kind of diagram – nowadays? I did some quick research across different developer community chats. I found that while not all devs say they use flowcharts, many of them mentioned that they were important in helping them <em>sketch a vizualization</em> of the code or the system.</p>
<p>I also found that senior developers were less interested in the use of diagrams because they usually knew the algorithms or the codebase almost by heart. But newer developers who were exposed to a codebase for the first time, revisiting a forgotten algorithm, or those needing to share some code with others tended to use flowcharts more often.</p>
<h3 id="heading-why-do-devs-use-flowcharts">Why Do Devs Use Flowcharts?</h3>
<p>Here are some of the most common reasons developers use flowcharts these days:</p>
<ul>
<li><p><strong>Focus</strong>: A visual resource to help you think about a problem.</p>
</li>
<li><p><strong>Planning</strong>: Map out your steps before diving in.</p>
</li>
<li><p><strong>Sharing standard processes</strong>: As a tool to facilitate the reading of standard processes.</p>
</li>
<li><p><strong>Communicating and teaching</strong>: Explaining your code to both technical and non-technical people.</p>
</li>
<li><p><strong>Documenting</strong>: Keep track of your work in a way that’s easy to follow.</p>
</li>
<li><p><strong>Analysing existing code</strong>: Break down your code and others’ to see what’s really going on.</p>
</li>
</ul>
<p>Of course, there are other methods you could use to cope with the situations listed above. But there are advantages to using flowcharts over other methods that have to do with the way we process information in our brain.</p>
<p>Still, making flowcharts is an intellectual process that entails some risks, particularly when it comes to clarifying information. So we need the right tools and a methodology to work with them.</p>
<p>In the following sections, we will go through all those points in more detail:</p>
<ul>
<li><p>The semiotic of the flowchart – that is, the use of symbols to convey information. We’ll also discuss the role of the flowchart as an information tool, its limitations, and how to address them.</p>
</li>
<li><p>The most common symbols, their meanings, and how to use them</p>
</li>
<li><p>The intellectual processes of constructing flowcharts and their risks</p>
</li>
<li><p>A methodology to help you reduce those risks</p>
</li>
<li><p>The available tools to create flowcharts with a quick introduction to the one we will use for our examples</p>
</li>
</ul>
<h2 id="heading-a-flowcharts-symbology-the-limitations-of-symbols-and-solutions">A Flowchart’s Symbology, the Limitations of Symbols, and Solutions</h2>
<p>Earlier, I defined a flowchart as a diagram of sequences of steps, or <strong>workflow</strong>, of an algorithm. But we can also understand the flowchart as a “language”: when using a flowchart, we are translating the description of an algorithm from a verbal / textual language to a more symbolic one.</p>
<p>In other words, we can define a flowchart as a visualization of a streamlined workflow where we identify steps and relations by substituting meaningful symbols for verbal / textual descriptions.</p>
<h3 id="heading-how-symbols-work">How Symbols Work</h3>
<p>What are the advantages of using a visualization based on symbols to understand an algorithm?</p>
<p>Physically, our brain has to make more of an effort to extract meaning from either text or numbers than it does from visual attributes and shapes. For example, after some learning and under the relevant context, it is easy to get the meaning of this street sign:</p>
<p><img src="https://media-studies.com/wp-content/uploads/2021/07/barthes-road-sign-268x225.jpg" alt="children crossing road sign from https://media-studies.com/triadic-model-semiotics/" class="image--center mx-auto" width="268" height="225" loading="lazy"></p>
<p>This sign may work better than writing a board explaining that drivers should be careful as there are kids crossing the road.</p>
<p>In our example, if you have to pause to read the explanatory board, by the time you learn what the message is it could be too late. But our brain makes a faster evaluation of the situation when presented with the sign after some training.</p>
<p>Also, visual attributes and shapes can not only refer to concrete, tangible objects, but also to <em>concepts and actions</em>. For example, if you have done arithmetics before, you’ll know the meaning of the following symbols:</p>
<p><img src="https://b2990823.smushcdn.com/2990823/wp-content/uploads/2021/11/86-860869_math-math-symbol-math-clip-art-1-300x251.png?lossy=1&amp;strip=1&amp;webp=1" alt="Math arithmetic operators like multiplication, subtraction, division, and so on (Image from https://onlinemathcenter.com/blog/math/math-symbols-and-their-meanings-part-i-arithmetic-operators/)" class="image--center mx-auto" width="300" height="251" loading="lazy"></p>
<p>When we use a symbol to convey meaning, whether concrete or intangible, we usually talk about <a target="_blank" href="https://en.wikipedia.org/wiki/Semiosis"><strong>semiosis</strong></a>. Semiosis is the process of producing and interpreting signs and symbols to convey meaning. It involves the interaction between a symbol, its meaning, and the person or machine interpreting it. This process is central to the communication, understanding, and creation of knowledge in both people and machines.</p>
<p>Symbolic communication takes advantage of our innate visual processing skills. This helps reduce the need for long-winded explanations because the observer has learned somehow what the sign means. Instead of “semiosis”, some people prefer the term <strong>abstraction</strong> to refer to the same process.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736344070987/cede4eac-ca8c-4fa9-9a76-280d08f655d7.png" alt="Model of Semiotics Theory, from https://opentext.wsu.edu/theoreticalmodelsforteachingandresearch/chapter/semiotic-theory/" class="image--center mx-auto" width="643" height="356" loading="lazy"></p>
<p>That it is what we do with flowcharts: abstracting meanings through symbols.</p>
<p>The value of semiotics in a visualization is substantial. Using meaningful symbols in a visualization such as a flowchart allows you and your audience to <em>focus on patterns</em> that written text, such as code or a script, can’t easily tell or describe.</p>
<p>And that is where the power of visualizations like flowcharts resides.</p>
<p>But flowchart symbols are not operators like you’d find in mathematics. Rather, they’re <em>representations.</em> In fact, they might represent something <em>specific to the person who draws them</em>.</p>
<p>Because of this, the symbols alone are often insufficient to fully convey abstract concepts. For example, the term "database” can represent many types of systems or technologies, and can have many different setups and uses. Also, as technology evolves, some symbols may lose their relevance.</p>
<p>To address this, clear textual explanations should accompany the shapes, ensuring the flowchart remains meaningful and avoids vagueness. You can also add styling and even images to strengthen the symbols’ meaning.</p>
<h2 id="heading-common-symbols-and-labels-used-in-flowcharts">Common Symbols and Labels Used in Flowcharts</h2>
<p>When creating a flowchart, you can use custom symbols, but it’s typically a good idea to stick to certain conventions. Conventions ensure better communication as well as consistency of messaging across different flowcharts.</p>
<p>The <a target="_blank" href="https://the9000store.com/articles/iso-9000-tips-iso-9001-flowchart-basics/">ANSI/ISO standards</a> list more than 30 recognized flowchart <strong>shapes</strong>, though their usage isn’t strictly regulated. This allows vendors and developers to agree on best practices.</p>
<p>Since these symbols require textual and styling support anyway, some devs argue that you can reduce the number of shapes to a “necessary few” versatile symbols instead. I refer to these as "wildcards”. Wildcards can represent broader abstractions when paired with clear text and or styling. But don’t hesitate to use other standard symbols if you think that they bring more clarity to your flowchart.</p>
<p>For our example, we will focus on the most common shapes. Some of the most common and most versatile shapes are:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733765176295/06d45bcd-38c1-4c88-854d-c91bdb7e0a7c.jpeg" alt="Main flowchart shapes table. Image from https://www.smartdraw.com/flowchart/flowchart-symbols.htm" class="image--center mx-auto" width="700" height="454" loading="lazy"></p>
<p>As you can see in the table above, we have the following shapes:</p>
<ul>
<li><p>Oval (a start or end point)</p>
</li>
<li><p>Arrow (a connector that shows relationships between shapes)</p>
</li>
<li><p>Parallelogram (an input or output)</p>
</li>
<li><p>Rectangle (a process)</p>
</li>
<li><p>Diamond (a decision)</p>
</li>
</ul>
<p>Let’s go through each of these now and examine how they work and how to use them.</p>
<h3 id="heading-the-terminator-oval-shape">The Terminator (Oval) Shape</h3>
<p>This is the oval shape, called the start/end shape. It marks the starting and ending points of the process/system. The oval indicates the beginning or end result of the workflow, and the potential outcomes of a path.</p>
<p>Many devs use the oval shape, along with the words “start” and “end/stop/finish” for clarity.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736344293041/43e89861-4443-4335-9b56-8db1f35955a1.jpeg" alt="Start and Stop points using ovals" class="image--center mx-auto" width="1105" height="352" loading="lazy"></p>
<p>Some people prefer to use a single circle to represent the start and a double circle to represent the end of a flowchart:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736354321682/7d3639b1-bba8-4708-9d3b-2ea401d20973.jpeg" alt="Start and End points using circles" class="image--center mx-auto" width="1086" height="613" loading="lazy"></p>
<p>I personally prefer the circle – but it’s up to you. Just make sure you pick one and stick with it for consistency.</p>
<h3 id="heading-the-arrow-or-flowline-shape">The Arrow or Flowline Shape</h3>
<p>Also called the link or the edge by vendors and practitioners, this shape represents the connection between two steps. Also depending on its shape, it might indicate if that flow is broken, failed, or if it is an alternate path or process, and more.</p>
<p>The most common representation is the <strong>arrow</strong>, which indicates the direction of the workflow between two steps. The arrow points in the direction of the next step in the process.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736354396382/0f2d6f70-3f8c-426f-8231-fab1f3db599e.jpeg" alt="Flowline as arrow shape" class="image--center mx-auto" width="457" height="130" loading="lazy"></p>
<p>When working with flowcharts, I accompany arrow flowlines and any other flowline with concise descriptions about the next step, sometimes with information about variables and, when it makes sense, the current state.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736354505571/78beea08-63bb-4149-952a-960c4a7756f1.jpeg" alt="An arrow shape with labelling" class="image--center mx-auto" width="837" height="317" loading="lazy"></p>
<h3 id="heading-the-process-rectangle-shape">The Process (Rectangle) Shape</h3>
<p>You can represent a process using a rectangle in a flowchart. It’s also referred to as a box:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736355468300/d159a2b0-92fa-4df2-abaa-4402953208a5.jpeg" alt="Process shape" class="image--center mx-auto" width="1068" height="567" loading="lazy"></p>
<p>A box can represent a <strong>single step</strong>, like an expression (for example, <code>x = y*x²</code>), a <strong>entire block statement</strong>, like “<code>loop through array and update values by multiplying by 2</code>”, or an <strong>entire sub-process</strong>, like an existing function or even a module.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736355653833/3d88a287-7966-45ef-9a65-460422d4c2f9.jpeg" alt="Process shapes with different labels" class="image--center mx-auto" width="681" height="641" loading="lazy"></p>
<p>The process shape is a proper wildcard and it can morph into many things, so it’s important to add a label to it and using text or other resources like formatting to clarify its meaning.</p>
<h3 id="heading-the-decision-diamond-shape">The Decision (Diamond) Shape</h3>
<p>The decision is represented by a diamond. It is an abstraction for a <strong>condition’s test</strong>, a YES/NO, or TRUE/FALSE question. It is the equivalent of an IF/ELSE statement in coding.</p>
<p>The text accompanying this shape is a question formulating a comparison between an entering value and a control value. The flowchart usually splits into different branches depending on the answer or consequences after you use the decision shape:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736355725641/90042033-abc1-42a2-9c06-883d8f09e686.jpeg" alt="Decision shape with two branches" class="image--center mx-auto" width="905" height="620" loading="lazy"></p>
<p>The result of the decision box determines the next step in the process workflow. It’s usually declared to only answer a simple question, but you can abstract the question so it looks similar to an IF/ELSE IF/ … /ELSE control statement in coding, with lines representing different decisions.</p>
<p>When one of the flows returns to the decision shape from where it left, we are talking about <strong>a loop</strong>:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736355864209/0f4b5cb4-b81c-482c-8d22-74854bf28d64.jpeg" alt="Decision shape with two branches, one of them in a loop" class="image--center mx-auto" width="1075" height="636" loading="lazy"></p>
<p>The interpretation is like asking to test the condition again after going through some steps along a specific workflow branch, then checking if the answer has changed.</p>
<h3 id="heading-the-inputoutput-parallelogram-shape">The Input/Output (Parallelogram) Shape</h3>
<p>You can use the parallelogram shape as an abstraction for data that’s available for input or output or for resources used or generated. It indicates that some information is required at this point in the workflow.</p>
<p>The input/output shape is typically accompanied by the following text:</p>
<ul>
<li><p>Either “input” or “output”, so you know which is being represented. You can also write other similar words like “get” / “put”, “in” / “out”, and so on.</p>
</li>
<li><p>An input or an output could be related to a variable that you are planning or you already have in your code. If that variable should have an expected type when either entering as input or output, I would also add the type.</p>
</li>
<li><p>Its corresponding state, as long as it provides more clarity to the flowchart.</p>
</li>
<li><p>Optionally, it would be also useful to mention the source of the input / output. Is it a dataset? A manual entry? A form? Will it be printed in the console?</p>
</li>
</ul>
<p>Notice that the whole point of the use of this shape is to trace the entry or the exit of data into or out of the process. Therefore, this shape is valuable when you want to have at least an idea of data exchange.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736355986275/e19e64b8-0b85-4ee8-aff7-333b1d0fd6e5.jpeg" alt="Input / Output shape with label" class="image--center mx-auto" width="1070" height="270" loading="lazy"></p>
<p>Finally, a less common symbol, but one that I use often is…</p>
<h3 id="heading-the-preparation-hexagon-symbol">The Preparation (Hexagon) Symbol</h3>
<p>The preparation symbol is represented by an hexagon and it abstracts the setup for the following step. I usually use this shape to declare all the initial conditions when the workflow begins. I accompany this shape with a list of variables, their types, and even functions or initial event settings, like event listeners, together with their initial values.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736356077330/05e0e186-ddf8-40e7-bfc5-ea859e7d86ae.jpeg" alt="Preparation shape with label" class="image--center mx-auto" width="1087" height="617" loading="lazy"></p>
<h2 id="heading-how-to-add-shapes-to-your-flowchart-generalization-vs-refinement">How to Add Shapes to Your Flowchart: Generalization vs Refinement</h2>
<p>Now that you understand the basics of the symbols, you may be wondering how to insert them into the diagram.</p>
<p>Especially for large diagrams, you’ll want to be very intentional about adding shapes. You’ll need to make careful decisions about placing and the number of shapes you’ll use, otherwise your flowchart could become unreadable.</p>
<p>You’ll need to make decisions about things like:</p>
<ul>
<li><p>where to place the shapes so it results in a tidy flowchart.</p>
</li>
<li><p>which of those shapes are essential to the understanding of the workflow, and which are not.</p>
</li>
</ul>
<p>Placing is perhaps the most difficult task of making a flowchart. If you are manually constructing your flowchart, unfortunately there’s not a simple formula that instructs you where to place the shapes in order to prevent overlapping. It’s up to you to visually resolve the placement and to decide when any overlap makes your diagram unreadable.</p>
<p>As you’ll see later, there are computationally-based solutions for the placing of shapes. But there is a simple rule that applies to all cases: the smaller the flowchart, the easier it is to place the shapes. So reducing the number of shapes and only including the key shapes is key to creating a clear flowchart.</p>
<p>Keep in mind that I’m not suggesting that you try to create the most minimalistic flowchart you can. Just that you try to make the simplest one that conveys enough information to help you understand the workflow.</p>
<h3 id="heading-how-to-choose-which-shapes-to-use">How to Choose Which Shapes to Use</h3>
<p>Deciding which shapes to use can turn into an iterative process of adding, moving, or removing text or symbols into or out of the flowchart.</p>
<p>There are two competing tendencies here: <strong>generalization</strong> and <strong>refinement</strong>.</p>
<p>For example, the next figure shows three different flowcharts that demonstrate how to use a coffee machine:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736368833320/b2e7ad79-8726-4e2d-b114-e0c36520044c.jpeg" alt="Three levels of generalization / refinement of flowcharts of how to use a coffee machine" class="image--center mx-auto" width="1282" height="1461" loading="lazy"></p>
<p>In the image above, you can see that the example on the left is the one with less explanations and fewer shapes, while the one on the right has more details.</p>
<p>In the same way, depending on your needs and the specific details you want to get out of the visualization, the flowchart can be more generalized or it can be more refined. In fact, it might acquire some elements of subjectivity, which usually rely on the <strong>amount of information and knowledge</strong> you have about the process <strong>before</strong> looking at the flowchart.</p>
<h4 id="heading-generalization">Generalization:</h4>
<p>In the case of flowcharts, <strong>generalization</strong>, also known as <em>lifting</em>, is when you enclose several steps into a few words and / or symbols. There are two reasons to use a more generalized approach:</p>
<ol>
<li><p>You and your audience are competent enough to complete the information not provided by the flowchart.</p>
</li>
<li><p>You and your audience don’t know much about that specific step.</p>
</li>
</ol>
<p>In the second case, there are two situations you might be dealing with:</p>
<ol>
<li><p>Even if you don’t know much about that part of the process, you can keep that step generalized because that step plays a small role in providing information that’s essential to you. Or,</p>
</li>
<li><p>The point is critical for you to understand the process, but you and your audience simply don’t know more.</p>
</li>
</ol>
<p>It’s in the second situation when you have to try to “open the box”. And this is done through refinement.</p>
<h4 id="heading-refinement">Refinement:</h4>
<p><strong>Refinement</strong> consists of adding more steps and more words and symbols in order to add more detail to a procedure. It usually follows researching and studying.</p>
<p>When you’re refining your flowchart, this doesn’t necessarily mean that you know absolutely nothing about the procedure. What you’re looking for is something that allows you to point to specific details, and what comes before and what comes next.</p>
<p>But how much generalization is helpful? And how much refinement?</p>
<p>When your flowchart is too general, it results in a simpler visualization but it doesn’t contain much information. You might have to use more words or rely on inner knowledge in order to explain what the chart or a step means. The first flowchart in the previous image is the most generalized of all of them.</p>
<p>The risk of over-generalization is <em>non-information</em>.</p>
<p>The process of refinement involves the opposite risk, and is, in my view, more dangerous. If you don’t control the refinement process, you might end up with an absolute mess, like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732788718770/657328f7-93b2-40a3-839f-f87bd47c9e76.jpeg" alt="A very messy and overly complex diagram" class="image--center mx-auto" width="1600" height="853" loading="lazy"></p>
<p>The above diagram isn’t a flowchart, but the risk is the same. The risk of excessive refinement is <em>noise</em>.</p>
<p>There are several rules and mechanisms that help you prevent reaching an unnecessary level of either refinement or abstraction. This is what we are going to learn in the next sections. But first, let’s take a quick look at the available tools you can use to make diagrams and flowcharts.</p>
<h2 id="heading-popular-diagramming-tools-for-creating-flowcharts">Popular Diagramming Tools for Creating Flowcharts</h2>
<p>Now that you know the shapes, what they are for, and have some idea about how to use them, you can start building a flowchart.</p>
<p>But before doing so, I’m going to make a short detour to talk about the tools you can use to build flowcharts.</p>
<p>Nowadays, the options are many. You can use online as well as offline resources. Some are specialized for building diagrams, while others are more general. Some you can access for free, and others are more for enterprise operations and come with high fees.</p>
<p>Below, you’ll find a quick table categorizing some of the dedicated tools I have used in the past or that I have been investigating recently.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Dedicated Solutions for Drawing Flowcharts</strong></td></tr>
</thead>
<tbody>
<tr>
<td></td></tr>
</tbody>
</table>
</div><div class="hn-table">
<table>
<thead>
<tr>
<td>CATEGORY</td><td>HOW</td><td>EXAMPLES (free)</td></tr>
</thead>
<tbody>
<tr>
<td>Drag and Drop</td><td>Shapes are manually dragged into a editor screen, linked with connectors and filled with relevant text.</td><td>draw.io</td></tr>
<tr>
<td>Scriptable</td><td>A script is written with a dedicated syntax for shapes, relationships, and text. The flowchart is automatically rendered and updated after changing the script.</td><td>Mermaid, PlantUML</td></tr>
<tr>
<td>AI-based</td><td>A descriptive prompt or even code is provided to the AI. The AI analyzes the content, usually recoding into a scriptable diagram before rendering it.</td><td>codetoflow.ai, ChatGPT plugins</td></tr>
<tr>
<td>Parser</td><td>Map (binary) code into dedicated graphical solutions based on established syntax rules.</td><td>drgarbagetools for Java in Eclipse, graphdracula for JQuery</td></tr>
</tbody>
</table>
</div><h4 id="heading-no-code-or-low-code-tools">No-code or low code tools:</h4>
<p>The large majority of the existing specialized diagramming tools are designed to help people without coding skills.</p>
<p>When using these types of tools, you have to manually construct the diagram by <strong>dragging-and-dropping</strong> shapes into an (online) editor: you select the shape and move it around until you find your preferred place for it on the screen. There are functionalities to draw the flowlines (“connectors”) also by a dragging action, and you can always edit the shapes to add text or styling.</p>
<h4 id="heading-script-based-tools">Script-based tools:</h4>
<p>But there are also some less well-known tools that have been around for a while that are rising in popularity now: the <strong>script-based</strong> options. With these kinds of tools, you describe the shapes and relationships by scripting them according to the syntax of the tool.</p>
<p>These kinds of tools have the relative advantage that the diagram will be drawn for you on a rendering screen or image. An algorithm will try to find the best place for your shapes on the screen without you having to place them manually.</p>
<h4 id="heading-ai-tools">AI tools:</h4>
<p>Then there are the <strong>AI</strong> tools. Many of those tools are based on the scripting tools. Some of them work as follows:</p>
<ol>
<li><p>the AI interprets either a descriptive prompt or the code itself</p>
</li>
<li><p>Then it translates the prompt into a script using a scriptable diagramming tool</p>
</li>
<li><p>The diagram renders according to the AI-generated code.</p>
</li>
</ol>
<p>I’ve found that these AI tools are still not quite up to the task for more complex projects – but they can come handy if you just want a quick solution. One that I have used is codetoflow.io, but there are also (guess what…) ChatGPT plugins you can use.</p>
<h4 id="heading-parsers">Parsers</h4>
<p>Even before the AI tools came around, there were the parsers. They map steps and relationships into shapes based on well-established syntax rules. Some of those parsers are turning to AI instead, as the AI generators are easier to program and require less maintenance. But sometimes the rule-based parsers can be more precise if the rules they are based on remain without changes.</p>
<p>Some of those tools read on binary code, which is a better proxy to follow the full workflow, something that popular AI tools are not capable of. Some IDEs, like Eclipse, allow you to add plugins to draw a flowchart of your code based on binaries. One example is <a target="_blank" href="https://sourceforge.net/projects/drgarbagetools/">drgarbagetools</a> which works only for Java in Eclipse.</p>
<h4 id="heading-general-purpose-tools">General-purpose tools:</h4>
<p>Apart from those dedicated tools, you can always use others that are not specifically built for diagramming. I have used PowerPoint and Google Slides in the past, and there are other presentation applications that support the ANSI / ISO shapes’ catalogue. You can also use tools like Figma, Miro, or others. There are too many others to list here.</p>
<p>And finally, there is always pen a paper.</p>
<h3 id="heading-our-example-using-mermaidjs">Our Example: Using Mermaid.js</h3>
<p>For the example in this tutorial, I’ll be using one of the scripting tools called Mermaid. One reason for using a script-based tool is the ease with which you can update the flowchart along the way. And this will come in handy when we reach the generalization / refinement step.</p>
<p>Although other tools do not hinder the generalization/refinement process, the fact that you might find yourself redoing the whole flowchart manually could become quite time consuming. With a script-based tool, you can focus mostly on writing down the right relationships and shapes, while you let the program place the shapes for you.</p>
<p>Although I’m using Mermaid here, I’m not prescribing the use of any particular tool for the examples ahead. You can use the one that suits your needs and with which you feel the most comfortable. None of them are perfect, and they all have their own merits.</p>
<p>But if you want to learn more about Mermaid, <a target="_blank" href="https://www.freecodecamp.org/news/use-mermaid-javascript-library-to-create-flowcharts">I’ve written another tutorial for you</a> that’ll give you a general overview of the tool and how to use it. I will also provide the syntax I am using to create the examples so you can try it yourself.</p>
<h2 id="heading-how-to-build-a-flowchart-methodology-and-example">How to Build a Flowchart – Methodology and Example</h2>
<p>When building a flowchart, you can follow these steps:</p>
<ol>
<li><p>Define the scope of your flowchart</p>
</li>
<li><p>Find the start of the workflow</p>
</li>
<li><p>Trace the workflow to the end while using high levels of generalization for the steps</p>
</li>
<li><p>Select what should be refined and what can be left generalized</p>
</li>
<li><p>Iterate: Research. Refine. Test. Research. Refine or Generalize. Test. Research. Refine or Generalize…</p>
</li>
<li><p>Enhance</p>
</li>
<li><p>Extend (optional)</p>
</li>
</ol>
<h3 id="heading-step-1-define-the-scope-of-your-flowchart">Step 1: Define the Scope of Your Flowchart</h3>
<p>It’s important to be clear about what you want to do with your flowchart. Is it representing a full codebase or just a fragment of a script? Is it an algorithm that you want to study or is it an analysis of some existing code? Do you want a detailed explanation of a workflow or just look at the relationships?</p>
<p>Having a clear goal for your flowchart will help you guide its construction.</p>
<p>For this example, we are going to use an exercise from freeCodeCamp’s curriculum:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> character = <span class="hljs-string">"#"</span>;
<span class="hljs-keyword">const</span> count = <span class="hljs-number">8</span>;
<span class="hljs-keyword">const</span> rows = [];

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; count; i = i + <span class="hljs-number">1</span>) {
  rows.push(character.repeat(i + <span class="hljs-number">1</span>))
}

<span class="hljs-keyword">let</span> result = <span class="hljs-string">""</span>

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> row <span class="hljs-keyword">of</span> rows) {
  result = result + row + <span class="hljs-string">"\n"</span>;
}

<span class="hljs-built_in">console</span>.log(result);
</code></pre>
<p>Our purpose here is to understand this code, particularly to gain more insights about the for-loops.</p>
<h3 id="heading-step-2-find-the-start-of-the-workflow">Step 2: Find the Start of the Workflow</h3>
<p>Once you have an idea of what you want to do with your flowchart, try to figure out the point from where the workflow begins. If it involves analyzing existing code, bear in mind that the start of the workflow might not be at the start of your target code. Just keep in mind that whatever triggers the whole procedure, that is an indication that the “start” is there.</p>
<p>The workflow usually starts with the setting of the initial declarations and values, so we could say that our flowchart could start like this for this example:</p>
<pre><code class="lang-mermaid">flowchart TD
start((start)) --&gt; |variable declaration| varDeclaration{{"*character*(str) 
                                          *count*(num) 
                                          *rows*(list) 
                                          *result*(str)"}}
varDeclaration -.-&gt; C["..."]
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736356220066/242c2201-6a0f-45b0-802c-fe5b71551291.jpeg" alt="Step 2: finding the start point" class="image--center mx-auto" width="420" height="635" loading="lazy"></p>
<h3 id="heading-step-3-trace-the-workflow-to-the-end-and-use-high-levels-of-generalization-in-each-step">Step 3: Trace the Workflow to the End and Use High Levels of Generalization in Each Step</h3>
<p>Once you’ve found the starting point, try to systematically trace the workflow steps from start to end. If there are procedures along the way, you can compact them into more generalized steps using no more than two shapes.</p>
<p>The most common shape for depicting a generalized step is the <strong>process shape</strong>. Candidates to keep generalized are functions, control statement blocks like loops or if-statements, modules, or even libraries. Labels of those steps should consist of general descriptions of the things that are happening or should happen at that step.</p>
<p>For our example, we can represent our workflow and in particular the for-loops at a general level like this:</p>
<pre><code class="lang-mermaid">flowchart TD
start((start)) --&gt; |variable declaration| varDeclaration{{"*character*(str) 
                                          *count*(num) 
                                          *rows*(list) 
                                          *result*(str)"}}
varDeclaration --&gt;|"Use *character* and *count* to fill the *rows* list through a for-loop with strings"| forloop01["for-loop01 with *count* as control: str.repeat(*character*) --&gt; *rows*.push(str)"]
forloop01 --&gt; |"Use the updated *rows* list to create a new *result* string"| forloop02["for-loop02 along *rows* items: 
*row* --&gt; 
*result* = *result* + *row* + '\n'"]
forloop02 --print output to the console--&gt; consolelog["console.log(*result*)"]
consolelog --&gt; stop(((stop)))
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736358790514/7416bcdf-bbc4-4386-97f7-27bca59e61d8.jpeg" alt="Step 3: finding the end point and adding general steps" class="image--center mx-auto" width="536" height="921" loading="lazy"></p>
<h3 id="heading-step-4-determine-what-requires-refinement-and-what-to-leave-generalized">Step 4: Determine What Requires Refinement and What to Leave Generalized</h3>
<p>Stop for a while and review the schema you’ve created. Once you have a picture of the whole workflow, you’ll want to decide which sections might require more details.</p>
<p>In our case, we’ll refine the parts of the flowchart that deal with the two for-loops. Describing a for-loop is a typical example when learning to create flowcharts, but I also realized that the two for-loops in our exercise are not of the same type. So I thought it would be interesting to see if the flowchart can reveal how they compare.</p>
<h3 id="heading-step-5-time-to-iterate-research-refine-or-generalize-test-repeat">Step 5: Time to Iterate (Research, Refine or Generalize. Test. Repeat.)</h3>
<p>What you’ve prepared up to Step 4 is a general sketch of the workflow. Now it’s time to dig into the areas where more detail is required. During this process, sometimes you’ll find yourself coming back to an abstraction while looking for the clearest way forward with your flowchart.</p>
<p>There are two things that will help you in this process:</p>
<ol>
<li><p><strong>New Shapes</strong>: this is the time when you may want to use some other shapes. Start with the most common ones. Use other shapes as long as you can give them a clear role in your flowchart and they help you reduce a long explanation about what the replaced shape does.</p>
</li>
<li><p><strong>Text</strong>: Extend the use of text to explain the workflow. It should be more specific to the algorithm itself.</p>
</li>
</ol>
<p>This process ends when you are satisfied with the clarity and level of detail of your flowchart. But there are a best practices that allow you to control the process:</p>
<ul>
<li><p>Try to keep everything to a single page.</p>
</li>
<li><p>Keep the number of shapes to around 20 per page.</p>
</li>
<li><p>Avoid line-crossing more than 4 times. Use connectors when that happens. Having to explain 5 or more connections is likely not a good thing.</p>
</li>
</ul>
<p>After any change, test your flowchart. <strong>Testing</strong> is the most subjective aspect of the methodology. There might not be a way to test the flowchart result against a tangible outcome.</p>
<p>If that makes you uncomfortable, try to think in the following way: the flowchart can be seen as a sort of ordered TODO list or brainstorm notes describing what the code or system should do in order to accomplish a desired task.</p>
<p>A flowchart is similar to this TODO list. But instead of writing all those steps as comments or even pseudo-code, you are using (conventional) symbols.</p>
<p>But barring the advances of AI or any use of <a target="_blank" href="https://en.wikipedia.org/wiki/No-code_development_platform">flow-based programming</a>, comments are not code, no matter how detailed they are.</p>
<p>So the decision of whether the flowchart is working or not is left to you and your audience. The most important question to resolve here is: is the information provided by the flowchart enough to understand what you need to understand about the process? Is it revealing something new? Is it helping you organize your ideas more clearly?</p>
<p>If you are still not satisfied, then repeat the process. But don’t feel like you have to stick to this process alone. You can always stop this effort and look for another way to explain your procedures if you find that a flowchart won’t work for you.</p>
<p>You could facilitate the refining and the clarity of the output by doing some additional research. Try to find how other people describe the procedure you are about to work on. Is there something about the language that you should keep in mind? Whenever possible, don’t start from scratch.</p>
<p>Also, try to be faithful as much as possible to the actual way in which the procedure should be coded, especially if you are refining. But don’t forget that it’s a representation. Feel free to work on a draft when not enough information is available.</p>
<p>Let’s go back to our example. I did some quick research to find out how others might interpret a for-loop in a flowchart. I found <a target="_blank" href="https://en.wikipedia.org/wiki/For_loop#/media/File:For_loop_example.svg">this reference useful</a> to guide my own description:</p>
<p><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/For_loop_example.svg/220px-For_loop_example.svg.png" alt="220px-For_loop_example.svg" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>This approach seems to be fairly standard and I will try to include some of those steps in my flowchart. I also found that according to JavaScript documentation, the kind of for-loop we are about to represent repeats <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration">until a specified condition evaluates to false</a>, just like in the flowchart above.</p>
<p>Let’s start by working on the first for-loop only:</p>
<pre><code class="lang-mermaid">flowchart TD
    start((start)) --&gt; |variable declaration| varDeclaration{{"`*character*(str)
    *count*(num)
    *rows*(list)
    *result*(str)`"}}
    varDeclaration --&gt; |**Start First Loop**: entering initial values of *i* and *count*| inputToLoop01[/"`input: 
                                                                                                            *count* = 8
                                                                                                            *i* = 0
                                                                                                            `"/] 
    inputToLoop01 --&gt; forLoop01{"`Is *i* &lt; *count*?`"}
    forLoop01 -.NO: something happens..-&gt; stop(((stop)))
    forLoop01 --&gt; |YES| inputI[/"`input: *i*`"/]
    inputI --&gt; |"`create strings of length (*i* + 1) from *character*`"| repeatStr["**new string** = character.repeat(i+1)"]
    repeatStr --&gt; |"`add newly created string 
            at the end of *rows* list`"| pushToRows["`rows.push(**new string**)`"]
    pushToRows --&gt; |"`bottom of the block: update *i*`"| updateI[/i = i+1/]
    updateI --&gt; |evaluate condition| forLoop01
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736358955713/d7693d1f-1f47-417f-b147-d6f23f7f74c6.jpeg" alt="Step 5: refining; first for-loop" class="image--center mx-auto" width="562" height="1005" loading="lazy"></p>
<p>Perfect.</p>
<p>Let’s now focus on the second for-loop. It turns out that it’s syntactically different from the previous one. And in fact, there are <a target="_blank" href="https://en.wikipedia.org/wiki/For_loop">different kinds of loops in programming</a>. The one we refined earlier is usually known as the “traditional” one, or better a <em>numeric range</em> type for-loop. The second one is an <em>iterator</em> type for-loop.</p>
<p>An <a target="_blank" href="https://refactoring.guru/design-patterns/iterator">iterator</a> is a functionality that moves incrementally along a group of values or <em>items</em>. That functionality can have subprocesses to initialize the iterator – one to get the current value the iterator is pointing to, as well as a subprocess to go to the next one.</p>
<p>Also, remember that a for-loop stops repeating a workflow branch as soon as the condition evaluates to <code>false</code>.</p>
<p>Let’s try to reflect all this knowledge when refining the second for-loop. I will generalize the first for-loop for the sake of clarity:</p>
<pre><code class="lang-mermaid">flowchart TD
    start((start)) --&gt; |variable declaration| varDeclaration{{"`*character*(str)
    *count*(num)
    *rows*(list)
    *result*(str)`"}}
    varDeclaration --&gt; |**Start Range-Based Loop**: entering initial values of *i* and *count*| forLoop01["Range-Based For-Loop"]
    forLoop01 -- enter Iterator-Based For-Loop --&gt; inputToLoop02[/"`INPUT:
                                                                *rows* (list of str of size *count*)
                                                                *result* (empty str)`"/]
    something --&gt; stop(((stop)))
    inputToLoop02 --&gt; forLoop02{"`Are there still *rows*' items?`"}
    forLoop02 --&gt; |YES: get the current one| row[/"GET: *row* = currentItem(*rows*)"/]
    row --&gt; |"concatenate the current *row* item plus a line (\n) to the current value of *result*"| newStr["**new string** = *result* + *row* + '\n'"]
    newStr --&gt; |change the value of *result* for **new string**|newRes[*result* = **new string**]
    newRes --&gt; |"`bottom of the block: move to next item`"| updateR[/"nextItem(*rows*)"/]
    updateR --&gt; forLoop02
    forLoop02 --&gt; |NO: we exhausted all the items| something
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736363492801/fe1199c8-edba-4e5b-9874-3bf151cc0d48.jpeg" alt="Step 5: refining; second for-loop" class="image--center mx-auto" width="584" height="1304" loading="lazy"></p>
<p>Now we have a clear flowchart for each of the for-loops! We had to first understand what the loops were about, and then had to find a way to represent them. We used refinement and generalization to expand / contract the information rendered by the flowchart.</p>
<p>At the end, we just have to accept that these are still approximations — in order to get how those for-loops <em>really</em> work, we would have to go learn more about JavaScript, probably looking through the JavaScript source code, or even closer to the machine by analysing binaries. But I’m personally satisfied with the information I got from the analysis.</p>
<p>Now after making these changes, we can come back and merge both flowcharts (for each of the for-loops) to complete the full representation of the code:</p>
<pre><code class="lang-mermaid">flowchart TD
    start((start)) --&gt; |variable declaration| varDeclaration{{"`*character*(str)
    *count*(num)
    *rows*(list)
    *result*(str)`"}}
    varDeclaration --&gt; |**Start Range-Based For-Loop**: entering initial values of *i* and *count*| inputToLoop01[/"`INPUT: 
                                                                                                            *count* = 8
                                                                                                            *i* = 0
                                                                                                            `"/] 
    inputToLoop01 --&gt; forLoop01{"`Is *i* &lt; *count*?`"}
    forLoop01 --&gt; |YES| inputI[/"`GET: *i*`"/]
    inputI --&gt; |"`create strings of length (*i* + 1) from *character*`"| repeatStr["**new string** = character.repeat(i+1)"]
    repeatStr --&gt; |"`add newly created string 
            at the end of *rows* list`"| pushToRows["`rows.push(**new string**)`"]
    pushToRows --&gt; |"`bottom of the block: update *i*`"| updateI[/i = i+1/]
    updateI --&gt; |evaluate condition| forLoop01
    forLoop01 --&gt;|NO| outputRows[/"`OUTPUT: *rows* list of string items of size *count*`"/]
    outputRows --&gt; |**Start Iterator-Based For-Loop**: entering initial values of *rows* and *result*| inputToLoop02[/"`INPUT:
                                                                *rows* (list of str of size *count*)
                                                                *result* (empty str)`"/]
    inputToLoop02 --&gt; forLoop02{"`Are there still *rows*' items?`"}
    forLoop02 --&gt; |YES: get the current one| row[/"GET: *row* = currentItem(*rows*)"/]
    row --&gt; |"concatenate the current *row* item plus a line (\n) to the current value of *result*"| newStr["**new string** = *result* + *row* + '\n'"]
    newStr --&gt; |change the value of *result* for **new string**|newRes[*result* = **new string**]
    newRes --&gt; |"`bottom of the block: move to next item`"| updateR[/"nextItem(*rows*)"/]
    updateR --&gt; forLoop02
    forLoop02 --&gt; |NO: we exhausted all the items| outputResult[/"`OUTPUT: *result* (str)`"/]
    outputResult --&gt; |"`display *result* on the console`"|displayResult["`console.log(*result*)
            fa:fa-display`"]
    displayResult --&gt; stop(((stop)))
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736364028135/12ea16c2-69ea-4a1d-9eb4-57025b3aa205.jpeg" alt="Step 5: complete flowchart of the example code" class="image--center mx-auto" width="615" height="1304" loading="lazy"></p>
<h3 id="heading-step-6-enhance-the-flowchart">Step 6: Enhance the Flowchart</h3>
<p>Sometimes, specially with large flowcharts, the repeated use of similar shapes requires additional enhancement to provide more clarity. Normally you won’t quite know what you need to enhance until you have the full picture of something more final.</p>
<p>One way to do this is by grouping sections of the workflow. For that, you can use styling, like coloring the shapes, to highlight similar or related steps. It can also be helpful to highlight elements in the workflow that are really playing a fundamental role in the analysis.</p>
<p>You can also create groups of sub-procedures by boxing them (that is, placing a box around related elements of the flowchart).</p>
<p>Let’s apply some enhancements to our final flowchart by boxing and coloring:</p>
<pre><code class="lang-mermaid">flowchart TD
    start((start)) --&gt; |variable declaration| varDeclaration{{"`*character*(str)
    *count*(num)
    *rows*(list)
    *result*(str)`"}}
    varDeclaration --&gt; |**Start Range-Based For-Loop**: entering initial values of *i* and *count*| inputToLoop01[/"`INPUT: 
                                                                                                            *count* = 8
                                                                                                            *i* = 0
                                                                                                     `"/]:::input 
    subgraph RANGE_BASED_LOOP
    inputToLoop01 --&gt; forLoop01{"`Is *i* &lt; *count*?`"}
    forLoop01 --&gt; |YES| inputI[/"`GET: *i*`"/]:::get
    inputI --&gt; |"`create strings of length (*i* + 1) from *character*`"| repeatStr["**new string** = character.repeat(i+1)"]
    repeatStr --&gt; |"`add newly created string 
            at the end of *rows* list`"| pushToRows["`rows.push(**new string**)`"]
    pushToRows --&gt; |"`bottom of the block: update *i*`"| updateI[/i = i+1/]:::input
    updateI --&gt; |evaluate condition| forLoop01
    end
    forLoop01 --&gt;|NO| outputRows[/"`OUTPUT: *rows* list of string items of size *count*`"/]:::output
    outputRows --&gt; |**Start Iterator-Based For-Loop**: entering initial values of *rows* and *result*| inputToLoop02[/"`INPUT:
                                                                *rows* (list of str of size *count*)
                                                                *result* (empty str)`"/]:::input
    subgraph ITERATOR_BASED_LOOP
    inputToLoop02 --&gt; forLoop02{"`Are there still *rows*' items?`"}
    forLoop02 --&gt; |YES: get the current one| row[/"GET: *row* = currentItem(*rows*)"/]:::get
    row --&gt; |"concatenate the current *row* item plus a line (\n) to the current value of *result*"| newStr["**new string** = *result* + *row* + '\n'"]
    newStr --&gt; |change the value of *result* for **new string**|newRes[*result* = **new string**]
    newRes --&gt; |"`bottom of the block: move to next item`"| updateR[/"nextItem(*rows*)"/]:::input
    updateR --&gt; forLoop02
    end
    forLoop02 ---&gt; |NO: we exhausted all the items| outputResult[/"`OUTPUT: *result* (str)`"/]:::output
    outputResult --&gt; |"`display *result* on the console`"|displayResult[/"`console.log(*result*)
            fa:fa-display`"/]
    displayResult --&gt;|finish| stop(((stop)))

    style start fill:black, color:#fff
    style displayResult fill: #DFFF73
    style stop fill:grey, color:#fff, stroke: white
    classDef input fill:#F8D192
    classDef get fill:#F8D062
    classDef output fill:#ECF892
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736364525277/56399b5f-c967-425e-8a74-bd33c98e8411.jpeg" alt="Step 6: Flowchart after styling" class="image--center mx-auto" width="612" height="1191" loading="lazy"></p>
<h3 id="heading-step-7-extend-the-flowchart">Step 7: Extend the Flowchart</h3>
<p>This step is optional. If you have done what you can to keep the flowchart as clear as possible – but you are finding that it still needs more refinement – you may be dealing with a complex process.</p>
<p>In this case, it’s time to think about a separate flowchart to continue or extend the one you are working on. There are ways to indicate the connection between pages. You can also show a section of a flowchart as a generalization and show a more refined flowchart on a separate pages using references.</p>
<p>I won’t go into the details of how to do that here, as this article is long enough as it is. And in this case, I think we can keep our flowchart to just one page, so I won’t go further with creating new pages for it.</p>
<p>So we are done!</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>When making a flowchart, we are not looking to imitate our code. Rather, we’re looking to <em>understand it</em>. This means that the flowchart has to be <em>clear</em>.</p>
<p>And if you use your flowcharts correctly, along with the right tools, they can help you reveal patterns and hidden operations, as well as stay organized, reduce overwhelm, and ultimately make coding feel more manageable. This will ultimately improve your coding skills and your state of mind.</p>
<p>So give flowcharts a try — you might be surprised at how much they can help you out.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ JavaScript Refresher for React Beginners – Key JS Concepts to Know ]]>
                </title>
                <description>
                    <![CDATA[ The Back Story A few years ago, I was introduced to React and immediately fell in love with its component-based, state-driven approach to building web applications. But as I delved deeper into its ecosystem, I encountered not just React, but a range ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/javascript-refresher-for-react-beginners/</link>
                <guid isPermaLink="false">67054d002fc10cc07ef1dc4f</guid>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ React ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Frontend Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Beginner Developers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Learning Journey ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Niladri S. Jyoti ]]>
                </dc:creator>
                <pubDate>Tue, 08 Oct 2024 15:17:20 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1727978962525/ee0aad46-7497-4c91-9354-dd8b0f9b4ea6.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <h2 id="heading-the-back-story">The Back Story</h2>
<p>A few years ago, I was introduced to React and immediately fell in love with its component-based, state-driven approach to building web applications.</p>
<p>But as I delved deeper into its ecosystem, I encountered not just React, but a range of supporting libraries like Material UI, React Router, Reactstrap, Redux, and more. While exciting, these new concepts and libraries could also feel overwhelming.</p>
<p>I soon realized that mastering React requires a solid understanding of modern JavaScript, especially the ES6+ features. This realization encouraged me to revisit some fundamental JavaScript topics, which helped me become more comfortable with React and write cleaner, more efficient code.</p>
<p>In this guide, I will share my notes as a concise and practical reference. These key JavaScript concepts will give you a strong foundation before you dive deep into React. Whether you’re a beginner or revisiting the language, this guide should give you a boost as you tackle the React ecosystem.</p>
<h2 id="heading-lets-get-back-to-work">Let’s Get Back to Work</h2>
<p>Since React is based on JavaScript, it’s essential to have a good grasp of the language before you start learning React.</p>
<p>I recommend a comprehensive resource like <a target="_blank" href="https://javascript.info/">The Modern JavaScript Tutor</a><a target="_blank" href="https://javascript.info/">ial</a> for an in-depth review. But if you feel confident about most of JavaScript and just need a brush-up, here’s my recommended list of crucial topics:</p>
<ol>
<li><p><a class="post-section-overview" href="#heading-1-template-literals">Template Literals</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-2-arrow-functions">Arrow Functions</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-3-default-parameters-or-values">Default Parameters (or Values)</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-4-destructuring-objects-and-arrays">Destructuring Objects and Arrays</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-5-rest-and-spread-operators">Rest and Spread Operators</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-6-map-filter-and-reduce-methods">Map, Filter, and Reduce Methods</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-7-mutability-issues-with-methods-like-array-sort">Mutability Issues with Methods like Array Sort</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-8-ternary-operator">Ternary Operator</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-9-short-circuiting-and-logical-operators">Short-Circuiting and Logical Operators</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-10-optional-chaining">Optional Chaining</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-11-asynchronous-js-callbacks-promises-asyncawait">Asynchronous JS (Callbacks, Promises, Async/Await)</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-12-closures">Closures</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-13-modules-importexport">Modules (import/export)</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-14-event-handling-and-bubbling">Event Handling and Bubbling</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-15-classes-and-prototypes">Classes and Prototypes</a></p>
</li>
</ol>
<h2 id="heading-1-template-literals">1. Template Literals</h2>
<p>Template literals simplify string interpolation and multiline text formatting. By using backticks (<code>`___` </code>), you can embed expressions into strings with <code>${}</code>. This makes concatenating variables and expressions with text easy, eliminating the need for cumbersome string concatenation.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> numEggs = <span class="hljs-number">4</span>;

<span class="hljs-built_in">console</span>.log(<span class="hljs-string">`In breakfast, I eat <span class="hljs-subst">${numEggs}</span> eggs.`</span>);
<span class="hljs-comment">//Output: In breakfast, I eat 4 eggs.</span>

<span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Today, I ate only half of it, I ate just <span class="hljs-subst">${numEggs/<span class="hljs-number">2</span>}</span> eggs.`</span>);
<span class="hljs-comment">//Output: Today I ate only half of it, I ate just 2 eggs.</span>
</code></pre>
<p>Additionally, template literals support multiline strings (without needing the newline character, that is <code>\n</code>, and also you can add spaces). This lets developers create more readable and organized code.</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Today I had:
- Breakfast
- Lunch
- Dinner`</span>);
<span class="hljs-comment">/* Output (now shows multiline text as shown below): 
Today I had:
- Breakfast
- Lunch
- Dinner
*/</span>
</code></pre>
<p>With their flexibility and clarity, template literals have become a preferred method for handling strings and dynamic content in modern JavaScript.</p>
<h2 id="heading-2-arrow-functions">2. Arrow Functions</h2>
<p>Arrow functions provide a more concise syntax for writing functions and automatically bind <code>this</code> to the context in which they're declared. They are a staple of React development, as they simplify event handlers, lifecycle methods, and other functional logic. Let’s explore different variations of arrow functions.</p>
<p><strong>Arrow Function with a Single Argument:</strong> When an arrow function has a single argument, you can omit the parentheses. Here’s an example:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> greet = <span class="hljs-function"><span class="hljs-params">name</span> =&gt;</span> <span class="hljs-string">`Hello, <span class="hljs-subst">${name}</span>!`</span>;
<span class="hljs-built_in">console</span>.log(greet(<span class="hljs-string">'John'</span>)); <span class="hljs-comment">// Hello, John!</span>
</code></pre>
<p><strong>Arrow Function without Arguments:</strong> If there are no arguments, you still need to use parentheses.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> sayHello = <span class="hljs-function">() =&gt;</span> <span class="hljs-string">'Hello, world!'</span>;
<span class="hljs-built_in">console</span>.log(sayHello()); <span class="hljs-comment">// Hello, world!</span>
</code></pre>
<p><strong>Arrow Function with Multiple Arguments:</strong> For multiple arguments, parentheses are mandatory.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> add = <span class="hljs-function">(<span class="hljs-params">a, b</span>) =&gt;</span> a + b;
<span class="hljs-built_in">console</span>.log(add(<span class="hljs-number">2</span>, <span class="hljs-number">3</span>)); <span class="hljs-comment">// 5</span>
</code></pre>
<p><strong>Single-Line Function Body (Implicit Return):</strong> When the function body is a single expression, you can omit the <code>return</code> keyword and curly braces. This is known as an implicit return.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> multiply = <span class="hljs-function">(<span class="hljs-params">x, y</span>) =&gt;</span> x * y;
<span class="hljs-built_in">console</span>.log(multiply(<span class="hljs-number">4</span>, <span class="hljs-number">5</span>)); <span class="hljs-comment">// 20</span>
</code></pre>
<p><strong>Multi-Line Function Body:</strong> For more complex logic or multiple statements, you need curly braces, and an explicit <code>return</code> is required if the function returns a value.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> getFullName = <span class="hljs-function">(<span class="hljs-params">firstName, lastName</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> fullName = <span class="hljs-string">`<span class="hljs-subst">${firstName}</span> <span class="hljs-subst">${lastName}</span>`</span>;
  <span class="hljs-keyword">return</span> fullName;
};
<span class="hljs-built_in">console</span>.log(getFullName(<span class="hljs-string">'John'</span>, <span class="hljs-string">'Doe'</span>)); <span class="hljs-comment">// John Doe</span>
</code></pre>
<p><strong>Returning an Object:</strong> To return an object directly, wrap the object in parentheses to avoid confusion with the function body.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> createUser = <span class="hljs-function">(<span class="hljs-params">name, age</span>) =&gt;</span> ({ name, age });
<span class="hljs-built_in">console</span>.log(createUser(<span class="hljs-string">'Alice'</span>, <span class="hljs-number">30</span>)); <span class="hljs-comment">// { name: 'Alice', age: 30 }</span>
</code></pre>
<p><strong>Arrow Functions in Callbacks:</strong> Arrow functions are often used as callbacks for array methods like <code>map</code>, <code>filter</code>, and <code>reduce</code>.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>];
<span class="hljs-keyword">const</span> squares = numbers.map(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num * num);
<span class="hljs-built_in">console</span>.log(squares); <span class="hljs-comment">// [1, 4, 9, 16]</span>
</code></pre>
<p>To learn more about how arrow functions compare with other ways to define functions, you may read this blog on <a target="_blank" href="https://medium.com/stackademic/3-common-ways-of-writing-functions-1fc62f478fe3">ways to write JS functions</a>.</p>
<h2 id="heading-3-default-parameters-or-values">3. Default Parameters (or Values)</h2>
<p>Default parameters allow functions to have pre-set values if no arguments are passed, or when an argument is <code>undefined</code>. This feature is helpful when writing flexible components in React, where you may not always pass every prop or argument.</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">greet</span>(<span class="hljs-params">name = <span class="hljs-string">'Stranger'</span></span>) </span>{
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Hello, <span class="hljs-subst">${name}</span>!`</span>);
}
greet(); <span class="hljs-comment">// Hello, Stranger!</span>
greet(<span class="hljs-string">'Alice'</span>); <span class="hljs-comment">// Hello, Alice!</span>
</code></pre>
<p>It is relevant to mention here that there’s another commonly used approach in JavaScript, which is leveraging logical operators like <code>||</code> to set a default value when the given value is falsy (that is, values like <code>0</code>, <code>null</code>, <code>undefined</code>, <code>false</code>, or <code>""</code>).</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">greet</span>(<span class="hljs-params">name</span>) </span>{
  <span class="hljs-keyword">const</span> finalName = name || <span class="hljs-string">'Stranger'</span>;
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Hello, <span class="hljs-subst">${finalName}</span>!`</span>);
}

greet(); <span class="hljs-comment">// Hello, Stranger!</span>
greet(<span class="hljs-string">''</span>); <span class="hljs-comment">// Hello, Stranger!</span>
greet(<span class="hljs-string">'John'</span>); <span class="hljs-comment">// Hello, John!</span>
</code></pre>
<p>The above process uses a concept called short-circuiting of logical operators, which is discussed in Section 9 below.</p>
<h2 id="heading-4-destructuring-objects-and-arrays">4. Destructuring Objects and Arrays</h2>
<p>Destructuring allows you to extract values from arrays and properties from objects into variables. This concise syntax makes your code cleaner and more readable.</p>
<p>To extract specific values from an array or object, use destructuring by enclosing the desired variables within curly braces for objects or square brackets for arrays.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example of Array Destructuring</span>
<span class="hljs-keyword">const</span> [first, second] = [<span class="hljs-number">10</span>, <span class="hljs-number">20</span>];
<span class="hljs-built_in">console</span>.log(first); <span class="hljs-comment">// 10</span>
</code></pre>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example of Object Destructuring</span>
<span class="hljs-keyword">const</span> user = { <span class="hljs-attr">name</span>: <span class="hljs-string">'Alice'</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">25</span> };
<span class="hljs-keyword">const</span> { name, age } = user;
<span class="hljs-built_in">console</span>.log(name); <span class="hljs-comment">// Alice</span>
</code></pre>
<p>Destructuring is commonly used in React for handling props and state. To see more specific use cases of destructuring with code examples, read this <a target="_blank" href="https://medium.com/@codenil/destructuring-a-quick-reference-a7b2fa09c88a">quick reference on destructuring</a>.   </p>
<h2 id="heading-5-rest-and-spread-operators">5. Rest and Spread Operators</h2>
<p>The rest and spread operators are incredibly versatile and widely used in JavaScript. Both are represented by three dots (<code>...</code>), but their meanings differ depending on the context in which they are used.</p>
<h3 id="heading-spread-operator-expands-elements-of-an-array-or-object">Spread Operator: Expands elements of an array or object.</h3>
<p>The spread operator is primarily used to unpack arrays or objects into individual elements. This is especially useful for creating shallow copies or merging arrays (and objects) without mutating the original.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> arr1 = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>];
<span class="hljs-keyword">const</span> arr2 = [...arr1, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
<span class="hljs-built_in">console</span>.log(arr2); <span class="hljs-comment">// [1, 2, 3, 4, 5]</span>

<span class="hljs-comment">/* arr2 is created by spreading the elements of arr1 
 and then adding additional values */</span>
</code></pre>
<p>The spread operator can also be used to copy objects or combine objects:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> obj1 = { <span class="hljs-attr">name</span>: <span class="hljs-string">'Alice'</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">25</span> };
<span class="hljs-keyword">const</span> obj2 = { ...obj1, <span class="hljs-attr">job</span>: <span class="hljs-string">'Engineer'</span> };
<span class="hljs-built_in">console</span>.log(obj2); <span class="hljs-comment">// { name: 'Alice', age: 25, job: 'Engineer' }</span>

<span class="hljs-comment">/* obj2 is created by spreading the properties of obj1
 and adding a new property */</span>
</code></pre>
<p>This is a common pattern when updating the state in React applications.</p>
<h3 id="heading-rest-operator-collects-multiple-elements-into-an-array">Rest Operator: Collects multiple elements into an array.</h3>
<p>The rest operator does the reverse: it collects multiple arguments or elements into a single array. It’s especially useful when working with variadic functions (functions that accept a variable number of arguments).</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sum</span>(<span class="hljs-params">...args</span>) </span>{
  <span class="hljs-keyword">return</span> args.reduce(<span class="hljs-function">(<span class="hljs-params">total, num</span>) =&gt;</span> total + num, <span class="hljs-number">0</span>);
}
<span class="hljs-built_in">console</span>.log(sum(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>)); <span class="hljs-comment">// 6</span>
</code></pre>
<p>In this example, <code>...args</code> gathers all arguments passed to the function into an array. This allows the function to handle any number of arguments dynamically.</p>
<p>You can also use the rest operator to collect remaining properties of an object or elements of an array:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> [first, ...rest] = [<span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">40</span>];
<span class="hljs-built_in">console</span>.log(first); <span class="hljs-comment">// 10</span>
<span class="hljs-built_in">console</span>.log(rest);  <span class="hljs-comment">// [20, 30, 40]</span>
</code></pre>
<p>This technique is particularly useful in React when working with props, where you might want to extract specific properties and pass the rest down to child components.</p>
<h2 id="heading-6-map-filter-and-reduce-methods">6. Map, Filter, and Reduce Methods</h2>
<p>The <code>map()</code>, <code>filter()</code>, and <code>reduce()</code> methods are incredibly powerful for array manipulation in JavaScript, and they play a crucial role in React for tasks like rendering lists, filtering data, and summarizing information.</p>
<ul>
<li><p><strong>Map</strong>: Transforms elements of an array </p>
</li>
<li><p><strong>Filter</strong>: Creates a new array with elements that pass a condition </p>
</li>
<li><p><strong>Reduce</strong>: Accumulates values into a single result </p>
</li>
</ul>
<h3 id="heading-1-map-method">1. Map Method</h3>
<p>The <code>map()</code> method creates a new array by transforming each element of the original array according to the function provided. This method is essential in React for dynamically rendering lists of components from arrays of data.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example (Basic Usage):</span>
<span class="hljs-keyword">const</span> numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>];
<span class="hljs-keyword">const</span> doubled = numbers.map(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num * <span class="hljs-number">2</span>);
<span class="hljs-built_in">console</span>.log(doubled); <span class="hljs-comment">// [2, 4, 6, 8]</span>
</code></pre>
<p>In React, <code>map()</code> is commonly used to render lists of components. Here's how you might use it in a React component:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example (Rendering a List in React):</span>
<span class="hljs-keyword">const</span> users = [
  { <span class="hljs-attr">id</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Alice'</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Bob'</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">3</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Charlie'</span> }
];

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">UserList</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
      {users.map(user =&gt; (
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">key</span>=<span class="hljs-string">{user.id}</span>&gt;</span>{user.name}<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
      ))}
    <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span></span>
  );
}

<span class="hljs-comment">/* Note that each &lt;li&gt; element in the list has a unique 'key' prop.
It is required by React when rendering lists like this */</span>
</code></pre>
<h3 id="heading-2-filter-method">2. Filter Method</h3>
<p>The <code>filter()</code> method creates a new array with all elements that pass the condition specified in the callback function. It's frequently used in React when you want to display only certain items based on user input or a specific condition.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example (Basic Usage):</span>
<span class="hljs-keyword">const</span> numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>];
<span class="hljs-keyword">const</span> evenNumbers = numbers.filter(<span class="hljs-function"><span class="hljs-params">num</span> =&gt;</span> num % <span class="hljs-number">2</span> === <span class="hljs-number">0</span>);
<span class="hljs-built_in">console</span>.log(evenNumbers); <span class="hljs-comment">// [2, 4]</span>
</code></pre>
<p>For a use case, imagine you have a list where some tasks are completed while some are not. So, you can use <code>filter()</code> to display (render) only the tasks that are not yet completed. </p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example (Filtering Data in React):</span>
<span class="hljs-keyword">const</span> todos = [
  { <span class="hljs-attr">id</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">task</span>: <span class="hljs-string">'Learn JavaScript'</span>, <span class="hljs-attr">completed</span>: <span class="hljs-literal">true</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">task</span>: <span class="hljs-string">'Learn React'</span>, <span class="hljs-attr">completed</span>: <span class="hljs-literal">false</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">3</span>, <span class="hljs-attr">task</span>: <span class="hljs-string">'Build a project'</span>, <span class="hljs-attr">completed</span>: <span class="hljs-literal">false</span> }
];

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">TodoList</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> incompleteTodos = todos.filter(<span class="hljs-function"><span class="hljs-params">todo</span> =&gt;</span> !todo.completed);
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
      {incompleteTodos.map(todo =&gt; (
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">key</span>=<span class="hljs-string">{todo.id}</span>&gt;</span>{todo.task}<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
      ))}
    <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span></span>
  );
}
</code></pre>
<h3 id="heading-3-reduce-method">3. Reduce Method</h3>
<p>The <code>reduce()</code> method executes a reducer function on each element of the array, resulting in a single output value. It's used when you need to accumulate data, such as summing values or combining objects.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example (Basic Usage):</span>
<span class="hljs-keyword">const</span> numbers = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>];
<span class="hljs-keyword">const</span> sum = numbers.reduce(<span class="hljs-function">(<span class="hljs-params">total, num</span>) =&gt;</span> total + num, <span class="hljs-number">0</span>);
<span class="hljs-built_in">console</span>.log(sum); <span class="hljs-comment">// 10</span>
</code></pre>
<p>You might use <code>reduce()</code> in React to calculate a summary of some data, like the total price of items in a shopping cart — considering the items’ individual price and quantities:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example (Using reduce() in React):</span>
<span class="hljs-keyword">const</span> cart = [
  { <span class="hljs-attr">id</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Apple'</span>, <span class="hljs-attr">price</span>: <span class="hljs-number">1.5</span>, <span class="hljs-attr">quantity</span>: <span class="hljs-number">3</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Banana'</span>, <span class="hljs-attr">price</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">quantity</span>: <span class="hljs-number">2</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">3</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Orange'</span>, <span class="hljs-attr">price</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">quantity</span>: <span class="hljs-number">1</span> }
];

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">CartSummary</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> total=cart.reduce(<span class="hljs-function">(<span class="hljs-params">sum, item</span>)=&gt;</span>sum + item.price * item.quantity, <span class="hljs-number">0</span>);
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>Total: ${total}<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p>These array methods are invaluable in React for manipulating and displaying data dynamically. They allow for clean, readable, and declarative logic within your components.</p>
<p>You can also combine these methods to create powerful data transformations. For example, you can filter an array and then map the results: <code>filter()</code> is used to extract only the adult users, and <code>map()</code> is then used to create a list of their names.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example: combined use of filter and map methods</span>
<span class="hljs-keyword">const</span> users = [
  { <span class="hljs-attr">id</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Alice'</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">25</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Bob'</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">17</span> },
  { <span class="hljs-attr">id</span>: <span class="hljs-number">3</span>, <span class="hljs-attr">name</span>: <span class="hljs-string">'Charlie'</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">30</span> }
];

<span class="hljs-keyword">const</span> adultNames = users
  .filter(<span class="hljs-function"><span class="hljs-params">user</span> =&gt;</span> user.age &gt;= <span class="hljs-number">18</span>)
  .map(<span class="hljs-function"><span class="hljs-params">user</span> =&gt;</span> user.name);
<span class="hljs-built_in">console</span>.log(adultNames); <span class="hljs-comment">// ['Alice', 'Charlie']</span>
</code></pre>
<p>The <code>map()</code> and <code>filter()</code> methods are easier to grasp because they follow a simple "one-to-one" or "one-to-zero-or-more" relationship: <code>map()</code> transforms each element into a new one, while <code>filter()</code> includes or excludes elements based on a condition, returning a similarly structured array.</p>
<p>In contrast, <code>reduce()</code> is more complex, as it accumulates values into a single result rather than maintaining a one-to-one relationship. It requires managing both the current value and an accumulator, making it conceptually different and harder to interpret than <code>map()</code> or <code>filter()</code>.</p>
<p>The optional initial value in <code>reduce()</code> adds to the complexity, as it sets the starting point for the accumulation. Without it, the first array element is used as the accumulator, which can cause unexpected results with empty arrays or non-numeric data. To get consistent results for your use of the <code>reduce()</code> method, you may read about <a target="_blank" href="https://medium.com/@codenil/the-importance-of-initial-value-in-array-reduce-method-86284878d1e4">the importance of an initial value</a>.</p>
<h2 id="heading-7-mutability-issues-with-methods-like-array-sort">7. Mutability Issues with Methods like Array Sort</h2>
<p>The <code>Array.sort()</code> method sorts the elements of an array in place, meaning it <strong>mutates</strong> the original array. For example:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> numbers = [<span class="hljs-number">4</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">1</span>];
numbers.sort();
<span class="hljs-built_in">console</span>.log(numbers); <span class="hljs-comment">// [1, 2, 3, 4]</span>
</code></pre>
<p>While this works in plain JavaScript, it’s problematic in React, where <strong>immutability</strong> is crucial for correctly managing state.</p>
<p>React detects state changes by comparing previous and new states and triggers re-renders based on those changes. But when an array is mutated in place (like with <code>sort()</code>), React may fail to recognize the change, leading to stale UI updates or unpredictable behavior.</p>
<p>To avoid this, it’s best to create a copy using the spread operator (<code>...</code>) or <code>slice()</code> before sorting, ensuring that the original state remains unchanged:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> numbers = [<span class="hljs-number">4</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">1</span>];
<span class="hljs-keyword">const</span> sortedNumbers = [...numbers].sort();
<span class="hljs-built_in">console</span>.log(sortedNumbers); <span class="hljs-comment">// [1, 2, 3, 4]</span>
</code></pre>
<p>Methods like <code>map()</code>, <code>filter()</code>, <code>reduce()</code>, or copying arrays/objects before modifying them is essential for preserving immutability and ensuring reliable state management in React.</p>
<h2 id="heading-8-ternary-operator">8. Ternary Operator</h2>
<p>The ternary operator is a shorthand for conditional statements. It has the syntax <code>condition ? expressionIfTrue : expressionIfFalse</code>. If the condition evaluates to true, it executes the <code>expressionIfTrue</code>. If it’s false, it executes the <code>expressionIfFalse</code>.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> isUserRegistered = <span class="hljs-literal">true</span>;
<span class="hljs-keyword">let</span> message = isUserRegistered ? <span class="hljs-string">'Please login'</span> : <span class="hljs-string">'Please Sign-up'</span>;
<span class="hljs-built_in">console</span>.log(message);
<span class="hljs-comment">//Output: Please login</span>
</code></pre>
<p>In React, it is an efficient replacement for the if-else statements in certain scenarios — like <a target="_blank" href="https://blog.stackademic.com/conditional-rendering-in-react-four-different-approaches-f25faddf0161">conditional rendering</a>, which delivers elements and components based on certain conditions or values of state or props data.</p>
<h2 id="heading-9-short-circuiting-and-logical-operators">9. Short-Circuiting and Logical Operators</h2>
<p>Logical operators like <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) can be used to create clean and concise conditional logic in JavaScript. In React, these operators often determine whether a component or JSX element should render.</p>
<h3 id="heading-1-logical-and-ampamp">1. Logical AND (<code>&amp;&amp;</code>)</h3>
<p>The <code>&amp;&amp;</code> operator evaluates the expression on the left side first. If it's <code>true</code>, the right-hand expression is evaluated and returned. If the left side is <code>false</code>, the entire expression short-circuits, meaning the right-hand expression is ignored.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> isLoggedIn = <span class="hljs-literal">true</span>;
<span class="hljs-built_in">console</span>.log(isLoggedIn &amp;&amp; <span class="hljs-string">'Welcome back!'</span>); <span class="hljs-comment">// Welcome back!</span>
</code></pre>
<p>This behavior is often used in React for conditional rendering, like so:</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">UserGreeting</span>(<span class="hljs-params">{ isLoggedIn }</span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      {isLoggedIn &amp;&amp; <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Welcome back!<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>}
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p>This is a common pattern in React for rendering UI based on certain conditions without needing an explicit <code>if</code> statement.</p>
<h3 id="heading-2-logical-or">2. Logical OR (<code>||</code>)</h3>
<p>The <code>||</code> operator works in the opposite way. It evaluates the left-hand expression first, and if it's <code>true</code> (or any truthy value), it returns that value. If the left-hand expression is <code>false</code> (or any falsy value), it evaluates and returns the right-hand expression. </p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> username = <span class="hljs-string">''</span>;
<span class="hljs-built_in">console</span>.log(username || <span class="hljs-string">'Guest'</span>); <span class="hljs-comment">// Output: Guest</span>
</code></pre>
<p>In React, this is useful for providing default values, like so:</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">UserProfile</span>(<span class="hljs-params">{ username }</span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Hello, {username || 'Guest'}!<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p>Note that the <strong>nullish coalescing operator (</strong><code>??</code><strong>)</strong> is similar to the logical OR operator (<code>||</code>), but with a key difference in how they treat <strong>falsy</strong> values.</p>
<p>The nullish coalescing operator (<code>??</code>) specifically checks if the left-hand side is either <code>null</code> <strong>or</strong> <code>undefined</code>. If the value is <code>null</code> or <code>undefined</code>, it returns the right-hand side. This allows <code>0</code>, <code>false</code>, and <code>''</code> to be treated as valid values and not overridden. You can read about this and more such <a target="_blank" href="https://medium.com/@codenil/javascript-operators-some-nuances-57300eb2c354">nuances associated with JavaScript Operators</a>.</p>
<h3 id="heading-3-combining-ampamp-and-for-complex-logic">3. Combining <code>&amp;&amp;</code> and <code>||</code> for Complex Logic</h3>
<p>You can also combine <code>&amp;&amp;</code> and <code>||</code> to create more complex conditional logic or nested logic.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> isAdmin = <span class="hljs-literal">false</span>;
<span class="hljs-keyword">let</span> isLoggedIn = <span class="hljs-literal">true</span>;
<span class="hljs-built_in">console</span>.log(isAdmin &amp;&amp; <span class="hljs-string">'Admin Panel'</span> || isLoggedIn &amp;&amp; <span class="hljs-string">'User Dashboard'</span>); 
<span class="hljs-comment">// Output: User Dashboard</span>
</code></pre>
<p>This can be useful in React for deciding what to render based on multiple conditions having an interplay.</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Dashboard</span>(<span class="hljs-params">{ isAdmin, isLoggedIn }</span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      {isAdmin &amp;&amp; <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Welcome to the Admin Panel<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>}
      {!isAdmin &amp;&amp; isLoggedIn &amp;&amp; <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Welcome to the User Dashboard<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>}
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<h2 id="heading-10-optional-chaining">10. Optional Chaining</h2>
<p><strong>Optional chaining (</strong><code>?.</code><strong>)</strong> is a powerful feature introduced in JavaScript (ES2020) that allows you to safely access deeply nested properties of an object without worrying about encountering <code>undefined</code> or <code>null</code> errors.</p>
<p>In traditional JavaScript, accessing nested properties of objects could result in errors if any part of the chain was <code>undefined</code> or <code>null</code>, causing your code to break. Optional chaining provides a cleaner and safer way to handle these scenarios.</p>
<p>The optional chaining operator short-circuits and returns <code>undefined</code> if the value before it is <code>null</code> or <code>undefined</code>. This prevents the code from throwing an error when trying to access the properties of a <code>null</code> or <code>undefined</code> value.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> user = { <span class="hljs-attr">name</span>: <span class="hljs-string">'Alice'</span>, <span class="hljs-attr">address</span>: { <span class="hljs-attr">city</span>: <span class="hljs-string">'Wonderland'</span> } };
<span class="hljs-built_in">console</span>.log(user?.address?.city); 
<span class="hljs-comment">// Output: Wonderland</span>

<span class="hljs-comment">// Without optional chaining</span>
<span class="hljs-keyword">let</span> user1 = { <span class="hljs-attr">name</span>: <span class="hljs-string">'Bill'</span> };
<span class="hljs-built_in">console</span>.log(user1.address.city); 
<span class="hljs-comment">// Output: Error: Cannot read property 'city' of undefined</span>

<span class="hljs-comment">// With Optional Chaining:</span>
<span class="hljs-keyword">let</span> user2 = { <span class="hljs-attr">name</span>: <span class="hljs-string">'Caleb'</span> };
<span class="hljs-built_in">console</span>.log(user2?.address?.city); <span class="hljs-comment">// undefined</span>
</code></pre>
<p>Optional chaining can also be used in different scenarios, such as   with function calls (to check if a function exists before invoking it), while accessing elements in arrays (especially when you’re unsure whether the array exists or whether it has enough elements), or while accessing dynamic properties, as shown below:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Optional Chaining with Functions:</span>
<span class="hljs-keyword">let</span> user1 = {
  <span class="hljs-attr">name</span>: <span class="hljs-string">'Alice'</span>,
  <span class="hljs-attr">greet</span>: <span class="hljs-function">() =&gt;</span> <span class="hljs-string">'Hello!'</span>
};

<span class="hljs-built_in">console</span>.log(user1.greet?.()); <span class="hljs-comment">// Hello!</span>
<span class="hljs-built_in">console</span>.log(user1.sayGoodbye?.()); <span class="hljs-comment">// undefined</span>

<span class="hljs-comment">// Optional Chaining with Arrays:</span>
<span class="hljs-keyword">let</span> users = [{ <span class="hljs-attr">name</span>: <span class="hljs-string">'Alice'</span> }, { <span class="hljs-attr">name</span>: <span class="hljs-string">'Bob'</span> }];
<span class="hljs-built_in">console</span>.log(users[<span class="hljs-number">0</span>]?.name); <span class="hljs-comment">// Alice</span>
<span class="hljs-built_in">console</span>.log(users[<span class="hljs-number">2</span>]?.name); <span class="hljs-comment">// undefined</span>

<span class="hljs-comment">// Optional Chaining with Dynamic Properties:</span>
<span class="hljs-keyword">let</span> user2 = { <span class="hljs-attr">name</span>: <span class="hljs-string">'Bill'</span>, <span class="hljs-attr">preferences</span>: { <span class="hljs-attr">theme</span>: <span class="hljs-string">'dark'</span> } };
<span class="hljs-keyword">let</span> property = <span class="hljs-string">'preferences'</span>;
<span class="hljs-built_in">console</span>.log(user2?.[property]?.theme); <span class="hljs-comment">// dark</span>

property = <span class="hljs-string">'settings'</span>;
<span class="hljs-built_in">console</span>.log(user2?.[property]?.theme); <span class="hljs-comment">// undefined</span>
</code></pre>
<p>When working with deeply nested objects, optional chaining can save you from having to write repetitive null checks at every level.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> user = { <span class="hljs-attr">profile</span>: { <span class="hljs-attr">address</span>: { <span class="hljs-attr">city</span>: <span class="hljs-string">'Wonderland'</span> } } };

<span class="hljs-comment">// usage without optional chaining (using short-circuiting):</span>
<span class="hljs-keyword">if</span> (user &amp;&amp; user.profile &amp;&amp; user.profile.address &amp;&amp; user.profile.address.city) {
  <span class="hljs-built_in">console</span>.log(user.profile.address.city);
}

<span class="hljs-comment">// usage with optional chaining (saving repititive null checks):</span>
<span class="hljs-built_in">console</span>.log(user?.profile?.address?.city); <span class="hljs-comment">// Wonderland</span>
</code></pre>
<p>In React, optional chaining is particularly useful when dealing with props, API responses, or any data that may not always be available. It helps prevent errors when rendering components based on dynamic or incomplete data.</p>
<p>Optional chaining significantly reduces the complexity of your code, making it cleaner and more readable, especially when dealing with deeply nested structures.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example usage of Optional Chaining in React</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">UserProfile</span>(<span class="hljs-params">{ user }</span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Name: {user?.name}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>City: {user?.address?.city ?? 'Unknown'}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<h2 id="heading-11-asynchronous-js-callbacks-promises-asyncawait">11. Asynchronous JS: Callbacks, Promises, Async/Await</h2>
<p>JavaScript is a single-threaded language,  meaning  it can execute one task at a time. But handling asynchronous operations is crucial, especially for tasks like fetching data in React. <code>Callback</code> functions are one of the earliest patterns used to handle asynchronous behavior, like so:</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fetchData</span>(<span class="hljs-params">callback</span>) </span>{
  <span class="hljs-built_in">setTimeout</span>(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Data fetched"</span>);
    callback({ <span class="hljs-attr">user</span>: <span class="hljs-string">"John"</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">30</span> });
  }, <span class="hljs-number">2000</span>);
}

fetchData(<span class="hljs-function">(<span class="hljs-params">data</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"User:"</span>, data.user);
});

<span class="hljs-comment">/* Output:
Data fetched
User: John
*/</span>
</code></pre>
<p>So, as you can see, callbacks are effective for handling simple operations that depend on asynchronous tasks, like the example above.</p>
<p>But when multiple asynchronous tasks rely on each other, callbacks can lead to deeply nested code, commonly referred to as <strong>callback hell</strong>.</p>
<p>To solve this problem, <code>promise</code>s were introduced. A <strong>promise</strong> is an object that represents the eventual completion (or failure) of an asynchronous operation and its resulting value. Instead of nesting multiple callbacks, promises allow chaining, leading to more structured and readable code.</p>
<p>Similarly, the Fetch API, which is commonly used for handling network requests in React applications, returns a promise which you can handle like so:</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fetchUserDetails</span>(<span class="hljs-params">userId</span>) </span>{
  <span class="hljs-keyword">return</span> fetch(<span class="hljs-string">`https://api.example.com/users/<span class="hljs-subst">${userId}</span>`</span>)
    .then(<span class="hljs-function">(<span class="hljs-params">response</span>) =&gt;</span> {
      <span class="hljs-keyword">if</span> (!response.ok) {
        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">'Failed to fetch user details'</span>);
      }
      <span class="hljs-keyword">return</span> response.json();
    })
    .then(<span class="hljs-function">(<span class="hljs-params">data</span>) =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Fetched user details"</span>);
      <span class="hljs-keyword">return</span> { <span class="hljs-attr">id</span>: userId, <span class="hljs-attr">name</span>: data.name };
    });
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fetchPostsByUser</span>(<span class="hljs-params">user</span>) </span>{
  <span class="hljs-keyword">return</span> fetch(<span class="hljs-string">`https://api.example.com/users/<span class="hljs-subst">${user.id}</span>/posts`</span>)
    .then(<span class="hljs-function">(<span class="hljs-params">response</span>) =&gt;</span> {
      <span class="hljs-keyword">if</span> (!response.ok) {
        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">'Failed to fetch posts'</span>);
      }
      <span class="hljs-keyword">return</span> response.json();
    })
    .then(<span class="hljs-function">(<span class="hljs-params">posts</span>) =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Fetched posts for <span class="hljs-subst">${user.name}</span>`</span>);
      <span class="hljs-keyword">return</span> posts;
    });
}

<span class="hljs-comment">// Chain promises</span>
fetchUserDetails(<span class="hljs-number">1</span>)
  .then(<span class="hljs-function">(<span class="hljs-params">user</span>) =&gt;</span> fetchPostsByUser(user))
  .then(<span class="hljs-function">(<span class="hljs-params">posts</span>) =&gt;</span> <span class="hljs-built_in">console</span>.log(posts))
  .catch(<span class="hljs-function">(<span class="hljs-params">error</span>) =&gt;</span> <span class="hljs-built_in">console</span>.error(<span class="hljs-string">"Error:"</span>, error));
</code></pre>
<p>Promises provide a more readable way to handle sequential asynchronous tasks. They also simplify error handling using <code>.catch()</code>. But, while promises eliminate the deep nesting of callbacks, chaining too many <code>.then()</code> calls can still become verbose and hard to follow.</p>
<p>Introduced in ES2017, <code>async/await</code> makes working with promises even simpler. With <strong>async/await</strong>, asynchronous code looks and behaves more like synchronous code, which greatly improves readability. Here’s how it works:</p>
<ul>
<li><p><strong>async function:</strong> An <code>async</code> function returns a promise. The <code>async</code> keyword allows the function to return a resolved promise implicitly.</p>
</li>
<li><p><strong>await expression:</strong> Inside an <code>async</code> function, <code>await</code> pauses the execution of the function until the promise resolves. It simplifies promise handling, as we can directly assign the resolved value to a variable.</p>
</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getUserAndPosts</span>(<span class="hljs-params">userId</span>) </span>{
  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> user = <span class="hljs-keyword">await</span> fetchUserDetails(userId); <span class="hljs-comment">// Waits for user details</span>
    <span class="hljs-keyword">const</span> posts = <span class="hljs-keyword">await</span> fetchPostsByUser(user);  <span class="hljs-comment">// Waits for posts</span>
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Posts:"</span>, posts);
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-built_in">console</span>.error(<span class="hljs-string">"Error:"</span>, error);
  }
}

getUserAndPosts(<span class="hljs-number">1</span>);

<span class="hljs-comment">/* Output:
Fetched user details
Fetched posts for John
Posts: ["Post 1", "Post 2"]
*/</span>
</code></pre>
<p><code>Async/await</code> makes asynchronous code appear synchronous, which greatly improves readability and maintainability. The <code>try/catch</code> block also simplifies error handling, making it consistent with how errors are caught in synchronous code.</p>
<h3 id="heading-error-handling-in-async-code"><strong>Error Handling in Async Code</strong></h3>
<p>Error handling in asynchronous code can be tricky. Callbacks require error-first handling, while promises and <code>async/await</code> offer more structured approaches, as shown below:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Handling Errors with Promises</span>
fetchUserDetails(<span class="hljs-number">1</span>)
  .then(<span class="hljs-function">(<span class="hljs-params">user</span>) =&gt;</span> fetchPostsByUser(user))
  .then(<span class="hljs-function">(<span class="hljs-params">posts</span>) =&gt;</span> <span class="hljs-built_in">console</span>.log(posts))
  .catch(<span class="hljs-function">(<span class="hljs-params">error</span>) =&gt;</span> <span class="hljs-built_in">console</span>.error(<span class="hljs-string">"Error fetching data:"</span>, error));
</code></pre>
<pre><code class="lang-javascript"><span class="hljs-comment">// Handling Errors with Async/Await</span>
<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getUserAndPosts</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">try</span> {
    <span class="hljs-keyword">const</span> user = <span class="hljs-keyword">await</span> fetchUserDetails(<span class="hljs-number">1</span>);
    <span class="hljs-keyword">const</span> posts = <span class="hljs-keyword">await</span> fetchPostsByUser(user);
    <span class="hljs-built_in">console</span>.log(posts);
  } <span class="hljs-keyword">catch</span> (error) {
    <span class="hljs-built_in">console</span>.error(<span class="hljs-string">"Error fetching data:"</span>, error);
  }
}
</code></pre>
<p>Understanding the evolution of asynchronous JavaScript helps you write efficient, non-blocking code. For more details, you can read this article on <a target="_blank" href="https://medium.com/stackademic/mastering-asynchronous-javascript-from-callbacks-to-async-await-8449e1f5f9c0">the evolutionary progress of Asynchronous JavaScript</a>.</p>
<h2 id="heading-12-closures">12. Closures</h2>
<p>A <strong>closure</strong> in JavaScript is created when a function “remembers” the variables from its outer scope, even after the outer function has finished executing. This means that a function retains access to the environment it was created in, making closures essential for managing data across different contexts.</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">outerFunction</span>(<span class="hljs-params">outerVar</span>) </span>{
  <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">innerFunction</span>(<span class="hljs-params">innerVar</span>) </span>{
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Outer: <span class="hljs-subst">${outerVar}</span>, Inner: <span class="hljs-subst">${innerVar}</span>`</span>);
  };
}

<span class="hljs-keyword">const</span> newFunction = outerFunction(<span class="hljs-string">'React'</span>);
newFunction(<span class="hljs-string">'JavaScript'</span>); <span class="hljs-comment">// Outer: React, Inner: JavaScript</span>
</code></pre>
<p>In React, closures are crucial for handling state and props within functional components. They allow functions like event handlers or asynchronous callbacks to access the latest state values even after re-renders.</p>
<p>For example, the <code>useState</code> and <code>useEffect</code> hooks rely on closures to "remember" and manage state across renders.</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Counter</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);
  <span class="hljs-keyword">const</span> increment = <span class="hljs-function">() =&gt;</span> setCount(count + <span class="hljs-number">1</span>); <span class="hljs-comment">// Closure keeps track of count</span>
  <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{increment}</span>&gt;</span>Count: {count}<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></span>;
}
</code></pre>
<p>Understanding closures ensures that you can effectively manage state and handle events in React, keeping your components consistent and predictable.</p>
<h2 id="heading-13-modules-importexport"><strong>13. Modules (import/export)</strong></h2>
<p>React projects are highly modular, meaning that the code is split into multiple files or components, each handling a specific responsibility. This modularity is enabled by <strong>ES6 modules</strong>, which allow you to <strong>export</strong> values, functions, or components from one file and <strong>import</strong> them into another.</p>
<p>Understanding how to use <code>import</code> and <code>export</code> is essential for organizing React applications and making code reusable and maintainable.</p>
<p>In the following example, the <code>greet</code> function is <strong>exported</strong> from <code>module.js</code>, making it accessible to other files.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// module.js</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> greet = <span class="hljs-function">() =&gt;</span> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Hello'</span>);
</code></pre>
<p>In <code>anotherFile.js</code>, we <strong>import</strong> the <code>greet</code> function from <code>module.js</code> and can now use it as if it were defined locally, like so:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// anotherFile.js</span>
<span class="hljs-keyword">import</span> { greet } <span class="hljs-keyword">from</span> <span class="hljs-string">'./module'</span>;
greet(); <span class="hljs-comment">// Hello</span>
</code></pre>
<p>React components are often exported from their own files and then imported into a central component (like <code>App.js</code>), allowing you to break down your UI into smaller, reusable pieces.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Button.js</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Button</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></span>;
}

<span class="hljs-comment">// App.js</span>
<span class="hljs-keyword">import</span> Button <span class="hljs-keyword">from</span> <span class="hljs-string">'./Button'</span>;
</code></pre>
<p>Understanding this import/export structure is fundamental in React for managing components, reusing logic, and keeping code clean and modular.</p>
<p>Here, you may note that CommonJS was a popular module system for Node.js (server-side JavaScript) before ES6. It allowed you to export values from a file using <code>module.exports</code> and import them using <code>require()</code>.</p>
<p>While it worked well in Node.js, it wasn't natively supported by browsers. With the rise of <strong>React</strong> and other frontend libraries, the need for a <strong>native, browser-supported</strong> and <strong>standardized</strong> module system became essential and ES6 provided that.</p>
<h2 id="heading-14-event-handling-and-bubbling"><strong>14. Event Handling and Bubbling</strong></h2>
<p>React relies heavily on event handling to respond to user interactions. Events in React are managed through <strong>Synthetic Events</strong>, which provide cross-browser consistency and performance optimization. Understanding <strong>event bubbling</strong>, a process where events propagate from the target element up through its parents, is crucial for controlling component behavior.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example in vanilla JavaScript:</span>
<span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"button"</span>).addEventListener(<span class="hljs-string">"click"</span>, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Button clicked"</span>);
});
</code></pre>
<p>In the above example, clicking the button triggers the event listener, and the event “bubbles” up through parent elements unless stopped. React handles this similarly with its <code>onClick</code> events:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example in React:</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">handleClick</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Button clicked"</span>);
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{handleClick}</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></span>;
}
</code></pre>
<p>In React, event bubbling can lead to multiple event handlers being triggered in nested elements. For example, a parent’s <code>onClick</code> can be triggered when its child button is clicked unless it is prevented by calling <code>event.stopPropagation()</code> inside the child button’s handler method — which then prevents the click event from reaching the parent <code>div</code>. This ensures that only the desired event is handled.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Example of How to Stop Event Bubbling:</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">handleButtonClick</span>(<span class="hljs-params">event</span>) </span>{
  event.stopPropagation(); <span class="hljs-comment">// Prevents bubbling</span>
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Button clicked"</span>);
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">handleDivClick</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Div clicked"</span>);
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{handleDivClick}</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{handleButtonClick}</span>&gt;</span>Click me<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p>React’s architecture, with its component-based structure and Synthetic Event System, reduces the need for <code>stopPropagation()</code> in most cases—for example, in simpler apps where both a parent and child component are not handling the same event like a <code>click</code>.</p>
<p>But in more <strong>complex UI structures</strong>, where multiple elements handle the same event (for example, <code>onClick</code>), and you want to prevent the parent element from reacting to the child’s event, <code>stopPropagation()</code> becomes crucial for controlling event flow. This is especially important in scenarios like <strong>nested modals, dropdowns, or accordions</strong>, where a click inside the modal should not trigger a click handler on the outer container.</p>
<h2 id="heading-15-classes-and-prototypes"><strong>15. Classes and Prototypes</strong></h2>
<p>While <strong>functional components</strong> are now dominant in React, understanding <strong>JavaScript classes</strong> and <strong>prototypes</strong> is still valuable, especially when working with <strong>class-based components</strong> or maintaining <strong>legacy code</strong>. JavaScript classes provide a blueprint for creating objects, and they work by leveraging prototypes under the hood.</p>
<pre><code class="lang-javascript"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span> </span>{
  <span class="hljs-keyword">constructor</span>(name) {
    <span class="hljs-built_in">this</span>.name = name;
  }  

  greet() {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Hello, I'm <span class="hljs-subst">${<span class="hljs-built_in">this</span>.name}</span>`</span>);
  }
}

<span class="hljs-keyword">const</span> person = <span class="hljs-keyword">new</span> Person(<span class="hljs-string">'Alice'</span>);
person.greet(); <span class="hljs-comment">// Hello, I'm Alice</span>
</code></pre>
<p>In this example, the <code>Person</code> class defines a constructor to initialize the <code>name</code> property, and a <code>greet()</code> method that prints a message. When you create a new instance of <code>Person</code>, the method is available through JavaScript’s <strong>prototype chain</strong>.</p>
<p>Though React moved towards functional components with hooks, class-based components were the standard prior to React 16.8. Understanding classes is useful when dealing with codebases that use class components or when you need to understand features like lifecycle methods (<code>componentDidMount</code>, <code>componentDidUpdate</code>, and so on) and <code>this</code> binding, which are more prevalent in class components.</p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>Mastering the key JavaScript concepts outlined in this tutorial will give you a solid foundation as you dive into React development.</p>
<p>React heavily relies on modern JavaScript features like <code>map()</code>, <code>filter()</code>, destructuring, and the spread operator, all of which streamline how data is manipulated and components are rendered. And concepts like immutability, optional chaining, and the nullish coalescing operator are critical for writing clean, bug-free code that interacts effectively with dynamic data.</p>
<p>By understanding how these JavaScript features work together, you'll be well-equipped to write more efficient, maintainable React applications.</p>
<p>So, as you begin your React journey, make sure your JavaScript fundamentals are rock-solid—you'll find that it pays off as you tackle more complex challenges in your React projects. Also, if you find I missed any important concept here, please let me know. I will add it back to the article for an updated version.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
