<?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>DEV Community: khalid</title>
    <description>The latest articles on DEV Community by khalid (@khalidhossain).</description>
    <link>https://dev.to/khalidhossain</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%2F714642%2Fd5f4b3a1-f38e-4cd4-ae4c-ebd29d777b6e.jpg</url>
      <title>DEV Community: khalid</title>
      <link>https://dev.to/khalidhossain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khalidhossain"/>
    <language>en</language>
    <item>
      <title>The Invisible Architecture Behind Apps That Never Lag</title>
      <dc:creator>khalid</dc:creator>
      <pubDate>Thu, 04 Dec 2025 21:17:18 +0000</pubDate>
      <link>https://dev.to/khalidhossain/the-invisible-architecture-behind-apps-that-never-lag-56gf</link>
      <guid>https://dev.to/khalidhossain/the-invisible-architecture-behind-apps-that-never-lag-56gf</guid>
      <description>&lt;p&gt;A few years ago, I spent nearly three hours trying to fix a strange bug.&lt;/p&gt;

&lt;p&gt;My dashboard UI froze every time I fetched analytics data.&lt;br&gt;
No error. No crash. Just… lag.&lt;/p&gt;

&lt;p&gt;I &lt;strong&gt;optimized&lt;/strong&gt; the API.&lt;br&gt;
I &lt;strong&gt;memoized&lt;/strong&gt; components.&lt;br&gt;
I &lt;strong&gt;cached&lt;/strong&gt; responses.&lt;/p&gt;

&lt;p&gt;Still slow.&lt;/p&gt;

&lt;p&gt;I was frustrated, until I realized the problem wasn’t in the code I wrote…&lt;br&gt;
It was in the code I didn’t understand.&lt;/p&gt;

&lt;p&gt;And that night, I stumbled into the world of:&lt;/p&gt;

&lt;p&gt;✨ Execution Context&lt;br&gt;
✨ Call Stack&lt;br&gt;
✨ Event Loop&lt;br&gt;
✨ Microtasks vs Macrotasks&lt;/p&gt;

&lt;p&gt;That’s when everything became visible to me.&lt;/p&gt;

&lt;p&gt;🚀 The Invisible System Behind Every Feature We Build&lt;/p&gt;

&lt;p&gt;Most developers know JavaScript is &lt;strong&gt;single-threaded&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But not everyone understands how it stays responsive while:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching live data&lt;/li&gt;
&lt;li&gt;Updating charts&lt;/li&gt;
&lt;li&gt;Handling user clicks&lt;/li&gt;
&lt;li&gt;Running timers&lt;/li&gt;
&lt;li&gt;Rendering animations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This invisible system is the reason apps like &lt;strong&gt;Notion, Figma, Linear, and Gmail&lt;/strong&gt; feel fast, even when they're doing &lt;strong&gt;100&lt;/strong&gt; things in the background.&lt;/p&gt;

&lt;p&gt;Let me show you how this plays out in real apps.&lt;/p&gt;

&lt;p&gt;Let's see a real example: &lt;strong&gt;Updating a Live Dashboard Without Freezing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you’re building a feature like:&lt;/p&gt;

&lt;p&gt;• A real-time revenue chart&lt;br&gt;
• Live visitor tracking&lt;br&gt;
• A Kanban board with auto-refresh&lt;/p&gt;

&lt;p&gt;Behind the scenes:&lt;/p&gt;

&lt;p&gt;• API call → sent to &lt;strong&gt;Web APIs&lt;/strong&gt;&lt;br&gt;
• Promise resolution → goes to &lt;strong&gt;Microtask Queue&lt;/strong&gt;&lt;br&gt;
• setTimeout fallback → goes to &lt;strong&gt;Macrotask Queue&lt;/strong&gt;&lt;br&gt;
• UI rendering → waits for the &lt;strong&gt;call stack&lt;/strong&gt; to be free&lt;/p&gt;

&lt;p&gt;If your function blocks the thread for even 300ms, your users feel the lag.&lt;/p&gt;

&lt;p&gt;That’s exactly what happened to me.&lt;/p&gt;

&lt;p&gt;Once I learned how the Event Loop prioritizes &lt;strong&gt;microtasks&lt;/strong&gt; over &lt;strong&gt;macrotasks&lt;/strong&gt;, everything made sense.&lt;/p&gt;

&lt;p&gt;Let's see another example: &lt;strong&gt;Why React State Feels “Delayed”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You update state:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
setCount(count + 1)&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
But the UI doesn’t update instantly.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;React &lt;strong&gt;batches updates&lt;/strong&gt; using &lt;strong&gt;microtasks&lt;/strong&gt;, not synchronous execution.&lt;/p&gt;

&lt;p&gt;When you understand the &lt;strong&gt;call stack and microtask queue&lt;/strong&gt;, React stops feeling magical and you actually know why things behave a certain way.&lt;/p&gt;

&lt;p&gt;Let's see another real world example: &lt;strong&gt;Smooth Animations During Heavy Workloads&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of apps like:&lt;/p&gt;

&lt;p&gt;• Instagram Reels&lt;br&gt;
• YouTube’s mini-player&lt;br&gt;
• Figma’s canvas&lt;/p&gt;

&lt;p&gt;They never freeze, even while fetching data.&lt;/p&gt;

&lt;p&gt;Because they split heavy tasks into chunks, keeping the &lt;strong&gt;event loop&lt;/strong&gt; unblocked so animations stay silky smooth.&lt;/p&gt;

&lt;p&gt;When you understand what blocks the stack, you instantly write smoother UI logic.&lt;/p&gt;

&lt;p&gt;🌟 The moment I learned &lt;strong&gt;how JavaScript actually executes&lt;/strong&gt; code, everything changed:&lt;/p&gt;

&lt;p&gt;• My UI stopped freezing&lt;br&gt;
• My async logic became bulletproof&lt;br&gt;
• I handled race conditions cleanly&lt;br&gt;
• Debugging felt easier&lt;br&gt;
• Building features became faster&lt;br&gt;
• React re-renders suddenly made sense&lt;br&gt;
• I started thinking like a senior engineer&lt;/p&gt;

&lt;p&gt;And the problem I spent 3 hours on?&lt;/p&gt;

&lt;p&gt;Solved in 10 minutes, once I understood the engine behind the language.&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%2F3lr82kn6qklnmd5y9lss.jpeg" 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%2F3lr82kn6qklnmd5y9lss.jpeg" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to correct me (if anything wrong) in the comment!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
    <item>
      <title>Fundamentals of let, const, var 🚀</title>
      <dc:creator>khalid</dc:creator>
      <pubDate>Thu, 29 Sep 2022 04:16:13 +0000</pubDate>
      <link>https://dev.to/khalidhossain/fundamentals-of-let-const-var-48fl</link>
      <guid>https://dev.to/khalidhossain/fundamentals-of-let-const-var-48fl</guid>
      <description>&lt;p&gt;Variables: Variables in JavaScript are containers for storing data. JavaScript allows the usage of variables in the following three ways:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;var&lt;/strong&gt;:
&lt;/h2&gt;

&lt;p&gt;var is the most commonly used variable in JavaScript. It can be initialized to a value, redeclared and its value can be reassigned, but only inside the context of a function. It can be function scoped or globally scoped.&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%2Frf1c5jwnx743eqpjr4wa.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%2Frf1c5jwnx743eqpjr4wa.png" alt="using var" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;let&lt;/strong&gt;:
&lt;/h2&gt;

&lt;p&gt;let in JavaScript is similar to var only difference lies in the scope. var is function scoped, let is block scoped. It cannot be redeclared but can be reassigned a value.&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%2Fjq92qedd0lvymm9wdwp3.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%2Fjq92qedd0lvymm9wdwp3.png" alt="Using let" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;const&lt;/strong&gt;:
&lt;/h2&gt;

&lt;p&gt;const in JavaScript is used to declare a fixed value that cannot be changed over time once declared. They can neither be redeclared nor be reassigned. They cannot be hoisted either.&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%2Fa9au48xrlqeflgt92bbs.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%2Fa9au48xrlqeflgt92bbs.png" alt="Using const" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📢Connect with me on &lt;a href="https://www.linkedin.com/in/khalidhossainbadhon/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;🚀&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>es6</category>
    </item>
    <item>
      <title>'How to learn anything faster!'</title>
      <dc:creator>khalid</dc:creator>
      <pubDate>Thu, 10 Feb 2022 11:04:43 +0000</pubDate>
      <link>https://dev.to/khalidhossain/how-to-learn-anything-faster-18d4</link>
      <guid>https://dev.to/khalidhossain/how-to-learn-anything-faster-18d4</guid>
      <description>&lt;p&gt;I was revising Front-end stuff, Was watching advanced CSS topics over and over but at the moment I realize that only following the tutorial isn't enough for me, &lt;br&gt;
Then I do explore a whole new thing,&lt;/p&gt;

&lt;p&gt;'&lt;strong&gt;If I do any projects from my own-self, and at the same time if I apply those properties / attributes in my projects from those tutorials I already watched. And this time I am catching everything faster&lt;/strong&gt;'&lt;/p&gt;

&lt;p&gt;summery: &lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Learn by doing
&lt;/h2&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
    </item>
  </channel>
</rss>
