<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Richa</title>
    <description>The latest articles on Forem by Richa (@_richa_).</description>
    <link>https://forem.com/_richa_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2403640%2F3c544d4f-0b2f-4f2c-8e51-ee88f26c2467.png</url>
      <title>Forem: Richa</title>
      <link>https://forem.com/_richa_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/_richa_"/>
    <language>en</language>
    <item>
      <title>Explore a clear, real-world case of what happens when you run a local AI model. A classic example of hardware strain during model inference</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Fri, 21 Nov 2025 15:49:47 +0000</pubDate>
      <link>https://forem.com/_richa_/explore-a-clear-real-world-case-of-what-happens-when-you-run-a-local-ai-model-a-classic-example-4cl1</link>
      <guid>https://forem.com/_richa_/explore-a-clear-real-world-case-of-what-happens-when-you-run-a-local-ai-model-a-classic-example-4cl1</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/_richa_/-1lkn" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovmjvm2eh1i6n14n2qte.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/_richa_/-1lkn" rel="noopener noreferrer" class="c-link"&gt;
            When a “Small” AI Model Pushes Your Hardware to Its Limits - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            While building my ConversaAI web app, I started experimenting with a local AI model using Ollama,...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>learning</category>
      <category>performance</category>
    </item>
    <item>
      <title>When a “Small” AI Model Pushes Your Hardware to Its Limits</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Fri, 21 Nov 2025 15:48:37 +0000</pubDate>
      <link>https://forem.com/_richa_/-1lkn</link>
      <guid>https://forem.com/_richa_/-1lkn</guid>
      <description>&lt;p&gt;While building my &lt;a href="https://github.com/richa-parekh/conversaAI" rel="noopener noreferrer"&gt;ConversaAI&lt;/a&gt; web app, I started experimenting with a local AI model using Ollama, running the &lt;strong&gt;Gemma 3 (1B)&lt;/strong&gt; model, a "lightweight" &lt;strong&gt;815 MB&lt;/strong&gt; model.&lt;br&gt;
According to the documentation, a system with 8 GB RAM can handle models up to 7B parameters, so I expected a smooth run since my system has:&lt;br&gt;
 • CPU: Intel i7-8650U @ 1.9 GHz&lt;br&gt;
 • RAM: 16 GB&lt;br&gt;
 • OS: Windows 11 Pro&lt;br&gt;
 • GPU: NVIDIA MX130&lt;/p&gt;

&lt;p&gt;But in practice… it’s a different story.&lt;/p&gt;

&lt;p&gt;Every time model started generating a longer response, &lt;br&gt;
 • CPU jumped from &lt;strong&gt;10 %&lt;/strong&gt; to &lt;strong&gt;60 %&lt;/strong&gt;&lt;br&gt;
 • GPU (NVIDIA MX130) hit &lt;strong&gt;95% utilization&lt;/strong&gt;.&lt;br&gt;
 • Memory climbed to &lt;strong&gt;8.5 GB / 16 GB&lt;/strong&gt;&lt;br&gt;
 • Fans roared like a jet engine. 🌀&lt;br&gt;
…and then the model simply stopped generating mid-response. No error. No crash message.&lt;br&gt;
A few seconds later, the fan also slowed down again.&lt;/p&gt;

&lt;p&gt;👇 Here's the before-and-during-generating-longer-response comparison of hardware utilization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwvdcbfuodwnjthjwnrxp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwvdcbfuodwnjthjwnrxp.png" alt="Before hardware utilization" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0w5hvlcczmu953ywn02l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0w5hvlcczmu953ywn02l.png" alt="After hardware utilization" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At first, I thought something broke.&lt;/p&gt;

&lt;p&gt;But the real reason was far more interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 &lt;strong&gt;What Was Really Happening&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Even at 1B parameters, the model performs &lt;strong&gt;billions of operations per token.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every generated word triggers &lt;strong&gt;massive matrix multiplications&lt;/strong&gt;. The GPU handles the heavy computation, while the CPU manages data flow, scheduling, and memory movement. Meanwhile, RAM and VRAM temporarily hold weights, activations, and intermediate states.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In simple terms:&lt;/strong&gt;&lt;br&gt;
• The &lt;strong&gt;GPU&lt;/strong&gt; does intense math.&lt;br&gt;
• The &lt;strong&gt;CPU&lt;/strong&gt; coordinates everything.&lt;br&gt;
• &lt;strong&gt;RAM/VRAM&lt;/strong&gt; holds model weights and activations.&lt;br&gt;
• The &lt;strong&gt;fan&lt;/strong&gt; is the system’s way of saying, “I’m working really hard.”&lt;/p&gt;

&lt;p&gt;When GPU utilization peaks (95%), it produces heat rapidly.&lt;br&gt;
Once temperature crosses a safe limit, &lt;strong&gt;thermal throttling&lt;/strong&gt; activates, a safety mechanism that slows performance to protect the hardware.&lt;/p&gt;

&lt;p&gt;This throttling explains why the AI response halted and fan speed decreased shortly after.&lt;/p&gt;

&lt;p&gt;📽️ Watch the video below that explains this situation.&lt;br&gt;
&lt;a href="https://go.screenpal.com/watch/cTXrlpnqFzP" rel="noopener noreferrer"&gt;Hardware strain during model inference&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 Why This Is Normal
&lt;/h2&gt;

&lt;p&gt;"Small" in AI doesn't mean "light" for consumer hardware. &lt;br&gt;
A quick comparison:&lt;br&gt;
• My GPU (MX130) -&amp;gt; ~0.4 TFLOPS&lt;br&gt;
• Modern AI GPU (RTX 4090) -&amp;gt; ~82 TFLOPS&lt;br&gt;
A gap of nearly &lt;strong&gt;200x&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So, even though my laptop is capable of running local inference, it has trouble maintaining it, particularly when the model needs to continue executing billions of operations per second for longer outputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔚 Final Thought
&lt;/h2&gt;

&lt;p&gt;Running AI locally isn't just about generating text. It teaches you how your CPU, GPU, RAM, and thermal system manage the workload of modern AI models in real time.&lt;/p&gt;

&lt;p&gt;Now, every time my laptop fan spins up, I know it's just trying to think really hard. 😅&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did you ever run into a similar issue? If yes, how did you tackle it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you found this post useful or learned something new, drop a ❤️ and share your thoughts in the comments. I'd love to hear your experience.&lt;/p&gt;

&lt;p&gt;Feel free to reach out on&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
    &lt;tr&gt;
        &lt;td&gt;💌 &lt;a href="mailto:richaparekh.work@gmail.com"&gt;Email&lt;/a&gt;
&lt;/td&gt;
        &lt;td&gt;💻 &lt;a href="https://github.com/richa-parekh" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>learning</category>
      <category>performance</category>
    </item>
    <item>
      <title>localStorage - One of the simplest yet most powerful browser features every front-end developer should master</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Wed, 12 Nov 2025 07:19:15 +0000</pubDate>
      <link>https://forem.com/_richa_/localstorage-one-of-the-simplest-yet-most-powerful-browser-features-every-front-end-developer-1bj</link>
      <guid>https://forem.com/_richa_/localstorage-one-of-the-simplest-yet-most-powerful-browser-features-every-front-end-developer-1bj</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/_richa_/a-practical-guide-to-using-localstorage-in-javascript-with-mini-project-5h7l" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffymbuih13sf4sxh98k5o.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/_richa_/a-practical-guide-to-using-localstorage-in-javascript-with-mini-project-5h7l" rel="noopener noreferrer" class="c-link"&gt;
            A Practical Guide to Using localStorage in JavaScript (With Mini Project) - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            When we reload a website, JavaScript variables disappear; that’s because the web is stateless by...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




</description>
      <category>javascript</category>
      <category>web</category>
      <category>learning</category>
      <category>frontend</category>
    </item>
    <item>
      <title>A Practical Guide to Using localStorage in JavaScript (With Mini Project)</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Wed, 12 Nov 2025 07:17:15 +0000</pubDate>
      <link>https://forem.com/_richa_/a-practical-guide-to-using-localstorage-in-javascript-with-mini-project-5h7l</link>
      <guid>https://forem.com/_richa_/a-practical-guide-to-using-localstorage-in-javascript-with-mini-project-5h7l</guid>
      <description>&lt;p&gt;When we reload a website, JavaScript variables disappear; that’s because the web is stateless by default so the browser doesn’t remember anything once the page is refreshed.&lt;br&gt;
But what if you want your site to remember user preferences, saved items, or a theme choice?&lt;/p&gt;

&lt;p&gt;That’s where &lt;code&gt;localStorage&lt;/code&gt; comes in.&lt;/p&gt;
&lt;h2&gt;
  
  
  💡 What Is &lt;code&gt;localStorage&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;It is part of the &lt;strong&gt;Web Storage API&lt;/strong&gt;, which lives in the &lt;strong&gt;Window&lt;/strong&gt; object, meaning it’s only available in browser JavaScript (not Node.js).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data persists even after closing the browser&lt;/li&gt;
&lt;li&gt;Storage limit: around 5–10 MB (varies by browser)&lt;/li&gt;
&lt;li&gt;Accessible only by JavaScript running on the same domain&lt;/li&gt;
&lt;li&gt;Stores data as &lt;strong&gt;strings only&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🎯 Why Use localStorage?
&lt;/h2&gt;

&lt;p&gt;✔️ It’s great for small, persistent, non-sensitive data such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Theme or layout preferences&lt;/li&gt;
&lt;li&gt;Remembering form inputs or drafts&lt;/li&gt;
&lt;li&gt;Storing app state (like sidebar open/closed)&lt;/li&gt;
&lt;li&gt;Caching API responses temporarily&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;❌ It’s not meant for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sensitive data (like tokens or passwords)&lt;/li&gt;
&lt;li&gt;Large or complex datasets (use IndexedDB for that)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🛠️ Basic Operations
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Store Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Richa&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Retrieve Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "Richa"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Remove a Key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;removeItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Clear All Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Retrieve the name of a key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;keyName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Gets the name of the key at index 0&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;keyName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each value is stored as a &lt;strong&gt;string&lt;/strong&gt;. If you try to store an object directly, you’ll just get &lt;code&gt;[object Object]&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  📥 Storing Objects and Arrays (The Right Way)
&lt;/h2&gt;

&lt;p&gt;Since &lt;code&gt;localStorage&lt;/code&gt; only supports strings, you must convert structured data into strings using &lt;code&gt;JSON.stringify()&lt;/code&gt; and parse it back with &lt;code&gt;JSON.parse()&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Richa&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Developer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Save&lt;/span&gt;
&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;// Retrieve&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "Developer"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ⚙️ Real-World Example: Persistent Theme Switcher
&lt;/h2&gt;

&lt;p&gt;👇Check out mini project that describes the use case of &lt;code&gt;localStorage&lt;/code&gt;&lt;br&gt;
&lt;a href="https://github.com/richa-parekh/js-mini-projects/tree/master/persistent-theme-switcher" rel="noopener noreferrer"&gt;Persistent Theme Switcher&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✅ Try switching themes, reload the page, and see the magic; your preference stays saved!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63g8k00agxk23gh4cmko.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63g8k00agxk23gh4cmko.png" alt="Light Mode" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwj8dkjf07adv4nszkr2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwj8dkjf07adv4nszkr2w.png" alt="Dark Mode" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🆚 Comparison: &lt;code&gt;localStorage&lt;/code&gt; vs &lt;code&gt;sessionStorage&lt;/code&gt; vs &lt;code&gt;IndexedDB&lt;/code&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;localStorage&lt;/th&gt;
&lt;th&gt;sessionStorage&lt;/th&gt;
&lt;th&gt;IndexedDB&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Persistence&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Until manually cleared&lt;/td&gt;
&lt;td&gt;Until tab closes&lt;/td&gt;
&lt;td&gt;Persistent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Strings only&lt;/td&gt;
&lt;td&gt;Strings only&lt;/td&gt;
&lt;td&gt;Objects, Blobs, Files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Size Limit&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~5–10 MB&lt;/td&gt;
&lt;td&gt;~5 MB&lt;/td&gt;
&lt;td&gt;Hundreds of MBs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Case&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Preferences, small cache&lt;/td&gt;
&lt;td&gt;Temporary state&lt;/td&gt;
&lt;td&gt;Large structured data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Access Speed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Fast (sync)&lt;/td&gt;
&lt;td&gt;Fast (sync)&lt;/td&gt;
&lt;td&gt;Slower (async)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  🔚 Conclusion
&lt;/h2&gt;

&lt;p&gt;So that’s it for &lt;code&gt;localStorage&lt;/code&gt;!&lt;br&gt;
It may look simple, but it’s an incredibly useful tool when used wisely.&lt;br&gt;
It gives your web app memory, a way to remember who your user is and what they prefer, even after they close the browser.&lt;/p&gt;

&lt;p&gt;I hope you found this mini tutorial helpful.&lt;/p&gt;

&lt;p&gt;If you enjoyed this post or learned something new, drop a ❤️ and follow me for more beginner-friendly guides on web development.&lt;/p&gt;

&lt;p&gt;And if you have any questions or feedback, feel free to reach out on&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
    &lt;tr&gt;
        &lt;td&gt;💌 &lt;a href="mailto:richaparekh.work@gmail.com"&gt;Email&lt;/a&gt;
&lt;/td&gt;
        &lt;td&gt;💡 &lt;a href="https://www.linkedin.com/in/richa-parekh/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;
&lt;/td&gt;
        &lt;td&gt;💻 &lt;a href="https://www.linkedin.com/in/richa-parekh/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        
        
        
    &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>web</category>
      <category>learning</category>
      <category>frontend</category>
    </item>
    <item>
      <title>A simple HTML feature that transformed messy JS into clean, reusable UI components.</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Mon, 13 Oct 2025 08:00:53 +0000</pubDate>
      <link>https://forem.com/_richa_/a-simple-html-feature-that-transformed-messy-js-into-clean-reusable-ui-components-45bm</link>
      <guid>https://forem.com/_richa_/a-simple-html-feature-that-transformed-messy-js-into-clean-reusable-ui-components-45bm</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/_richa_/the-tag-a-core-html-feature-that-simplified-my-js-3m1o" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fswiuwxj4ae7rb64m7xkr.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/_richa_/the-tag-a-core-html-feature-that-simplified-my-js-3m1o" rel="noopener noreferrer" class="c-link"&gt;
            The &amp;lt;template&amp;gt; Tag: A core HTML Feature That Simplified My JS - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            I’m currently developing a conversational AI web application. I’ve been building it completely from...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>cleancode</category>
    </item>
    <item>
      <title>The &lt;template&gt; Tag: A core HTML Feature That Simplified My JS</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Mon, 13 Oct 2025 07:00:54 +0000</pubDate>
      <link>https://forem.com/_richa_/the-tag-a-core-html-feature-that-simplified-my-js-3m1o</link>
      <guid>https://forem.com/_richa_/the-tag-a-core-html-feature-that-simplified-my-js-3m1o</guid>
      <description>&lt;p&gt;I’m currently developing a conversational AI web application. I’ve been building it completely from scratch, following a structured SDLC approach.&lt;/p&gt;

&lt;p&gt;Right now, I’m in Phase 3: Frontend Interactivity, where I'm working on dynamically rendering chat messages.&lt;/p&gt;

&lt;p&gt;Initially, I took a common approach: use &lt;code&gt;insertAdjacentHTML()&lt;/code&gt; to append user and AI message bubbles directly into the DOM. It worked, but my JavaScript file became messy with chunks of repetitive HTML.&lt;/p&gt;

&lt;p&gt;Here’s what that looked like.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⛔ The Problem: Too Much HTML in JavaScript
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"messages-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;messagesContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;messages-container&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;messageHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
  &amp;lt;div class="flex justify-start mb-4 animate-slide-in"&amp;gt;
    &amp;lt;div class="bg-gray-100 dark:bg-gray-800 rounded-lg px-4 py-2 max-w-[70%]"&amp;gt;
      &amp;lt;p class="text-gray-800 dark:text-gray-200"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;messagesContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertAdjacentHTML&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;beforeend&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;messageHTML&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This worked fine for a single message type, but once I needed to handle AI messages (with a different layout), I realized I was duplicating the same structure in multiple places.&lt;/p&gt;

&lt;p&gt;It lacked simplicity.  It was not scalable.&lt;br&gt;
I required a method to differentiate between logic (JS) and structure (HTML) that was easier to maintain.&lt;/p&gt;

&lt;p&gt;At that point, I discovered the &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; tag, a native feature.&lt;/p&gt;
&lt;h2&gt;
  
  
  ✅ The Solution: &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; Tag
&lt;/h2&gt;

&lt;p&gt;It allows you to define &lt;strong&gt;reusable HTML sections&lt;/strong&gt; that &lt;strong&gt;remain inactive&lt;/strong&gt; until you purposefully use JavaScript to render them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In simpler terms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The browser parses the HTML inside , but doesn’t display it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can clone its content with JS using &lt;code&gt;template.content.cloneNode(true)&lt;/code&gt; whenever you need to render it dynamically.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By doing this, you can create clear, declarative HTML and then use it in your scripts without messing up your JS files with raw HTML strings.&lt;br&gt;
Here’s the structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"user-message-template"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex justify-start mb-4 animate-slide-in"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"bg-gray-100 dark:bg-gray-800 rounded-lg px-4 py-2 max-w-[70%]"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-gray-800 dark:text-gray-200 message-text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"messages-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🛠️ How It Works
&lt;/h2&gt;

&lt;p&gt;When the browser encounters a , it parses the markup but doesn’t render it.&lt;br&gt;
This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The content inside doesn’t appear in the DOM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scripts or images inside it won’t execute or load.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It quietly waits to be cloned when its turn comes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To use it, clone the content of the template by capturing it via JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;messagesContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;messages-container&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userTemplate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user-message-template&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;addUserMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Clone the content of the template&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;messageClone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;userTemplate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cloneNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Modify the cloned node&lt;/span&gt;
  &lt;span class="nx"&gt;messageClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.message-text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Append it to the container&lt;/span&gt;
  &lt;span class="nx"&gt;messagesContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;messageClone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Example usage&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;btn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sendBtn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nf"&gt;addUserMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This is test user message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your HTML is now scalable, readable, and modular.&lt;br&gt;
There won't be any messy HTML duplication in my JavaScript if I decide to add an AI message later. I can just define a different template with a slightly different style.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧐 Why is this important?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cleaner&lt;/strong&gt;: JS doesn't contain any HTML strings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;More maintainable&lt;/strong&gt;: Structure can be easily changed without affecting logic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Safer&lt;/strong&gt;: Less likely to have injection problems or malformed HTML&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalable&lt;/strong&gt;: Easily adjusts to more complex message formats.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These small improvements add up in a real-world chat application, especially one that goes through several stages of development.&lt;/p&gt;

&lt;p&gt;This structure maintains consistency and helps with debugging as the UI grows.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔚 Conclusion
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; tag quietly addresses a practical issue: keeping markup and logic separate in dynamic UI.&lt;br&gt;
It transformed a messy part of JavaScript into a clear, reusable system for my project.&lt;br&gt;
What's the best part? There is no need for additional dependencies because it is pure JavaScript.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sometimes, the cleanest solutions are already built into the browser. You just need to look closely.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>cleancode</category>
    </item>
    <item>
      <title>A beginner-friendly guide on how to write better git commit messages with Conventional Commits</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Thu, 02 Oct 2025 06:03:14 +0000</pubDate>
      <link>https://forem.com/_richa_/a-beginner-friendly-guide-on-how-to-write-better-git-commit-messages-with-conventional-commits-28pn</link>
      <guid>https://forem.com/_richa_/a-beginner-friendly-guide-on-how-to-write-better-git-commit-messages-with-conventional-commits-28pn</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/_richa_/stop-writing-bad-commit-messages-use-conventional-commits-instead-32jd" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvidtbn0ihqm5qms1m9m0.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/_richa_/stop-writing-bad-commit-messages-use-conventional-commits-instead-32jd" rel="noopener noreferrer" class="c-link"&gt;
            Stop Writing Bad Commit Messages: Use Conventional Commits Instead - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            You've probably seen some of these commit messages if you've been coding for a while:   final...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




</description>
      <category>git</category>
      <category>learning</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Stop Writing Bad Commit Messages: Use Conventional Commits Instead</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Thu, 02 Oct 2025 06:00:00 +0000</pubDate>
      <link>https://forem.com/_richa_/stop-writing-bad-commit-messages-use-conventional-commits-instead-32jd</link>
      <guid>https://forem.com/_richa_/stop-writing-bad-commit-messages-use-conventional-commits-instead-32jd</guid>
      <description>&lt;p&gt;You've probably seen some of these commit messages if you've been coding for a while:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;final changes&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bug fixed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;new update&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even I used to do this. 😬&lt;br&gt;
These may not seem like a big deal at first.  After all, the code works, right? However, these unclear commit messages become a source of confusion and frustration when you review your Git history three months later, or even worse, when a teammate tries to figure out what went wrong.&lt;/p&gt;

&lt;p&gt;Poor commit messages cause many issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Debugging is more difficult because it takes longer to understand why a change was made.&lt;/li&gt;
&lt;li&gt; A messy project history makes collaboration difficult because everything looks random.&lt;/li&gt;
&lt;li&gt; Automation opportunities are lost because free-form messages cannot be parsed by tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s where &lt;strong&gt;Conventional Commits&lt;/strong&gt; come in. This community-driven, lightweight standard gives commit messages structure without sacrificing their human-friendliness. Adopting this convention can immediately enhance your workflow, regardless of whether you're working in a team, coding alone, or contributing to open source.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Conventional Commit?
&lt;/h2&gt;

&lt;p&gt;In simple words, it is a &lt;strong&gt;Rulebook for writing commit messages in git&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;type&amp;gt;(&amp;lt;scope&amp;gt;): &amp;lt;short description&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The open-source community, particularly from projects like Angular and the larger JavaScript ecosystem, contributed to developing this standard.  The goal?  to eliminate uncertainty, enable automation such as changelog generation, and make commit history self-explanatory.&lt;/p&gt;

&lt;p&gt;There are no hard and fast rules, and you don't need any particular tools to get started.  It's simply a naming convention that provides your commits with structure and meaning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Format &amp;amp; Syntax
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;type&amp;gt;(&amp;lt;scope&amp;gt;): &amp;lt;description&amp;gt;

[optional body]

[optional footer(s)]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1. Type (Mandatory)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The type tells you what kind of change was made. Examples: feat, fix, docs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Scope (Optional but Useful)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The scope is the part of the codebase affected. For example:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;feat(auth): add Google login&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fix(cart): resolve item quantity bug&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;If your project is small, you might skip the scope. For larger codebases, it’s a lifesaver.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Description (Mandatory)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A short summary in the present tense.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;code&gt;feat(ui): add dark mode toggle&lt;/code&gt;&lt;br&gt;
❌ &lt;code&gt;added dark mode toggle&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Body (Optional)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Here’s where you explain why the change was made or add extra details.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fix(api): handle null values in user response

Previously, the API would crash if the user object was null. 
Now it safely returns an empty object instead.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;5. Footer (Optional, but for metadata)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Footers are used for breaking changes or referencing issues:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;BREAKING CHANGE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;The API no longer supports v1 endpoints.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;Closes&lt;/span&gt; &lt;span class="c1"&gt;#123&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Examples for Each Type
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;✅ &lt;code&gt;feat&lt;/code&gt;&lt;/strong&gt; (A new feature)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;feat&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;ui&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;dark&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="n"&gt;toggle&lt;/span&gt;

&lt;span class="n"&gt;Implemented&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;dark&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="n"&gt;toggle&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Added&lt;/span&gt; &lt;span class="n"&gt;Tailwind&lt;/span&gt; &lt;span class="n"&gt;dark&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="n"&gt;classes&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Saved&lt;/span&gt; &lt;span class="n"&gt;preference&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt;

&lt;span class="n"&gt;Closes&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#14&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🐞 &lt;code&gt;fix&lt;/code&gt;&lt;/strong&gt; (A bug fix)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;fix&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;auth&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prevent&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;expired&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;

&lt;span class="n"&gt;Fixed&lt;/span&gt; &lt;span class="n"&gt;an&lt;/span&gt; &lt;span class="n"&gt;issue&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt; &lt;span class="n"&gt;expired&lt;/span&gt; &lt;span class="n"&gt;JWT&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="n"&gt;were&lt;/span&gt; &lt;span class="n"&gt;still&lt;/span&gt; &lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Updated&lt;/span&gt; &lt;span class="n"&gt;middleware&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;validate&lt;/span&gt; &lt;span class="n"&gt;expiry&lt;/span&gt; &lt;span class="n"&gt;timestamp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📖 &lt;code&gt;docs&lt;/code&gt;&lt;/strong&gt; (Documentation changes only)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;docs&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;readme&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;contribution&lt;/span&gt; &lt;span class="n"&gt;guidelines&lt;/span&gt;

&lt;span class="n"&gt;Included&lt;/span&gt; &lt;span class="n"&gt;steps&lt;/span&gt; &lt;span class="n"&gt;for&lt;/span&gt; &lt;span class="n"&gt;submitting&lt;/span&gt; &lt;span class="n"&gt;pull&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;reporting&lt;/span&gt; &lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🎨 &lt;code&gt;style&lt;/code&gt;&lt;/strong&gt; (Code style/formatting (no logic change))&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;css&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="n"&gt;homepage&lt;/span&gt; &lt;span class="n"&gt;layout&lt;/span&gt;

&lt;span class="n"&gt;Applied&lt;/span&gt; &lt;span class="n"&gt;Prettier&lt;/span&gt; &lt;span class="n"&gt;formatting&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;adjusted&lt;/span&gt; &lt;span class="n"&gt;spacing&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;hero&lt;/span&gt; &lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;No&lt;/span&gt; &lt;span class="n"&gt;functional&lt;/span&gt; &lt;span class="n"&gt;changes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔄 &lt;code&gt;refactor&lt;/code&gt;&lt;/strong&gt; (Code changes that don’t add features or fix bugs)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;refactor&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;api&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;simplify&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="n"&gt;creation&lt;/span&gt; &lt;span class="n"&gt;logic&lt;/span&gt;

&lt;span class="n"&gt;Removed&lt;/span&gt; &lt;span class="n"&gt;duplicate&lt;/span&gt; &lt;span class="n"&gt;validation&lt;/span&gt; &lt;span class="n"&gt;checks&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;consolidated&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="n"&gt;handling&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;⚡ &lt;code&gt;perf&lt;/code&gt;&lt;/strong&gt; (Performance improvement)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;perf&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;optimize&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;

&lt;span class="n"&gt;Replaced&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;single&lt;/span&gt; &lt;span class="n"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;improve&lt;/span&gt; &lt;span class="n"&gt;load&lt;/span&gt; &lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧪 &lt;code&gt;test&lt;/code&gt;&lt;/strong&gt; (Add/modify tests)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;cart&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt; &lt;span class="n"&gt;tests&lt;/span&gt; &lt;span class="n"&gt;for&lt;/span&gt; &lt;span class="n"&gt;checkout&lt;/span&gt; &lt;span class="n"&gt;flow&lt;/span&gt;

&lt;span class="n"&gt;Covered&lt;/span&gt; &lt;span class="n"&gt;cases&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Empty&lt;/span&gt; &lt;span class="n"&gt;cart&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Multiple&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Discount&lt;/span&gt; &lt;span class="n"&gt;codes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🛠️ &lt;code&gt;chore&lt;/code&gt;&lt;/strong&gt; (Maintenance, tools, dependencies)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="na"&gt;chore&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;deps&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;update&lt;/span&gt; &lt;span class="n"&gt;Tailwind&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;v3&lt;/span&gt;&lt;span class="mi"&gt;.5.2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's understand this with a simple real-world use case:&lt;/p&gt;

&lt;h2&gt;
  
  
  Imagine you’re building a Chat App.
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You add a login feature&lt;br&gt;
&lt;code&gt;feat(auth): add email/password login&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You fix a bug where messages aren’t loading&lt;br&gt;
&lt;code&gt;fix(chat): resolve empty message list bug&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You update the README with setup steps&lt;br&gt;
&lt;code&gt;docs(readme): add local setup guide&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You refactor the message component for cleaner code&lt;br&gt;
&lt;code&gt;refactor(ui): simplify message bubble component&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now you are able to quickly identify what changed and why when you (or your team) review Git history.&lt;br&gt;
A release tool may automatically create a CHANGELOG.md file with the following sections if you run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Features&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; add email/password login (auth)

&lt;span class="gu"&gt;## Fixes&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; resolve empty message list bug (chat)

&lt;span class="gu"&gt;## Docs&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; add local setup guide (readme)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the real magic 🪄, turning commit messages into living documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why It Matters
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;For Individuals&lt;/strong&gt;&lt;br&gt;
✅ &lt;strong&gt;Clarity for future you&lt;/strong&gt;: You'll know exactly what each commit does when you go back to a project weeks or months later.&lt;br&gt;
✅ &lt;strong&gt;Professionalism&lt;/strong&gt;: Your GitHub profile will stand out to future employers and collaborators if you have a clean commit history.&lt;br&gt;
✅ &lt;strong&gt;Personal growth&lt;/strong&gt;: As a developer, you can improve your thinking skills by learning to accurately describe your changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Teams&lt;/strong&gt;&lt;br&gt;
✅ &lt;strong&gt;Smooth collaboration&lt;/strong&gt;: Everyone is able to quickly figure out what other people are working on.&lt;br&gt;
✅ &lt;strong&gt;Automation&lt;/strong&gt;: Tools like &lt;a href="https://commitlint.js.org/" rel="noopener noreferrer"&gt;commitlint&lt;/a&gt; and &lt;a href="https://semantic-release.gitbook.io/" rel="noopener noreferrer"&gt;semantic-release&lt;/a&gt; can parse commits to generate changelogs, bump versions, or trigger CI/CD workflows.&lt;br&gt;
✅ &lt;strong&gt;Reduced friction&lt;/strong&gt;: Spend more time creating features and less time dealing with unclear commits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Commit messages are the story of your project; they are not just a side note.  A messy history makes it more difficult to maintain your work and makes it more difficult for others to understand it. Conventional Commits solve this with a straightforward, easily readable standard that scales well.&lt;/p&gt;

&lt;p&gt;Adopting Conventional Commits is one of the simplest ways to improve your workflow, whether you're working on a side project, freelancing, or contributing to open source.&lt;/p&gt;

&lt;p&gt;Although it might seem like a small change, but it develops a clear, strong history that tells the story of your project.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Have you previously tried Conventional Commits?  Or do you want to use them in your upcoming project?  I'd love to know how it works for you, so please share your experience in the comments section!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>learning</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>𝗜 𝘁𝗿𝗶𝗲𝗱 𝗢𝗹𝗹𝗮𝗺𝗮 𝘁𝗼 𝗿𝘂𝗻 𝗟𝗟𝗠𝘀 𝗹𝗼𝗰𝗮𝗹𝗹𝘆, 𝗮𝗻𝗱 𝗶𝘁'𝘀 𝗮𝗺𝗮𝘇𝗶𝗻𝗴!</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Thu, 26 Jun 2025 04:11:27 +0000</pubDate>
      <link>https://forem.com/_richa_/--2168</link>
      <guid>https://forem.com/_richa_/--2168</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_richa_/ollama-how-to-easily-run-local-llms-on-your-computer-4g9o" class="crayons-story__hidden-navigation-link"&gt;Ollama: How to Easily Run LLMs Locally on Your Computer&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_richa_" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2403640%2F3c544d4f-0b2f-4f2c-8e51-ee88f26c2467.png" alt="_richa_ profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_richa_" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Richa
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Richa
                
              
              &lt;div id="story-author-preview-content-2616852" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_richa_" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2403640%2F3c544d4f-0b2f-4f2c-8e51-ee88f26c2467.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Richa&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_richa_/ollama-how-to-easily-run-local-llms-on-your-computer-4g9o" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 26 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_richa_/ollama-how-to-easily-run-local-llms-on-your-computer-4g9o" id="article-link-2616852"&gt;
          Ollama: How to Easily Run LLMs Locally on Your Computer
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/chatgpt"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;chatgpt&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/llm"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;llm&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cmd"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cmd&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/_richa_/ollama-how-to-easily-run-local-llms-on-your-computer-4g9o" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/raised-hands-74b2099fd66a39f2d7eed9305ee0f4553df0eb7b4f11b01b6b1b499973048fe5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;11&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/_richa_/ollama-how-to-easily-run-local-llms-on-your-computer-4g9o#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              14&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>llm</category>
      <category>cmd</category>
    </item>
    <item>
      <title>Ollama: How to Easily Run LLMs Locally on Your Computer</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Thu, 26 Jun 2025 04:00:00 +0000</pubDate>
      <link>https://forem.com/_richa_/ollama-how-to-easily-run-local-llms-on-your-computer-4g9o</link>
      <guid>https://forem.com/_richa_/ollama-how-to-easily-run-local-llms-on-your-computer-4g9o</guid>
      <description>&lt;p&gt;I just found an interesting open-source tool called &lt;strong&gt;&lt;a href="https://ollama.com/" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;&lt;/strong&gt;. It's a command-line application that lets you run Large Language Models (LLMs) on your computer. So I wanted to know more about this and tried it out on the weekend. So here I am sharing what I learned when I used Ollama.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 What Is Ollama?
&lt;/h2&gt;

&lt;p&gt;Ollama is a lightweight yet powerful tool that lets you run LLMs like LLaMA, Mistral, DeepSeek, Starling, and others directly on your own computer. It runs in the background and shows both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Command-Line Interface (CLI) for quick management and interactions&lt;/li&gt;
&lt;li&gt;An API that you can use in your own programs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Advantage? &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No dependency on the cloud. No keys for the API. Just LLMs that run on your computer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  💻 Installing Ollama
&lt;/h2&gt;

&lt;p&gt;It was surprisingly easy to get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit &lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;https://ollama.com/download&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get the OllamaSetup.exe (I use Windows OS).&lt;/li&gt;
&lt;li&gt;Just launch the installer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once installed, Ollama starts in the background, and we can run models using the CLI.&lt;br&gt;
💡 Installers for Linux and macOS users can be found on the same page.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Exploring the CLI
&lt;/h2&gt;

&lt;p&gt;I opened the Windows Command Prompt (CMD) as soon as it was installed and began to explore. This is the summary of what I tried:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;code&gt;ollama&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This gives a useful usage guide with a list of all the commands and flags that are available.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwxiajjkf16sztdbm68t.png" alt="ollama" width="613" height="495"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;code&gt;ollama list&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This displays every model that is currently installed. If nothing appears, it simply means no models have been installed yet. 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgp9lu32xyeoicur8w3fm.png" alt="ollama list" width="537" height="114"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;code&gt;ollama run llama3.2:1b&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I use the &lt;code&gt;llama3.2:1b&lt;/code&gt; model. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;What makes me go with this model over the others? I'll explain later in this blog post. So, read till the end.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Ollama started a chat session directly in the terminal after automatically pulling the model, which took a few seconds.&lt;/li&gt;
&lt;li&gt;I started conversion with a simple &lt;em&gt;"hello"&lt;/em&gt; message.
In response to my greeting, the model said:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Hello. Is there something I can help you with, or would you like to chat?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rozy7ysakkij22ay6a3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rozy7ysakkij22ay6a3.png" alt="ollama run llama3.2:1b" width="800" height="72"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then I continued with the below few conversions, and the model response was accurate and well-structured.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzu6kis0aq7r81zbgufo.png" alt="other conversion" width="800" height="412"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Exiting the Chat &lt;code&gt;/bye&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simply type &lt;code&gt;/bye&lt;/code&gt; to end a chat session:
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09s0pzkghtgnfyk5ukho.png" alt="Exiting the Chat" width="670" height="38"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. &lt;code&gt;ollama rm llama3.2:1b&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This command cleans up and frees up disk space.&lt;/li&gt;
&lt;li&gt;The model is immediately deleted from the system.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4i1aa46y69pj6ptyvhqc.png" alt="ollama rm llama3.2:1b" width="648" height="160"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are some of the commands I first tried with Ollama. These are only basic steps; there are a lot more things we can do with Ollama. See the &lt;a href="https://github.com/ollama/ollama" rel="noopener noreferrer"&gt;Ollama GitHub repository&lt;/a&gt; for further information.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⁉️ Why I use &lt;code&gt;llama3.2:1b&lt;/code&gt; model?
&lt;/h2&gt;

&lt;p&gt;I use &lt;code&gt;ollama run llama3.2&lt;/code&gt; after installing Ollama. For the response to the simple prompt message &lt;em&gt;hello&lt;/em&gt;, it takes longer than &lt;strong&gt;1-3 minutes&lt;/strong&gt; to provide a basic response:&lt;br&gt;
&lt;em&gt;Hello! It's nice to meet you. Is there something I can help you with, or would you like to chat?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What is the reason for that? Well, due to the memory limitations of my system. As per the Ollama documentation, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You should have at least 8 GB of RAM available to run the 7B models, 16 GB to run the 13B models, and 32 GB to run the 33B models.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And my system has only 4GB of RAM 😅 &lt;/p&gt;

&lt;p&gt;Since this subject is new to me, I did my research into the reasons behind these particular requirements. &lt;/p&gt;

&lt;p&gt;This is what I discovered 👇&lt;br&gt;
&lt;strong&gt;🔴 Main issue: Not enough RAM&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For a smooth experience, Llama 3.2 (3B parameters) requires around 6–8GB of RAM.&lt;/li&gt;
&lt;li&gt;The total RAM on my system is just 4GB.&lt;/li&gt;
&lt;li&gt;Windows 10 itself requires 2-3GB of RAM.&lt;/li&gt;
&lt;li&gt;As a result, the AI model has very little memory left.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🟦 What happens if there is not enough RAM?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The computer starts to use "virtual memory" — fake RAM made from hard drive space.&lt;/li&gt;
&lt;li&gt;RAM is 100 times faster than hard drives.&lt;/li&gt;
&lt;li&gt;The model is constantly "swapped" between the hard drive and RAM, which causes a bottleneck that makes everything very slow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I tried to use the smaller &lt;code&gt;Llama 3.2 1B model&lt;/code&gt;, which works more smoothly than &lt;code&gt;Llama 3.2&lt;/code&gt;. I also tried running other models, but they didn't work due to the system requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  💬 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Without depending on cloud APIs or remote inference, Ollama provides a very developer-friendly way to explore and play with LLMs. This tool is valuable if you're interested in developing local-first applications or simply want to learn how LLMs work off-cloud.&lt;/p&gt;

&lt;p&gt;The CLI is easy to use, and the setup went smoothly in my experience. Ollama is definitely worth a try, no matter whether you're a developer developing edge-native apps or a hobbyist learning AI.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Have you tried to run LLMs locally? What models do you explore, or what are you creating with Ollama-like tools? Share your experience and leave your comments below!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thank you for reading! ✨&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>llm</category>
      <category>cmd</category>
    </item>
    <item>
      <title>Why CTEs Make Complex SQL Queries Easy</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Thu, 05 Jun 2025 04:48:29 +0000</pubDate>
      <link>https://forem.com/_richa_/why-ctes-make-complex-sql-queries-easy-deh</link>
      <guid>https://forem.com/_richa_/why-ctes-make-complex-sql-queries-easy-deh</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_richa_/mastering-ctes-in-sql-a-beginners-guide-with-real-world-use-cases-postgresql-edition-4ekj" class="crayons-story__hidden-navigation-link"&gt;Mastering CTEs in SQL: A Beginner's Guide with Real-World Use Cases (PostgreSQL Edition).&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_richa_" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2403640%2F3c544d4f-0b2f-4f2c-8e51-ee88f26c2467.png" alt="_richa_ profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_richa_" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Richa
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Richa
                
              
              &lt;div id="story-author-preview-content-2545368" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_richa_" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2403640%2F3c544d4f-0b2f-4f2c-8e51-ee88f26c2467.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Richa&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_richa_/mastering-ctes-in-sql-a-beginners-guide-with-real-world-use-cases-postgresql-edition-4ekj" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 5 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_richa_/mastering-ctes-in-sql-a-beginners-guide-with-real-world-use-cases-postgresql-edition-4ekj" id="article-link-2545368"&gt;
          Mastering CTEs in SQL: A Beginner's Guide with Real-World Use Cases (PostgreSQL Edition).
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/sql"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;sql&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/postgres"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;postgres&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/learning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;learning&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/database"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;database&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/_richa_/mastering-ctes-in-sql-a-beginners-guide-with-real-world-use-cases-postgresql-edition-4ekj#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>sql</category>
      <category>postgres</category>
      <category>learning</category>
      <category>database</category>
    </item>
    <item>
      <title>Mastering CTEs in SQL: A Beginner's Guide with Real-World Use Cases (PostgreSQL Edition).</title>
      <dc:creator>Richa</dc:creator>
      <pubDate>Thu, 05 Jun 2025 04:00:00 +0000</pubDate>
      <link>https://forem.com/_richa_/mastering-ctes-in-sql-a-beginners-guide-with-real-world-use-cases-postgresql-edition-4ekj</link>
      <guid>https://forem.com/_richa_/mastering-ctes-in-sql-a-beginners-guide-with-real-world-use-cases-postgresql-edition-4ekj</guid>
      <description>&lt;p&gt;SQL, or "Sequel" as some call it, seems super easy at first. You just type something like &lt;code&gt;SELECT * FROM&lt;/code&gt; and suddenly you're looking at data from a database. Pretty cool, right? But SQL can do so much more than just simple stuff. There are powerful tricks hidden in there, and one of the best is called &lt;strong&gt;Common Table Expressions&lt;/strong&gt;, or &lt;strong&gt;CTEs&lt;/strong&gt; for short.&lt;/p&gt;

&lt;p&gt;CTEs are a big deal. They can help you with all sorts of things, like making dashboards, running fancy reports, or even solving tricky problems that repeat themselves. In this article, I'm going to explain what CTEs are, how they work, when they're most useful, and show you some real-world use cases. We'll be using PostgreSQL, which is a fantastic and free database system.&lt;/p&gt;

&lt;p&gt;I'll also share with you a small project I made myself to explore advanced SQL concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 What is a CTE?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Common Table Expression (CTE)&lt;/strong&gt; is a temporary result set that you can reference within a &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, or &lt;code&gt;DELETE&lt;/code&gt; statement. Think of it like a named subquery that enhances readability and maintainability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔧 Basic Syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;cte_name&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;column2&lt;/span&gt;
    &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;your_table&lt;/span&gt;
    &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cte_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;PostgreSQL evaluates the CTE first, then uses the result in the main query.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  💡 Real-World Use Cases of CTEs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Simplifying Complex Joins &amp;amp; Filters
&lt;/h3&gt;

&lt;p&gt;Nested subqueries can become unreadable. CTEs help you break them into manageable parts.&lt;/p&gt;

&lt;p&gt;📌 Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;recent_orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;CURRENT_DATE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'30 days'&lt;/span&gt;
&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="n"&gt;high_value_orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;recent_orders&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;total_amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;high_value_orders&lt;/span&gt; 
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Use case: A sales dashboard needs to show active high-value customers in the last 30 days.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. Recursive Queries
&lt;/h3&gt;

&lt;p&gt;CTEs support recursion — great for working with hierarchical or graph-like data (e.g., org charts, category trees).&lt;/p&gt;

&lt;p&gt;📌 Example: Finding management hierarchy&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="k"&gt;RECURSIVE&lt;/span&gt; &lt;span class="n"&gt;org_chart&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;manager_id&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;UNION&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;manager_id&lt;/span&gt;
    &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
    &lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;org_chart&lt;/span&gt; &lt;span class="n"&gt;oc&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;manager_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;oc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;org_chart&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Use case: Performing a recursive query of all employees under a given manager.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  3. Updating with Joins (a CTE hack)
&lt;/h3&gt;

&lt;p&gt;CTEs allow you to "stage" complex data before it is updated or deleted.&lt;/p&gt;

&lt;p&gt;📌 Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;flagged_users&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;login_attempts&lt;/span&gt;
    &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;
    &lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;is_locked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;TRUE&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;flagged_users&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Use case: Lock accounts that exceed failed login limits.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  📚 Rules, Restrictions &amp;amp; Tips
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Rules
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;CTEs are declared using &lt;code&gt;WITH&lt;/code&gt;, followed by one or more comma-separated blocks.&lt;/li&gt;
&lt;li&gt;You can use CTEs in &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, and &lt;code&gt;DELETE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Recursive CTEs must be explicitly marked with &lt;code&gt;WITH RECURSIVE&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚠️ Restrictions &amp;amp; Performance Tips
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PostgreSQL materializes&lt;/strong&gt; CTEs by default. This means that the results of the CTE query are stored in a temporary structure, often in memory, and then used in the outer query.

&lt;ul&gt;
&lt;li&gt;⛔ &lt;strong&gt;Why it matters&lt;/strong&gt;: In performance-critical queries, this can cause slower execution than expected.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Fix:&lt;/strong&gt; From PostgreSQL 12+, you can use &lt;code&gt;MATERIALIZED&lt;/code&gt; or &lt;code&gt;NOT MATERIALIZED&lt;/code&gt; to control this behavior.
📌 Example:
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;cte_name&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="n"&gt;MATERIALIZED&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;large_table&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cte_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;CTEs wisely&lt;/strong&gt;. Sometimes replacing a CTE with an inline subquery improves speed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔍 RDBMS Support
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;PostgreSQL&lt;/th&gt;
&lt;th&gt;MySQL&lt;/th&gt;
&lt;th&gt;SQL Server&lt;/th&gt;
&lt;th&gt;Oracle&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Basic CTE&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅ (v8.0+)&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recursive CTE&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅ (v8.0+)&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Materialized CTE&lt;/td&gt;
&lt;td&gt;✅ (v12+)&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ PostgreSQL stands out for flexibility and control over CTE behavior.        &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🖥️ My SQL and PostgreSQL Learning Project
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Title: Online Learning Platform (SQL-Only Backend)&lt;/strong&gt;&lt;br&gt;
For real-world knowledge with PostgreSQL, I created a backend system for an online learning platform that was totally written in SQL and had no frameworks, ORMs, or external tools.&lt;br&gt;
The platform mimics real-world systems like Coursera or Udemy with practice like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Schema Design&lt;/li&gt;
&lt;li&gt;Query Practice

&lt;ul&gt;
&lt;li&gt;10 Beginner-level queries&lt;/li&gt;
&lt;li&gt;10 Intermediate queries&lt;/li&gt;
&lt;li&gt;Advanced queries using: &lt;/li&gt;
&lt;li&gt;CTEs&lt;/li&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;li&gt;Window functions&lt;/li&gt;
&lt;li&gt;Triggers and functions&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Access Control &amp;amp; Security

&lt;ul&gt;
&lt;li&gt;Role-based access&lt;/li&gt;
&lt;li&gt;PostgreSQL roles &amp;amp; permissions&lt;/li&gt;
&lt;li&gt;Row-Level Security (RLS) setup&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Views

&lt;ul&gt;
&lt;li&gt;Logical abstraction with views&lt;/li&gt;
&lt;li&gt;Performance optimization with materialized views&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🚀Explore more&lt;/strong&gt;&lt;br&gt;
🔗 GitHub Repository link: &lt;a href="https://github.com/richa-parekh/learning-platform-db" rel="noopener noreferrer"&gt;Online Learning Platform (SQL-Only Backend)&lt;/a&gt;  &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you want to write &lt;strong&gt;clean, reusable, and powerful SQL queries&lt;/strong&gt;, you must understand CTEs. They not only increase readability but also enable recursive logic and maintainable data transformations.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MATERIALIZED&lt;/code&gt; control gives you more power when working with PostgreSQL, making it ideal for performance changes.&lt;/p&gt;

&lt;p&gt;CTEs are more than simply a "nice-to-have"—they are essential parts of complex SQL operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Share Your Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Have you ever used CTEs in your projects? What were the problems or benefits you experienced? Please let me know in the comments below!&lt;/p&gt;
&lt;/blockquote&gt;

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

</description>
      <category>sql</category>
      <category>postgres</category>
      <category>learning</category>
      <category>database</category>
    </item>
  </channel>
</rss>
