<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Atia Khan on Medium]]></title>
        <description><![CDATA[Stories by Atia Khan on Medium]]></description>
        <link>https://medium.com/@atiajabbar39?source=rss-f879e8fa5475------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3H14tyuZMTmV5guYBTu4hw.jpeg</url>
            <title>Stories by Atia Khan on Medium</title>
            <link>https://medium.com/@atiajabbar39?source=rss-f879e8fa5475------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:34:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atiajabbar39/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Behind the Scenes of JavaScript: How the JS Engine and Runtime Power the Modern Web]]></title>
            <link>https://medium.com/@atiajabbar39/behind-the-scenes-of-javascript-how-the-js-engine-and-runtime-power-the-modern-web-f77e36f7d305?source=rss-f879e8fa5475------2</link>
            <guid isPermaLink="false">https://medium.com/p/f77e36f7d305</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tech-interview-questions]]></category>
            <category><![CDATA[node-js-development]]></category>
            <dc:creator><![CDATA[Atia Khan]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 08:03:58 GMT</pubDate>
            <atom:updated>2025-06-30T08:03:58.069Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever wondered <strong>how your JavaScript code goes from lines on your screen to a fully interactive website</strong>, you’re not alone. Years ago, as I first dipped my toes into web development, I kept asking myself: <em>What happens under the hood when I run my code?</em> This post is my attempt to demystify what really happens in the background — from the JavaScript engine, to the runtime environment, all the way to the event loop.</p><p>Let’s break it down in a way that’s beginner-friendly but also digs deep for those who want to go beyond the basics.</p><h3>What is a JavaScript Engine?</h3><p>Think of the JavaScript engine as the heart of your browser’s JavaScript abilities. It’s a specialized program built to execute JS code. Every modern browser has its own version — Google Chrome uses <strong>V8</strong>, Firefox uses <strong>SpiderMonkey</strong>, and so on. Even Node.js, the popular server-side platform, uses Chrome’s V8 engine.</p><p><strong>But what does it actually do?<br></strong> Your code doesn’t run on your computer’s hardware directly. Instead, you write code for humans, and the JS engine translates it into something your computer understands — a bit like having a translator at the United Nations.</p><h3>The Engine’s Workspace: Call Stack and Heap</h3><p>At the core of every JS engine are two key concepts:</p><ul><li><strong>Call Stack:<br></strong> Imagine a stack of plates in a cafeteria. The cook (JavaScript engine) works with the top plate. In programming, every time a function is called, a new “plate” (frame) is added. When a function finishes, the plate is removed. Only the top function gets executed at any given moment.</li><li><strong>Heap:<br></strong> This is the engine’s memory “store room.” Any time your app creates objects, arrays, or stores data, it goes into the heap. The heap is more like a big box where things can be tossed in at any time, and later retrieved when needed.</li></ul><figure><img alt="JS execution background" src="https://cdn-images-1.medium.com/max/1024/0*9QELFRSaGusViYxh" /></figure><h3>How Does JavaScript Run Your Code? Compilation vs. Interpretation</h3><p>Back in the day, programming languages tended to fall into two camps:</p><ul><li><strong>Compiled languages</strong> (like C++): You write code, then a compiler translates the whole thing into machine code, which your computer executes.</li><li><strong>Interpreted languages</strong> (like classic JavaScript): The interpreter reads your code and executes it line-by-line, translating as it goes.</li></ul><p>For a long time, JavaScript was purely interpreted — making it easy to experiment but not always super fast.</p><p><strong>Modern JavaScript engines, however, use a technique called Just-In-Time (JIT) compilation.<br></strong> Here’s how it works:</p><ol><li><strong>Parsing:<br></strong> The JS engine reads your code and turns it into something called an <strong>Abstract Syntax Tree (AST)</strong>. This checks your code for errors and structures it for the next steps.</li><li><strong>JIT Compilation:<br></strong> Instead of waiting until the very end to compile everything (like C++), and instead of interpreting line by line, the engine <em>quickly</em> compiles code to machine instructions just before it needs to execute them.</li><li><strong>Optimization:<br></strong> The engine keeps an eye on how your code runs. If it spots opportunities to make it faster, it will recompile certain pieces on the fly.</li></ol><p>The big advantage? JavaScript is both flexible and super fast — perfect for modern web apps.</p><h3>The JavaScript Runtime: More Than Just the Engine</h3><p>The JS engine is just one part of the bigger picture. <strong>A JavaScript runtime</strong> is the entire environment that allows JS code to run, and it’s packed with extra features — especially in the browser.</p><p><strong>In the browser, the runtime includes:</strong></p><ul><li><strong>JS Engine:</strong> The brains, as described above.</li><li><strong>Web APIs:</strong> Special features the browser exposes to your code — like the DOM, timers (setTimeout), network requests (fetch or XMLHttpRequest), and more. These are <em>not</em> part of the JavaScript language, but the browser makes them available.</li><li><strong>Callback Queue:</strong> Think of this as a waiting line for functions that are ready to run, but must wait their turn.</li><li><strong>Event Loop:</strong> The conductor, making sure everything runs smoothly, as we’ll see next.</li></ul><p><strong>Analogy:<br></strong> Think of the runtime as a full-featured kitchen:</p><ul><li>The JS engine is the chef.</li><li>Web APIs are the special kitchen gadgets.</li><li>The callback queue is the line of dishes waiting to be served.</li><li>The event loop is the head waiter, calling orders out at just the right time.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*36UhMYy0yeKPCDGv" /></figure><h3>The Event Loop: How JavaScript Stays Fast and Responsive</h3><p>One of JavaScript’s superpowers is how it handles asynchronous events — like button clicks, timers, or server responses — without freezing the whole app.</p><p>Here’s a simplified sequence of what happens:</p><ol><li><strong>You trigger something async</strong> (a click, a timer, a network request).</li><li>The browser’s <strong>Web API</strong> handles it in the background.</li><li>When it’s ready, your callback (the function you wrote) is placed into the <strong>callback queue</strong>.</li><li>The <strong>event loop</strong> constantly checks: Is the call stack empty? If yes, it grabs the next callback from the queue and pushes it onto the stack for execution.</li></ol><p><strong>Example:<br></strong> Suppose you click a button that loads more data.</p><ul><li>The browser handles the network request.</li><li>When data comes back, your callback goes to the callback queue.</li><li>As soon as the stack is free, the event loop runs your function, updating the UI.</li></ul><p>This system is why JavaScript apps can stay fast, even when handling lots of tasks at once.</p><h3>Why Does This Matter?</h3><p>Whether you’re building simple websites or complex web apps, understanding how JavaScript works at this level helps you:</p><ul><li><strong>Debug more effectively</strong> (you’ll know <em>why</em> some code seems “delayed” or “blocked”).</li><li><strong>Write better asynchronous code</strong> (using callbacks, promises, and async/await wisely).</li><li><strong>Ace technical interviews</strong> (these concepts are favorites for interviewers!)</li><li><strong>Appreciate the magic</strong> behind the responsive, interactive sites we use every day.</li></ul><h3>In a Nutshell</h3><ul><li>The <strong>JavaScript engine</strong> is responsible for executing your code, using the call stack and the heap.</li><li>Modern JS engines use <strong>JIT compilation</strong> for speed and optimization.</li><li>The <strong>runtime</strong> includes the engine, Web APIs, callback queue, and event loop — especially in browsers.</li><li>The <strong>event loop</strong> is what enables non-blocking, fast, interactive JavaScript experiences.</li></ul><p><strong><em>Thanks for reading!</em></strong><em><br></em> If this helped clarify what’s happening under the hood of your JavaScript code, give it a like, share, or drop your own questions or insights in the comments.<br>Want to dive deeper into specific topics — like the event loop, promises, or V8 internals? Let me know!</p><p><em>#JavaScript #WebDevelopment #JSDeepDive #Programming #Frontend #NodeJS #TechBlog </em>#TechExplained #JSRuntime #Frontend #NodeJS #Coding #InterviewPrep #100DaysOfCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f77e36f7d305" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How New React or Nextjs Developers Should Think]]></title>
            <link>https://medium.com/@atiajabbar39/how-new-react-or-nextjs-developers-should-think-60f8d5390adc?source=rss-f879e8fa5475------2</link>
            <guid isPermaLink="false">https://medium.com/p/60f8d5390adc</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Atia Khan]]></dc:creator>
            <pubDate>Fri, 20 Sep 2024 09:59:48 GMT</pubDate>
            <atom:updated>2024-09-20T09:59:48.355Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayvf0vRyT2gCNSB5CCA9wQ.png" /></figure><p>As new React developers, embracing the right mindset can significantly enhance your journey in building dynamic user interfaces. Here are some key principles to help you navigate the unique paradigms of React, along with practical examples:</p><ol><li><strong>Think in Components</strong>: Break your UI into smaller, reusable pieces. Each component should handle a specific task, enhancing maintainability and scalability.</li></ol><p>Example: Create a <strong>Button</strong> component that can be reused throughout your app.</p><pre>const Button = ({ label, onClick }) =&gt; (<br>  &lt;button onClick={onClick}&gt;{label}&lt;/button&gt;<br>);</pre><p>2. <strong>Embrace Declarative Programming:</strong> Focus on what your UI should look like based on the current state, rather than how to manipulate the DOM directly.</p><p>Example: Use conditional rendering to display different content based on user login status.</p><pre>const MyComponent = () =&gt; {<br>  const [isLoggedIn, setIsLoggedIn] = useState(false);<br>  return (<br>    &lt;div&gt;<br>      {isLoggedIn ? &lt;h1&gt;Welcome Back!&lt;/h1&gt; : &lt;h1&gt;Please Log In&lt;/h1&gt;}<br>    &lt;/div&gt;<br>  );<br>};</pre><p>3. <strong>Understand State and Props</strong>: Manage dynamic data effectively. Use state for internal data and props for passing data between components.</p><p>Example: Use useState for local state and pass data with props.</p><pre>const ParentComponent = () =&gt; {<br>  const [count, setCount] = useState(0);<br>  return &lt;ChildComponent count={count} /&gt;;<br>};<br>const ChildComponent = ({ count }) =&gt; &lt;h1&gt;Count: {count}&lt;/h1&gt;;</pre><p>4. <strong>Composition Over Inheritance:</strong> Build flexible components that can be composed together. This modular approach simplifies development and maintenance.</p><p>Example: Create a generic Card component that accepts different content.</p><pre>const Card = ({ title, content }) =&gt; (<br>  &lt;div className=&quot;card&quot;&gt;<br>    &lt;h2&gt;{title}&lt;/h2&gt;<br>    &lt;p&gt;{content}&lt;/p&gt;<br>  &lt;/div&gt;<br>);</pre><p>5. <strong>Unidirectional Data Flow</strong>: Ensure data flows from parent to child. This predictability helps manage state across your app.</p><p>Example: Lift state to a common ancestor to share data between components.</p><pre>const App = () =&gt; {<br>  const [theme, setTheme] = useState(&#39;light&#39;);<br>  return &lt;ThemeProvider theme={theme} /&gt;;<br>};</pre><p>6. <strong>Get Comfortable with JSX</strong>: Embrace JSX as a powerful way to integrate HTML-like syntax directly within JavaScript.</p><p>Example: Integrate JavaScript expressions in JSX.</p><pre>const Greeting = ({ name }) =&gt; &lt;h1&gt;Hello, {name}!&lt;/h1&gt;</pre><p>7. <strong>Learn Hooks</strong>: Utilize hooks like useState and useEffect to add state and manage side effects in functional components.</p><p>Example: Use useEffect to fetch data when a component mounts.</p><pre>useEffect(() =&gt; {<br>  const fetchUserData = async () =&gt; {<br>    const response = await fetch(&#39;/api/user&#39;);<br>    const data = await response.json();<br>    // Update state with user data<br>  };<br>  fetchUserData();<br>}, []);</pre><p>8. <strong>Test and Debug Early</strong>: Take advantage of React’s structure for testing. Use tools like Jest and React Testing Library to ensure your components work as expected.</p><p>Example: Write unit tests for your components using Jest.</p><pre>test(&#39;renders the Button component&#39;, () =&gt; {<br>  render(&lt;Button label=&quot;Click Me&quot; /&gt;);<br>  expect(screen.getByText(/Click Me/i)).toBeInTheDocument();<br>});</pre><p>By adopting these principles and practices, you’ll build scalable, maintainable applications and continuously refine your React skills. Stay curious, and let’s grow together in this exciting ecosystem! 🌟</p><p>#React #WebDevelopment #JavaScript #Learning #Beginners #ComponentArchitecture #ReactHooks #Reactjs #FrontEndDevelopment #ProgrammingMindset #JSX #ReactHooks #DeveloperJourney #NextJs</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60f8d5390adc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>