<?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"><channel><title><![CDATA[Baloch Coder]]></title><description><![CDATA[Deep dives into web development and code logic. A technical journal of my learning journey featuring cohort tasks, project walkthroughs, and modern tech explora]]></description><link>https://blog.balochcoder.codes</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 16:12:52 GMT</lastBuildDate><atom:link href="https://blog.balochcoder.codes/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[OPERATION PROMISE: The Digital Battlefield]]></title><description><![CDATA[Just imagine that you are a Major at the Indian Army Command Center. You have a very critical mission at this time and the mission is to Capture the Enemy's Base.
In early days we used Callbacks. Take]]></description><link>https://blog.balochcoder.codes/promises</link><guid isPermaLink="true">https://blog.balochcoder.codes/promises</guid><category><![CDATA[promises]]></category><category><![CDATA[Cohort2026]]></category><category><![CDATA[#balochcoder]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Sun, 01 Mar 2026 11:40:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6795eb4494716ab0e2fae80a/a92f67d3-7dde-4f01-b831-8b0f41504ec4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Just imagine that you are a <strong>Major</strong> at the Indian Army Command Center. You have a very critical mission at this time and the mission is to <strong>Capture the Enemy's Base.</strong></p>
<p>In early days we used <strong>Callbacks.</strong> Take it like a game of Chinese Whispers where you told soldier <strong>X</strong> to find the map then you had to tell soldier <strong>Y</strong> to find the keys and then soldier <strong>Y</strong> had to tell soldier <strong>Z</strong> to start the car.</p>
<p>If soldier <strong>Y</strong> tripped then the entire line broke because of a single soldier. And that time you couldn't see what was happening. We called it <strong>Callback Hell.</strong></p>
<h3>The New Order: What is a Promise?</h3>
<p>A <strong>Promise</strong> is nothing else just like a commitment just take a real world example such as when you give an order to a soldier in return you want the result but soldiers don't give you the result immediately, instead they give a <strong>Promise</strong> that they will complete the given task.</p>
<p>Now you have sent the all soliders in to the field and you don't just sit in your room. You prepare the entire battle you check the weather, you prepare the rations and plan the next move. You are called <strong>asynchronous.</strong></p>
<h3>The 3 States of a Soldier</h3>
<p>Every mission includes these three states whcih are used to handle the entire mission.</p>
<ul>
<li><p>Pending</p>
</li>
<li><p>Fulfilled/Resolved</p>
</li>
<li><p>Rejected</p>
</li>
</ul>
<h3>Pending State</h3>
<p>On pending state the soldier is on the way but the result is still unknown.</p>
<h3>Fulfilled</h3>
<p>On this state not only soldier but everyone celebrate it because this is the state where soldiers return with the enemy flags It shows that the mission is accomplhished and they are coming back to the base.</p>
<h3>Rejected (Failure)</h3>
<p>On this state you can understand it like this, suppose the soldiers where they were being sent there was a bridge between the command base and the destination where they wanted to go. So the bridge was broken and the soldiers couldn't cross it. It means the mission was postpond at that time. In promises world this is called rejected.</p>
<h3>Mission Issuing the Order</h3>
<p>In JavaScript this is how you send a soldier on a mission. It's not difficult to understand issuing the order means you are preparing the soldiers to send them.</p>
<pre><code class="language-javascript">const captureBase = new Promise((resolve, reject) =&gt; {
    let baseCaptured = true; // The battlefield reality to understand promises in js bro...

    console.log("Soldier: Major The mission is started");

    setTimeout(() =&gt; { // It simulates the time which is taken for the mission
        if (baseCaptured) {
            resolve("Sir! We captured the base. Now it is under our control"); // On this state the mission is accomplished
        } else {
            reject("We can not cross the bridge it is broken"); // On this state the mission is failed
        }
    }, 2000);
});
</code></pre>
<p>You can handle the report very easily.</p>
<p>You don't wait for anything you can directly tell the soldiers what to do after accomplishing the mission.</p>
<ul>
<li><p><code>.then()</code>: If you succeed, hoist the flag.</p>
</li>
<li><p><code>.catch()</code>: If you fail, call for backup.</p>
</li>
<li><p><code>.finally()</code>: Whether you win or lose return to base for dinner.</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/6795eb4494716ab0e2fae80a/cd987a60-08f0-4c3f-b709-f433ab028ada.png" alt="" style="display:block;margin:0 auto" />

<pre><code class="language-javascript">captureBase
    .then((msg) =&gt; console.log("Message:", msg))
    .catch((err) =&gt; console.log("Error:", err))
    .finally(() =&gt; console.log("Major: All units must return for dinner."));
</code></pre>
<h3>The Shocking Comparison</h3>
<table style="min-width:50px"><colgroup><col style="min-width:25px"></col><col style="min-width:25px"></col></colgroup><tbody><tr><td><p><strong><u>Old Callback Way (The Jungle)</u></strong></p></td><td><p><strong><u>New Promise Way (The Command Center)</u></strong></p></td></tr><tr><td><p>Code moves <strong>to the right</strong> (Pyramid).</p></td><td><p>Code moves <strong>downwards</strong> (Linear).</p></td></tr><tr><td><p>Hard to track errors.</p></td><td><p>One <code>.catch()</code> handles everything in your code.</p></td></tr><tr><td><p>You lose control of the flow in your code.</p></td><td><p>You stay in control at the top.</p></td></tr></tbody></table>

<h3>Squad (Static Methods)</h3>
<p>In some critical missions you need a <strong>squad</strong> because one soldier won't be enough for that mission.</p>
<p>The Joint Strike (<code>Promise.all</code>)</p>
<p>Suppose you send 3 soldiers to 3 different location for the battle if all get success then you win otherwise if 1 soldier fails then the whole mission is a failure.</p>
<ul>
<li>Use Case in real softwares, such as loading a user's profile, photos, and settings. You need all three to display the page.</li>
</ul>
<h3>The Full Report (<code>Promise.allSettled</code>)</h3>
<p>You send 3 scouts but in this case you don't care about the result if they fail or secceed instead you just want a report from everyone regarding what they saw.</p>
<ul>
<li>Use Case in real world software like sending 8 emails, you want to know which ones were sent and which ones bounced at that time.</li>
</ul>
<h3>The Scout Race (<code>Promise.race</code>)</h3>
<p>You send 3 scouts to find a secret path as soon as the first one returns whether they found a secret path or just found an error, you immediately take action on that.</p>
<ul>
<li>In real world software we use it like setting a 6 second of timeout. If the data doesn't come in 6 seconds, the <strong>Timeout Error</strong> wins the race.</li>
</ul>
<h3>The Backup Plan (<code>Promise.any</code>)</h3>
<p>Lets understand <code>Promise.any</code> like some spies suppose you send 3 spies to find the location of your enemy. As soon as one spy succeeds you celebrate that and you ignore the other ones who failed.</p>
<ul>
<li>In real world software we can see the usecase like Fetching data from 3 different servers. Suppose there are 3 servers, server A, server B, and server C. If Server A is down, but Server B is up and it's running so you take data from Server B.</li>
</ul>
<h2>The Final Upgrade: Async/Await</h2>
<p>In modern warfare, we use <strong>Async/Await</strong>. It makes the code look like a simple list of commands, but it uses Promises secretly in the background. Async/Await in JavaScript allows you to write asynchronous code in a clean way which makes it easier to read, understand and maintain the code while working with promises. Async functions always return a Promise. Await keyword pauses the exectuion of the code until the Promise is resolved or rejected. The code becomes more readable as compare to .then() and .catch() chaining which makes the code frustrating to read if it gets very big. Async and await also make error handing very easy by using try.....catch.</p>
<pre><code class="language-javascript">async function executeMission() {
    try {
        const report = await captureBase; // It waits here until the promise is resolved or rejected
        console.log("Major reads report:", report);
    } catch (error) {
        console.log("Major handles crisis:", error);
    }
}
</code></pre>
<p>This was the journey of Promises in JS. I tried my best to explian it in a story form to make you understand what happens in Promises behind the scenes. Instead of using a lot of .then() in modern codes we use async and await to make our code maintainable and readable which handles all of these promised itself.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding How Browsers Work: A Beginner's Guide to Browser Internals]]></title><description><![CDATA[What is a Browser, Really?
Beyond just "opening websites," a browser is a specialized piece of software designed to request, retrieve, and render content from the internet. It takes raw text (HTML/CSS) and transforms it into a visual experience you c...]]></description><link>https://blog.balochcoder.codes/browser</link><guid isPermaLink="true">https://blog.balochcoder.codes/browser</guid><category><![CDATA[Browsers]]></category><category><![CDATA[C#]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Cohort2026]]></category><category><![CDATA[#balochcoder]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Sun, 15 Feb 2026 17:58:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178223288/ba9038b5-f340-4590-9c68-f518d8ac9e83.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-what-is-a-browser-really">What is a Browser, Really?</h3>
<p>Beyond just "opening websites," a browser is a specialized piece of software designed to <strong>request, retrieve, and render</strong> content from the internet. It takes raw text (HTML/CSS) and transforms it into a visual experience you can interact with.</p>
<h3 id="heading-the-architecture-a-team-of-specialists">The Architecture: A Team of Specialists</h3>
<p>A browser isn't one single program; it’s a collection of components working in harmony.</p>
<ul>
<li><p><strong>User Interface (UI):</strong> This is everything you see that <em>isn't</em> the website itself—the address bar, back/forward buttons, and tabs.</p>
</li>
<li><p><strong>Browser Engine:</strong> The "manager" that coordinates actions between the UI and the Rendering Engine.</p>
</li>
<li><p><strong>Rendering Engine:</strong> The "artist" that paints the website on your screen. Chrome uses <strong>Blink</strong> (part of Chromium), while Firefox uses <strong>Gecko</strong>.</p>
</li>
<li><p><strong>Networking:</strong> The "courier" that fetches resources like HTML, CSS, and images using protocols like <strong>TCP</strong> and <strong>HTTP</strong>.</p>
</li>
<li><p><strong>JavaScript Engine:</strong> The "brain" that handles logic. For example, Chrome uses the <strong>V8 Engine</strong>.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178022406/aa17cd1b-da67-4cfe-9b2b-261eab50f026.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-journey-from-url-to-pixels">The Journey: From URL to Pixels</h3>
<p>What happens after you type a URL and press Enter? Once the <strong>Networking</strong> component fetches the HTML file, the Rendering Engine starts its work.</p>
<h4 id="heading-1-parsing-and-building-the-dom">1. Parsing and Building the DOM</h4>
<p>The browser can't "read" HTML like a human. It has to <strong>parse</strong> it—which means breaking it down into a structure it understands.</p>
<ul>
<li><p><strong>HTML Parsing:</strong> The browser reads the tags and creates a <strong>DOM (Document Object Model)</strong>.</p>
</li>
<li><p><strong>The Analogy:</strong> Think of the DOM as a <strong>Tree Structure</strong> where the <code>&lt;html&gt;</code> tag is the trunk and every other tag is a branch.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178041108/bc5051bb-831d-41ec-a706-8062df8ff896.png" alt class="image--center mx-auto" /></p>
<h4 id="heading-2-css-parsing-and-the-cssom">2. CSS Parsing and the CSSOM</h4>
<p>While building the DOM, the browser finds CSS files. It parses these into a <strong>CSSOM (CSS Object Model)</strong>. This is a separate map that tells the browser what colors and fonts belong to which parts of the DOM.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178091400/c6bc6655-5b90-42b1-8882-684d10b87ce5.png" alt class="image--center mx-auto" /></p>
<h4 id="heading-3-combining-into-the-render-tree">3. Combining into the Render Tree</h4>
<p>Now, the browser joins the DOM (structure) and the CSSOM (style) together to create the <strong>Render Tree</strong>. This tree only contains the things that will actually be visible on your screen.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178064124/46a2463f-56fd-4b4e-80f8-cfc33c4cfd88.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-final-stages-layout-and-paint">The Final Stages: Layout and Paint</h3>
<p>Once the Render Tree is ready, the browser still doesn't know <em>where</em> things go on the screen.</p>
<ul>
<li><p><strong>Layout (Reflow):</strong> The browser calculates the exact coordinates and size of every element. It asks, "How wide is this box?" and "Where does this text wrap?"</p>
</li>
<li><p><strong>Painting:</strong> Finally, the browser fills in the pixels with colors, borders, and images.</p>
</li>
<li><p><strong>Display:</strong> The finished "painting" is sent to your screen.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178137877/865e5f91-7d18-4f32-98d1-d7c0cf43e1c9.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-a-simple-note-on-parsing">A Simple Note on Parsing</h3>
<p>You might wonder: <em>What is parsing?</em> Imagine a math expression: <code>2 + 3 * 5</code>. To solve it, your brain "parses" it by identifying the numbers and the operators, then building a mental order of operations. The browser does the same with code!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178160618/76f252f8-569d-4027-9f65-9767ecf16a43.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>Building a website is like writing a script for a play. The <strong>HTML</strong> is the script, the <strong>CSS</strong> is the costume design, and the <strong>Browser</strong> is the director who takes all that information to put on the final performance!</p>
<p>Just as you learned that <strong>JavaScript</strong> works through a <strong>Global Execution Context</strong>, the browser works through a <strong>Rendering Pipeline</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178187395/d6adbf66-184e-498d-afb6-fad6ffcb1c39.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[A Beginner's Guide to CSS Selectors for Exact Element Targeting]]></title><description><![CDATA[How do we tell the browser to make a specific heading orange or a specific paragraph bold? This is where CSS Selectors come in. Think of selectors as a way to "point" at the elements you want to style.
Why Do We Need Selectors?
Imagine you are in a b...]]></description><link>https://blog.balochcoder.codes/css-selectors</link><guid isPermaLink="true">https://blog.balochcoder.codes/css-selectors</guid><category><![CDATA[CSS]]></category><category><![CDATA[css_selector]]></category><category><![CDATA[Cohort2026]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[#balochcoder]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Sun, 15 Feb 2026 14:01:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771164004539/d0fd2a63-f50d-4532-b064-9b83e75fadb7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>How do we tell the browser to make a specific heading orange or a specific paragraph bold? This is where <strong>CSS Selectors</strong> come in. Think of selectors as a way to "point" at the elements you want to style.</p>
<h2 id="heading-why-do-we-need-selectors">Why Do We Need Selectors?</h2>
<p>Imagine you are in a bus full of people. If you shout “Hey you” everyone might look at you. If you want to call a specific person to look at you then you need to call him by his name or by pointing out him by his shirt color.</p>
<p>CSS selectors work exactly the same way. They allow you to target specific parts of your HTML without affecting the rest of the page. You can target an specific element to add styling.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771163342308/3abaa532-1d3f-4102-b21e-1dc11403c392.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-the-big-three-element-class-and-id">The Big Three: Element, Class, and ID</h2>
<h3 id="heading-the-element-selector">The Element Selector</h3>
<p>This targets all elements of a specific type. It’s the "shouting in a bus" approach.</p>
<ul>
<li><strong>Example:</strong> <code>p { color: orange; }</code> will make every single paragraph on your page orange.</li>
</ul>
<h3 id="heading-the-class-selector">The Class Selector (<code>.</code>)</h3>
<p>Classes are like "groups" or "roles." You can give the same class to multiple elements. In CSS you target a class by putting a dot <code>.</code> before the name.</p>
<ul>
<li><p><strong>Example:</strong> <code>.highlight { background-color: yellow; }</code></p>
</li>
<li><p><strong>Use Case:</strong> Use this when you want several different items (like a button and a link) to share the same style.</p>
</li>
</ul>
<h3 id="heading-the-id-selector">The ID Selector (<code>#</code>)</h3>
<p>An ID is a unique name. On a single webpage an ID should only be used <strong>once</strong>. In CSS, you target an ID by using a hashtag <code>#</code> to select an element.</p>
<ul>
<li><p><strong>Example:</strong> <code>#main-header { font-size: 32px; }</code></p>
</li>
<li><p><strong>Use Case:</strong> Use this for a one-of-a-kind element, like your website's main logo or navigation bar.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771163645669/67140748-a765-4765-8f73-cb2ab85b7d2f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-advanced-targeting-group-and-descendant">Advanced Targeting: Group and Descendant</h2>
<h3 id="heading-group-selectors">Group Selectors</h3>
<p>If you want the same style for your <code>h1</code>, <code>h2</code>, and <code>p</code>, you don't need to write three separate rules. You can group them with a comma and then you can easily apply the css styling to all of them.</p>
<ul>
<li><strong>Example:</strong> <code>h1, h2, p { text-align: center; }</code></li>
</ul>
<h3 id="heading-descendant-selectors">Descendant Selectors</h3>
<p>Sometimes you only want to style an element if it is <em>inside</em> another specific element.</p>
<ul>
<li><p><strong>Example:</strong> <code>div p { color: gray; }</code></p>
</li>
<li><p>Such as in this case only those paragraphs color will be gray which are inside the div element.</p>
</li>
</ul>
<h2 id="heading-basic-selector-priority">Basic Selector Priority</h2>
<p>What happens if you tell a paragraph to be orange using an <strong>Element selector</strong>, but then tell it to be red using a <strong>Class selector</strong>?</p>
<p>CSS has a "Weight" system (called Specificity):</p>
<ol>
<li><p><strong>ID</strong> is the heaviest (wins most battles).</p>
</li>
<li><p><strong>Class</strong> is medium weight.</p>
</li>
<li><p><strong>Element</strong> is the lightest.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[HTML Elements Explained: The Essential Structure of the Web]]></title><description><![CDATA[Behind the every beautiful website HTML plays a crucial role by builing the cor structure of the site. HTML (HyperText Markup Language) works as the Skeleton of a website. It does not handle the styling and logic part of the site but makes the entire...]]></description><link>https://blog.balochcoder.codes/html-tags</link><guid isPermaLink="true">https://blog.balochcoder.codes/html-tags</guid><category><![CDATA[HTML5]]></category><category><![CDATA[HTML tags ]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Cohort2026]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[#balochcoder]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Sun, 15 Feb 2026 13:34:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771162350319/528e4a61-5614-41df-99d9-03928ce8f114.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Behind the every beautiful website HTML plays a crucial role by builing the cor structure of the site. <strong>HTML</strong> (HyperText Markup Language) works as the Skeleton of a website. It does not handle the styling and logic part of the site but makes the entire structure of the website. It decides where the texts, images and headings render.</p>
<h2 id="heading-what-is-an-html-tag">What is an HTML Tag?</h2>
<p>Think of a <strong>Tag</strong> as a set of instructions for the browser. A tag tells the browser that the text inside here should be treated as a specific type of content. Such as if it is a heading then it will be treated as a heading.</p>
<p>Most tags come in pairs:</p>
<ul>
<li><p><strong>Opening Tag (</strong><code>&lt;p&gt;</code>): Tells the browser where the instruction starts.</p>
</li>
<li><p><strong>Closing Tag (</strong><code>&lt;/p&gt;</code>): Tells the browser where the instruction ends (notice the forward slash <code>/</code>).</p>
</li>
<li><p><strong>Content:</strong> The actual text or image sitting between the tags.</p>
</li>
</ul>
<h2 id="heading-tag-vs-element-whats-the-difference">Tag vs. Element: What’s the Difference?</h2>
<p>These terms are often used changeably but there is a bit different:</p>
<ul>
<li><p><strong>The Tag</strong> is just the piece of code like <code>&lt;p&gt;</code> or <code>&lt;/p&gt;</code>.</p>
</li>
<li><p><strong>The Element</strong> is the whole package: the opening tag + the content + the closing tag.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771161683616/3b4c4d8e-5a07-42b0-90d7-22eb0d02bce3.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-self-closing-void-elements">Self-Closing (Void) Elements</h2>
<p>Remember every element doesn’t need a closing tag. But some elements don't contain any text; they just "exist" as a single instruction. These kind of elements are called <strong>Void Elements</strong>.</p>
<ul>
<li><strong>Example:</strong> The <code>&lt;br&gt;</code> tag (for a line break) or the <code>&lt;img&gt;</code> tag (for an image). You don't need to say "stop image" because the image is just a single point on the page.</li>
</ul>
<h2 id="heading-block-level-vs-inline-elements">Block-Level vs. Inline Elements</h2>
<p>This is the most important concept to understand how your website will actually look in the browser.</p>
<h3 id="heading-block-level-elements">Block-Level Elements</h3>
<p>These elements always start on a new line and take up the <strong>full width</strong> available. They are like big boxes stacked on top of each other.</p>
<ul>
<li><strong>Examples:</strong> <code>&lt;div&gt;</code>, <code>&lt;h1&gt;</code> to <code>&lt;h6&gt;</code>, <code>&lt;p&gt;</code>, <code>&lt;ul&gt;</code>.</li>
</ul>
<h3 id="heading-inline-elements">Inline Elements</h3>
<p>These elements do <strong>not</strong> start on a new line. They only take up as much width as necessary and sit "in line" with other content. Inline elements doesn’t acquire the entir with of the line.</p>
<ul>
<li><strong>Examples:</strong> <code>&lt;span&gt;</code>, <code>&lt;a&gt;</code> , <code>&lt;strong&gt;</code>.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771162204993/272e0390-3238-42ee-9b0d-65277d370953.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>When you start writing HTML code you will use these tags 90% of the time:</p>
<ul>
<li><p><code>&lt;div&gt;</code>: A generic container (Block).</p>
</li>
<li><p><code>&lt;span&gt;</code>: A generic container for text (Inline).</p>
</li>
<li><p><code>&lt;h1&gt;</code> - <code>&lt;h6&gt;</code>: Headings for your titles.</p>
</li>
<li><p><code>&lt;p&gt;</code>: For your standard paragraph text.</p>
</li>
<li><p><code>&lt;a&gt;</code>: For creating links to other pages.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How TCP and UDP Power Internet Data Transfer]]></title><description><![CDATA[The internet is built on rules. Just like we have traffic laws to prevent accidents, the internet uses protocols to ensure data gets from a server to your screen.
The two most famous delivery rules are TCP and UDP. While they both move data, they hav...]]></description><link>https://blog.balochcoder.codes/how-tcp-and-udp-power-internet-data-transfer</link><guid isPermaLink="true">https://blog.balochcoder.codes/how-tcp-and-udp-power-internet-data-transfer</guid><category><![CDATA[TCP]]></category><category><![CDATA[UDP]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Cohort2026]]></category><category><![CDATA[#balochcoder]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Sun, 01 Feb 2026 15:32:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769959622798/b86f2446-105c-4b29-bf31-450a0225e2df.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The internet is built on rules. Just like we have traffic laws to prevent accidents, the internet uses <strong>protocols</strong> to ensure data gets from a server to your screen.</p>
<p>The two most famous delivery rules are <strong>TCP</strong> and <strong>UDP</strong>. While they both move data, they have very different personalities. One is obsessed with being perfect the other is obsessed with being fast.</p>
<h2 id="heading-tcp-the-reliable-courier">TCP: The Reliable Courier</h2>
<p><strong>TCP (Transmission Control Protocol)</strong> is the "Safe and Steady" option. Before it sends any data, it performs a "handshake" to make sure the other side is ready.</p>
<p>If a piece of data gets lost along the way, TCP will stop everything and resend it until the message is complete and perfect.</p>
<ul>
<li><p><strong>Key Feature:</strong> Reliability.</p>
</li>
<li><p><strong>The Analogy:</strong> A <strong>Registered Courier</strong>. The delivery person won't leave until you sign for the package, ensuring nothing is missing.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769958847448/c3b0151c-d8e1-44f8-9e6b-6e687e2cd915.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-udp-the-live-broadcaster">UDP: The Live Broadcaster</h2>
<p><strong>UDP (User Datagram Protocol)</strong> is the "Fast and Furious" option. It doesn't wait for a handshake, and it doesn't care if you received the data or not. It just keeps "firing" data at you as fast as possible.</p>
<ul>
<li><p><strong>Key Feature:</strong> Speed.</p>
</li>
<li><p><strong>The Analogy:</strong> A <strong>Live Radio Broadcast</strong>. If you miss a word the host said because of static, the host doesn't stop and repeat it; they just keep talking.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769958972704/f0ed52e6-37b9-4a27-ba7e-c2319a66c870.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-key-differences">Key Differences</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Feature</strong></td><td><strong>TCP</strong></td><td><strong>UDP</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Reliability</strong></td><td>Guaranteed (Resends lost data)</td><td>No Guarantee (Data can be lost)</td></tr>
<tr>
<td><strong>Speed</strong></td><td>Slower (due to checks)</td><td>Very Fast</td></tr>
<tr>
<td><strong>Connection</strong></td><td>Must establish connection first</td><td>Just sends data immediately</td></tr>
<tr>
<td><strong>Order</strong></td><td>Arrives in the exact right order</td><td>Can arrive out of order</td></tr>
</tbody>
</table>
</div><h2 id="heading-when-to-use-which-real-world-examples">When to Use Which? (Real-World Examples)</h2>
<h3 id="heading-use-tcp-when-accuracy-is-everything">Use TCP When Accuracy is Everything:</h3>
<ul>
<li><p><strong>Web Browsing:</strong> You don't want half an image or missing text on a blog.</p>
</li>
<li><p><strong>File Downloads:</strong> If one bit of a <code>.exe</code> file is missing, the program won't run.</p>
</li>
<li><p><strong>Emails:</strong> You need every word of the message to arrive.</p>
</li>
</ul>
<h3 id="heading-use-udp-when-speed-is-everything">Use UDP When Speed is Everything:</h3>
<ul>
<li><p><strong>Video Calls (Zoom/WhatsApp):</strong> If a tiny bit of data is lost, the screen might flicker, but the call continues in real-time.</p>
</li>
<li><p><strong>Online Gaming:</strong> You need to know where your opponent is <em>right now</em>, not where they were two seconds ago.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769959383238/1d64d143-6270-4e6c-9b56-2cde206138e3.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-is-http-and-where-does-it-fit">What is HTTP and Where Does it Fit?</h2>
<p>This is where beginners often get confused. <strong>HTTP (Hypertext Transfer Protocol)</strong> is the "Language" we use to talk about websites.</p>
<p>However, HTTP is an <strong>Application-Level</strong> protocol. It doesn't actually move the data itself; it relies on <strong>TCP</strong> to do the heavy lifting.</p>
<blockquote>
<p><strong>Crucial Concept:</strong> HTTP sits <strong>on top</strong> of TCP. Think of HTTP as the <strong>Letter</strong> (the content) and TCP as the <strong>Envelope</strong> (the delivery method).</p>
</blockquote>
<h3 id="heading-is-http-the-same-as-tcp">Is HTTP the same as TCP?</h3>
<p>No! You can’t have a website without HTTP, but HTTP wouldn't work without TCP. HTTP tells the server <em>what</em> you want ("Give me index.html"), and TCP makes sure every piece of that file arrives at your computer without a single error.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769959672102/938401a8-1d07-4d66-a0e5-d36743d169fd.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[The Role of Networking Hardware in Internet Infrastructure]]></title><description><![CDATA[How does a YouTube video travel thousands of miles away from a server to your laptop? Do you thinks it’s magic but actually it’s not the case a series of hardware devices are used in this entire process each device does its specific job.
Think of the...]]></description><link>https://blog.balochcoder.codes/network-devices</link><guid isPermaLink="true">https://blog.balochcoder.codes/network-devices</guid><category><![CDATA[#balochcoder]]></category><category><![CDATA[network devices]]></category><category><![CDATA[networking]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Cohort2026]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Sat, 31 Jan 2026 12:08:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769861121246/dddfc404-3399-40e7-bddc-740f4e02ad69.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>How does a YouTube video travel thousands of miles away from a server to your laptop? Do you thinks it’s magic but actually it’s not the case a series of hardware devices are used in this entire process each device does its specific job.</p>
<p>Think of the internet as a massive highway system. To get from point A to point B, you need ramps, traffic lights, and security checkpoints. Let's break down the hardware that makes this possible.</p>
<p>Think of the internet like a highway. To get from point A to point B, you need traffic lights, security checkpoints and sopes. Let’s understand the hardware components which make this process possible.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769857243848/e4d4522c-03b8-4635-8b88-8403817ab6cf.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-the-modem-your-translator">The Modem: Your Translator</h2>
<p>Used to connect your home to the Internet Service Provider (ISP).</p>
<p>A Modem (short for Modulator-Demodulator) is the bridge between your house and your ISP. Your computer only understands binary language (0s and 1s) but the cables which are placed outside of your house oftern use <strong>analog</strong> signals.</p>
<p>The Modem works liek a translator. It sits at the edge of your house to translate the outside world language into a language which your devices can understand.</p>
<h2 id="heading-the-router-the-traffic-police">The Router: The Traffic Police</h2>
<p>The Router plays a crucial role to connect your home network (LAN) to the global network (WAN).</p>
<p>Once the Modem brings the interet to your house the Router task begins it uses IP address and a Routing Table to decide which is the best path for data to travel.</p>
<p>The Router is the <strong>Traffic Police</strong>. It looks at the destination address on every "packet" of data and directs it to the right place so that your sister’s Netflix movie doesn't end up on your laptop.</p>
<p>The Router is like <strong>Traffice Police.</strong> It figures out the diestination address on every <strong>packet</strong> and ensure to send the data on right place so that your friends’s movie doesn’t play on your device.</p>
<h2 id="heading-switch-vs-hub-smart-vs-simple">Switch vs. Hub: Smart vs. Simple</h2>
<p>Their role is to connect multiple devices in your local network.</p>
<p>Both are used to connect multiple devices using Ethernet cables but their working behavior look different</p>
<ul>
<li><p><strong>The Hub (The Simple One):</strong> When a Hub receives any data it doesn’t know the owner of data, it means it doesn’t know to whom it should send this data, So it sends it to every port. It is slower as compared to switch and has some security risks because everyone hears everyone else’s data.</p>
</li>
<li><p><strong>The Switch (The Smart One):</strong> A Switch learns the <strong>MAC Address</strong> (the unique hardware ID) of every conducted device. Because of knowing of each connected device MAC Address it only sends data to those which exacly need it.</p>
</li>
</ul>
<p>A Hub is like a person shouting a message in a crowded room. A Switch is like a private text message sent directly to one person.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769859871862/dfe814af-b96d-4756-ae0d-dfa54517a2f0.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-the-firewall-the-security-gate">The Firewall: The Security Gate</h2>
<p>On the basis of security rules firewall controls incoming and outgoing traffic.</p>
<p>A <strong>Firewall</strong> acts like a barrier between your internal network and the outside world. It looks at every packet of data then decide whether to let it in or block it based on set of some rules.</p>
<p>The Firewall is the <strong>Bouncer at a Club</strong>. If your name is not in the list then they don’t allow you to enter.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769860365004/36ba5906-c598-4b5f-a629-6363374d5348.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-the-load-balancer-the-master-coordinator">The Load Balancer: The Master Coordinator</h2>
<p>Distributing traffic across multiple servers to ensure speed and reliability.</p>
<p>In large scale web applications a single server can not handle millions of users at once so a Load Balance sits in front of your servers to manage the incoming requests. It spreads the incoming requests to all the servers.</p>
<p>The Load Balancer is like a <strong>Toll Booth Coordinator</strong>. It directs cars into the shortest line so that traffic keeps moving smoothly and no one lane gets backed up.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769860823929/9b65e262-cf10-4514-ac03-34daf0144d9d.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-putting-it-all-together-a-real-world-setup">Putting It All Together: A Real-World Setup</h2>
<p>In a production environment for a software engineer, the journey looks like this:</p>
<ol>
<li><p>A user's request hits the <strong>Internet</strong>.</p>
</li>
<li><p>It passes through a <strong>Firewall</strong> for safety.</p>
</li>
<li><p>A <strong>Load Balancer</strong> decides which server is the least busy.</p>
</li>
<li><p>A <strong>Router</strong> directs the request to the correct data center rack.</p>
</li>
<li><p>A <strong>Switch</strong> delivers the data to the specific physical server where your code is running.</p>
</li>
</ol>
<h2 id="heading-why-this-matters-for-developers">Why This Matters for Developers</h2>
<p>Understanding these devices helps you create better software. Suppose if your app is slow, it might not be your code. There could be a problem with the <strong>Load Balancer</strong> or a slowdown at the <strong>Switch</strong>. When we mention "<strong>The Cloud</strong>" ite means we're talking about thousands of these devices working together in a big warehouse.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769861028458/2664b6f6-3505-413b-ad1a-94250986445d.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[The Risks of Pendrive Use: How Version Control Can Save Your Work]]></title><description><![CDATA[If you’ve ever worked with a team on a single project or a piece of code, you’ve probably lived through a digital horror story without even realizing it.
Before we had version control tools like Git, developers managed their code using pendrive metho...]]></description><link>https://blog.balochcoder.codes/version-control</link><guid isPermaLink="true">https://blog.balochcoder.codes/version-control</guid><category><![CDATA[version control]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Sat, 31 Jan 2026 09:13:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769850611361/c52b066d-9233-4075-a5fd-03bf4a5bd6b7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you’ve ever worked with a team on a single project or a piece of code, you’ve probably lived through a digital horror story without even realizing it.</p>
<p>Before we had version control tools like Git, developers managed their code using <strong>pendrive</strong> method. It was a very difficult time to collaborate and work easily on single project.</p>
<h2 id="heading-the-pendrive-analogy">The Pendrive Analogy</h2>
<p>Image gine you and your friends are working on a single project but you are not using control version you save your entire work on a pendrive and pass it to eachother in that room.</p>
<ol>
<li><p><strong>Developer One</strong> finishes the home page and hands the pendrive to <strong>Developer two</strong>.</p>
</li>
<li><p><strong>Developer Two</strong> starts working on the card section.</p>
</li>
<li><p>While <strong>Developer One</strong> realizes they made a mistake in the card but they can't fix it because they don't have the pendrive anytime if the need to fix this error they need the pendrive.</p>
</li>
</ol>
<p>Using a pendrive to track your work and project history is becomes very difficult for a team to work on a single project.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769850374185/2e58e179-8d8a-4cf9-9a4c-bbb37d517df2.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-problems-faced-before-version-control">Problems Faced Before Version Control</h2>
<p>Befor Version Control Systems developers faced mostly three major problems:</p>
<h3 id="heading-the-finalv2reallyfinal-folder">The "Final_v2_REALLY_FINAL" Folder</h3>
<p>Without having a system which tracks your project history they used to create multiple folders to track their changes to know which file’s code works properly and the file directory looks like this.</p>
<ul>
<li><p><code>my_website_v1</code></p>
</li>
<li><p><code>my_website_v2</code></p>
</li>
<li><p><code>my_website_v2_final</code></p>
</li>
<li><p><code>my_website_FIXED_dont_delete</code></p>
</li>
</ul>
<p>By follow this pattern they got confused which file contains the working code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769850414810/7304520e-f17a-424f-a792-661f121f800f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-the-overwrite-disaster">The Overwrite Disaster</h2>
<p>Imagine you and your friend both have a copy of a file named style.css. Suppose you change the color to blue and your friend change its font to <strong>Arial.</strong> If he sends his file to you and when you try to replace it your blue color is gone forever. There was no way to <strong>merge</strong> these two files.</p>
<h2 id="heading-the-who-broke-it-mystery">The "Who Broke It?" Mystery</h2>
<p>If we look at in a large team where a website might suddenly stop working. Before version control it was almost impossible to know who changed which line of code and why he changed it because the history of code was not tracked but now. You couldn’t <strong>undo</strong> the mistake because the previous records were not saved.</p>
<h2 id="heading-why-version-control-became-mandatory">Why Version Control Became Mandatory</h2>
<p>Nowadays version control is knows as the backbone of modern software engineering. It solved the pendrive problem that developers paced in early days.</p>
<ul>
<li><p><strong>A Time Machine:</strong> You can jump back to any point in the history of your project.</p>
</li>
<li><p><strong>A Parallel Universe:</strong> You can work on a new feature in a "branch" without breaking the main website that users are currently visiting.</p>
</li>
<li><p><strong>A Master Ledger:</strong> It records exactly who changed every single character in the project.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769850514399/f3d9f071-3063-4553-8c19-14272e3683e3.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>Before version control, developers faced challenges such as managing multiple file versions, dealing with overwriting issues, and identifying the source of code errors. Version control provides essential features like project history tracking, branching for new features, and detailed change records, making it essentail in modern software engineering.</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Understanding the Inner Workings of Git]]></title><description><![CDATA[When you run git init command a hidden folder appears named .git. Mostly beginner developers treate this folder like an empty box and they think they should never touch this. But they don't know about the magic your entire project history is being ma...]]></description><link>https://blog.balochcoder.codes/inside-git</link><guid isPermaLink="true">https://blog.balochcoder.codes/inside-git</guid><category><![CDATA[Git]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[coding]]></category><category><![CDATA[Cohort2026]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Fri, 30 Jan 2026 17:20:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769793396727/47d24d51-8c95-4b98-8c75-97bd160ce726.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When you run git init command a hidden folder appears named .git. Mostly beginner developers treate this folder like an empty box and they think they should never touch this. But they don't know about the magic your entire project history is being managed in that single folder.</p>
<h3 id="heading-the-git-folder-the-brain-of-your-project">The .git Folder: The Brain of Your Project</h3>
<p>Everything Git knows about your project is stored inside the .git directory it's not just a simple folder, your complete project history is being tracked and saved inside it. If you delete this file then Git lose the context means it will no longer recognize it as a git repo.</p>
<p><strong>objects/:</strong> This is the most important part. It’s the "database" where all of your file content and history are stored.</p>
<p><strong>refs/:</strong> This stores pointers to your commits (like where main or head is currently pointing).</p>
<p><strong>index:</strong> This area is known as Staging Area. It’s a binary file used to track the messages that go into the commit.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769792844916/e344b03b-bce6-4d54-bd74-2f1b37991aed.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-three-git-objects-blobs-trees-and-commits">The Three Git Objects: Blobs, Trees, and Commits</h3>
<p>Git stores everything using three main types of objects. To keep things simple, think of them as Files, Folders, and Snapshots.</p>
<h3 id="heading-the-blob-the-file-content">The Blob (The File Content)</h3>
<p>Blob stands for Binary Large Object. Whenever you add a file to Git it doesn't care about the name of that file. It only cares about the content of that file then compresses that content and give it a unique ID. It generates a unique 40-character SHA-1 hash, known as an Object ID (OID). You can consider a Blob like a piece of paper but the paper doesn't have a name yet.</p>
<h3 id="heading-the-tree-the-folder-structure">The Tree (The Folder Structure)</h3>
<p>A Tree acts like a directory which map the Blob (file content) to their actual filenames. A Tree is like an envelope that says this piece of paper is called style.css.</p>
<h3 id="heading-commits">Commits</h3>
<p>A commit is like taking a shanpshot of your project at a specific point at a time. It points to a specific Tree and includes information of all the changes such as who made the change, when they made the change and why. It creates a chain of commit by rendering the history of commits.</p>
<h3 id="heading-how-git-tracks-changes">How Git Tracks Changes</h3>
<p>Git uses a math formula called SHA-1 to create a unique 40 character "Fingerprint" for every object. Enen though if you change a single line of code in your project the Fingerprint(Hash) changes completely.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769793237102/c5f8865c-1640-43e8-bf31-62ad34f5390f.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-internal-flow-add-and-commit">The Internal Flow: Add and Commit</h3>
<p>Let’s look what actually happens "backstage" when you run your two favorite commands:</p>
<h3 id="heading-when-you-run"><strong>When you run</strong></h3>
<pre><code class="lang-bash">git add &lt;filename&gt;
</code></pre>
<h3 id="heading-git-looks-at-your-file"><strong>Git looks at your file.</strong></h3>
<ul>
<li><p>It creates a Blob object for that content.</p>
</li>
<li><p>It updates the index file to say: "Hey, this Blob is ready to be committed."</p>
</li>
</ul>
<h3 id="heading-when-you-run-1">When you run</h3>
<pre><code class="lang-bash">git commit
</code></pre>
<ul>
<li><p>Git creates a Tree object to represent the structure of your project.</p>
</li>
<li><p>It creates a Commit object that points to that Tree.</p>
</li>
<li><p>It moves the HEAD pointer to this new commit.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769793380220/3703874c-7934-43fc-b254-b13e63c856cc.png" alt class="image--center mx-auto" /></p>
<p>Git is often treated like a series of magical commands including (push, pull, and commit). It is not as much complicated you just have to these basic commands to move forward.</p>
]]></content:encoded></item><item><title><![CDATA[A Step-by-Step Guide to Tracing DNS with dig]]></title><description><![CDATA[What is DNS and Why Name Resolution Exists?
Computers are great with numbers but they don't understand these plain texts on the other hand humans are great with names.
Name Resolution
Name Resolution is a the bridge between these two which is the pro...]]></description><link>https://blog.balochcoder.codes/dns-resolution</link><guid isPermaLink="true">https://blog.balochcoder.codes/dns-resolution</guid><category><![CDATA[#DNS Resolution]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[dns]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:40:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769780108146/2b221a26-a524-4d3f-97e0-10a34cc8fc79.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-dns-and-why-name-resolution-exists">What is DNS and Why Name Resolution Exists?</h2>
<p>Computers are great with numbers but they don't understand these plain texts on the other hand humans are great with names.</p>
<h2 id="heading-name-resolution">Name Resolution</h2>
<p>Name Resolution is a the bridge between these two which is the process of converting a human readable domain <a target="_blank" href="https://google.com"><code>google.com</code></a> into a machine readable IP address (142.250.190.46). Just imagine if this didn't exist then you had to memorize hundreds of random numbers just to browse each site.</p>
<h2 id="heading-dig-command-the-dns-detective">dig: command The DNS Detective</h2>
<p>The dig (Domain information Groper) command is a powerful command line tool for querying DNS servers. It is used by developers and network administrators. It gives detailed information about domain names, IP addresses, and various DNS records such as A, MX and CNAME.</p>
<h2 id="heading-the-root-name-servers">The Root Name Servers</h2>
<pre><code class="lang-bash">dig . NS
</code></pre>
<p>The journey starts at the Root. The dot (.) in the command represents teh root of the entire internet. When you run dig . NS it means you are asking for the NS (Nameservers) which manage the top of the hierarchy. Globally there are 13 logical root server addresses. They don't know where is <a target="_blank" href="http://google.com">google.com</a> but they know exactly who is the in charge of .com.</p>
<p>Once the Root Server tells you which "floor" to go to, you arrive at the TLD Name Servers. If you are looking for <code>google.com</code>, you must first talk to the .com TLD server.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769780083586/2364a8a0-4676-4fea-ab6c-cb0c667e5082.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-is-a-tld-server">What is a TLD Server?</h2>
<p>A Top-Level Domain (TLD) server is a specialized DNS server that maintains the "master list" for a specific domain extension. Whether it’s .com, .net, .org, or specialized ones like .codes (which you use for your blog), every extension has its own dedicated set of TLD servers.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769779943311/91e340b7-367c-4ab8-bdd9-cdd11e90e214.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-authoritative-name-servers">The Authoritative Name Servers</h3>
<pre><code class="lang-bash">dig google.com NS
</code></pre>
<p>The authoritative DNS server is the final destination of the IP of the domain that you are actually finding. This is known as the boss. When you run dig <a target="_blank" href="http://google.com">google.com</a> NS your see the servers that google has designated as the official source of truth. If a record is not found then it means it doesn't exist.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769779987598/2ee61a22-1ee1-4850-9d30-a2025e02a99c.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-final-answer">The Final Answer</h3>
<pre><code class="lang-bash">dig google.com
</code></pre>
<p>Finally we perform the full lookup. When you run dig <a target="_blank" href="https://google.com"><code>google.com</code></a> you will be able to see the entire DNS Resolution Flow in action. The output will render an Answer Section with an A Record. This is the IP address your browser uses to finally knock on Google's door.</p>
<h3 id="heading-how-this-works-in-the-real-world">How This Works in the Real World</h3>
<ul>
<li><p>When you type a URL into a browser a Recursive Resolver (usually provided by your ISP)<br />  does all the dig steps for you in milliseconds.</p>
</li>
<li><p>It asks the Root where .com is.</p>
</li>
<li><p>It asks the TLD where <a target="_blank" href="http://google.com">google.com</a> is.</p>
</li>
<li><p>It asks the Authoritative server for the IP address.</p>
</li>
<li><p>It hands that IP to your browser.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769780035760/5ae99889-3b94-4505-a4ce-ca6b2e31c041.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-why-this-matters-for-you">Why This Matters for You</h3>
<p>As a developer, understanding this hierarchy helps you debug Propagation. When you change your DNS records and things don't work immediately, it’s usually because a server somewhere in this chain is still <strong>"remembering"</strong> the old answer.</p>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: The Time Machine for Your Code]]></title><description><![CDATA[Have you ever worked on a project, made a huge mistake, and wished you could just hit "Undo" a hundred times? Or maybe you’ve saved files like main1.js, main2_.js, and main3.js.
What is Git? (The Digital Safety Net)
Git is a Distributed Version Contr...]]></description><link>https://blog.balochcoder.codes/git-basics</link><guid isPermaLink="true">https://blog.balochcoder.codes/git-basics</guid><category><![CDATA[Git]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Cohort2026]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Thu, 29 Jan 2026 23:53:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769730803492/7554e1bc-0116-4a4b-bd20-29cd1b856d09.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Have you ever worked on a project, made a huge mistake, and wished you could just hit "Undo" a hundred times? Or maybe you’ve saved files like main1.js, main2_.js, and main3.js.</p>
<h3 id="heading-what-is-git-the-digital-safety-net"><strong>What is Git? (The Digital Safety Net)</strong></h3>
<p>Git is a Distributed Version Control System that records changes to a file or set of files over time so that you can recall specific versions late.</p>
<p>Just think it is like a Time Machine for your project. It keeps track of every single change you make to your code. If your project got a bug which cause your project stop working don’t worry you can simply travel back in time to yesterday when everything was working perfectly in your project. Because it is "distributed," every developer working on the project has a full copy of this history on their own computer.</p>
<h3 id="heading-why-is-git-used"><strong>Why is Git Used?</strong></h3>
<p><strong>Collaboration:</strong><br />Multiple people can work on a single project at the same time without overwriting each other’s work they can work at the same time on the same project.</p>
<p><strong>Experimentation</strong>:<br />You can create a branch to experiment a new feature if it works properly then you can merge this to the actual project otherwise you can delete it if it doesn’t work.</p>
<p><strong>Traceability:</strong><br />You can see exactly all the changes of your code who changed which line of code and why he changed it you can track all the activities.</p>
<h3 id="heading-git-basics-the-three-pillars"><strong>Git Basics: The Three Pillars</strong></h3>
<p>To understand git first of all you need to know three steps.</p>
<p><strong>Working Directory:</strong> It is your actual place where you write your code.</p>
<p><strong>Staging Area: The staging area is file it generally contained in your Git directory, now any changes that will be saved in your next commit they will be saved in this file.</strong></p>
<p><strong>Repository:</strong> This is the final stage where Git permanently store the history of your project forever. Your all commit will be stored here.</p>
<h3 id="heading-essential-git-terminologies">Essential Git Terminologies</h3>
<p><strong>Repository</strong> (Repo): The project folder that Git is tracking.<br /><strong>Commit</strong>: A snapshot of your code at a specific point in time. Think of it like a "Save Game" point.<br /><strong>Branch</strong>: A separate version of the main code.<br /><strong>HEAD</strong>: A pointer that tells you which branch or commit you are currently looking at.</p>
<h3 id="heading-common-git-commands"><strong>Common Git Commands</strong></h3>
<p>Here is the workflow you will use 90% of the time:</p>
<h3 id="heading-1-starting-a-project"><strong>1. Starting a Project</strong></h3>
<pre><code class="lang-bash">git init
</code></pre>
<p>This tells Git: "Start watching this folder." It creates a hidden <code>.git</code> folder that stores all your history.</p>
<h3 id="heading-2-checking-the-status">2. Checking the Status</h3>
<pre><code class="lang-bash">git status
</code></pre>
<p>This is the most helpful command. It tells you which files have changed and what room (Working, Staging, or Repo) they are in.</p>
<h3 id="heading-3-adding-to-the-staging-area">3. Adding to the Staging Area</h3>
<pre><code class="lang-bash">git add filename.js
<span class="hljs-comment"># Or use 'git add .' to add everything</span>
</code></pre>
<p>This moves your changes from the <strong>Working Directory</strong> to the <strong>Staging Area</strong>.</p>
<h3 id="heading-4-saving-the-snapshot">4. Saving the Snapshot</h3>
<pre><code class="lang-bash">git commit -m <span class="hljs-string">"Fixed the login button bug"</span>
</code></pre>
<p>This moves your changes into the <strong>Repository</strong>. The <code>-m</code> stands for "message" always write a clear message so in future you know what you did!</p>
<h3 id="heading-5-viewing-the-timeline">5. Viewing the Timeline</h3>
<pre><code class="lang-bash">git <span class="hljs-built_in">log</span>
</code></pre>
<p>This shows you a list of every commit ever made in the project.</p>
<h3 id="heading-a-simple-developer-workflow">A Simple Developer Workflow</h3>
<p>Imagine you are starting a new feature for your website:</p>
<ol>
<li><p><strong>Work:</strong> You edit <code>index.html</code>.</p>
</li>
<li><p><strong>Check:</strong> You run <code>git status</code> to see your changes in red.</p>
</li>
<li><p><strong>Stage:</strong> You run <code>git add index.html</code>. Now <code>git status</code> shows it in green.</p>
</li>
<li><p><strong>Save:</strong> You run <code>git commit -m "Added a new navigation bar"</code>.</p>
</li>
<li><p><strong>Relax:</strong> Your work is now safely recorded in the "Vault."</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[What is cURL? Sending Messages to Servers Without a Browser]]></title><description><![CDATA[What is cURL
cURL which stands for client URL and it can be written as curl. It is a command line tool used to transfer file with a URL syntax. It supports a number of protocols including HTTP, HTTPS, FTP and many more. While a browser is designed to...]]></description><link>https://blog.balochcoder.codes/curl</link><guid isPermaLink="true">https://blog.balochcoder.codes/curl</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Cohort2026]]></category><category><![CDATA[curl]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Thu, 29 Jan 2026 22:21:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769725170315/b9f0aa1b-b129-41bb-bde1-06860690dae7.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-curl">What is cURL</h2>
<p>cURL which stands for client URL and it can be written as curl. It is a command line tool used to transfer file with a URL syntax. It supports a number of protocols including HTTP, HTTPS, FTP and many more. While a browser is designed to show you a webpage but cURL is designed to give you the raw data.</p>
<h2 id="heading-why-do-programmers-need-curl">Why Do Programmers Need cURL?</h2>
<p><strong>You might wonder:</strong> Why should we use terminal if browsers are already in the market. Programmers use cURL because:<br /><strong>It's Fast:</strong> You don't have to wait for images to load.<br /><strong>It’s Automatable:</strong> You can write a script that uses cURL to check a website every hour automatically.</p>
<p><strong>It’s Great for APIs:</strong> When you're building an app that needs weather data or stock prices, before writing your actual code you use cURL to check your API.</p>
<h2 id="heading-making-your-first-request"><strong>Making Your First Request</strong></h2>
<p>Open your terminal (Command Prompt on Windows or Terminal on Mac/Linux) and type this simple command:</p>
<pre><code class="lang-bash">curl https://www.google.com
</code></pre>
<p>When you make a simple curl request by default it will always takes a GET request. Such as we are sending a cURL request to <code>google.com</code> so it asks the server for the default information about this URL and Google replies with the HTML data</p>
<h2 id="heading-understanding-request-and-response"><strong>Understanding Request and Response</strong></h2>
<p>Request: Any time we send a cURL request to <a target="_blank" href="http://google.com">google.com</a> behind the scene cURL sends an HTTP request as a GET request to <a target="_blank" href="http://google.com">google.com</a>.</p>
<p><strong>Response:</strong> This is what server sends back to us means we receive in return. It usually includes two thing status code and body.</p>
<p><strong>Status Code:</strong> A number telling you if it worked (e.g., 200 OK means success, 404 Not Found means the page is missing).</p>
<p><strong>Body:</strong> The actual data that we get in return (i.e: HTML, JSON or TEXT).</p>
<h2 id="heading-talking-to-apis-get-vs-post"><strong>Talking to APIs (GET vs. POST)</strong></h2>
<p>In the world of web development we mostly do two things get information or send information</p>
<p><strong>The GET Request</strong><br />The GET request is used to fetch data from the server as we know cURL uses GET request by default to fetch the data from the servers such as checking the current weather from an API.</p>
<p><strong>The POST Request</strong><br />You don't always get data sometimes you need to send data so you need to use POST request which is used to send data such as submitting a form or a comment on a blog post.</p>
<h2 id="heading-common-mistakes-beginners-make"><strong>Common Mistakes Beginners Make</strong></h2>
<p>Forgetting the protocol like (http:// or https://).<br />Missing headers when calling APIs - Forgetting Content-Type or Authorization is a common issue.<br />Sending JSON without -d. Writing JSON but forgetting -d means no body is sent at all.<br />Using single quotes wrong on Windows - Single quotes work in Linux/macOS, but can break in Windows CMD.<br />Assuming curl behaves like Postman - Curl is raw and strict. No auto headers, no body formatting, no retries unless you ask for it.</p>
]]></content:encoded></item><item><title><![CDATA[Behind the Scenes of the Internet: Your Friendly Guide to DNS Records]]></title><description><![CDATA[When you type amazon.com or google.com into the search bar and hit enter, it might seem like magic, but there's actually a lot happening behind the scenes.
The Internet’s Phonebook
Computer doesn't understand the domin name of sites instead it uses I...]]></description><link>https://blog.balochcoder.codes/dns-records</link><guid isPermaLink="true">https://blog.balochcoder.codes/dns-records</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns]]></category><category><![CDATA[dns-records]]></category><dc:creator><![CDATA[Asim Ali]]></dc:creator><pubDate>Wed, 28 Jan 2026 16:56:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769619042962/b1a9b061-85a3-4a33-9246-2862dded2780.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When you type <a target="_blank" href="http://amazon.com"><strong>amazon.com</strong></a> or <a target="_blank" href="http://google.com"><strong>google.com</strong></a> into the search bar and hit enter, it might seem like magic, but there's actually a lot happening behind the scenes.</p>
<p><strong>The Internet’s Phonebook</strong></p>
<p>Computer doesn't understand the domin name of sites instead it uses <strong>IP Addresses</strong> (which look like <strong>172.217.14.78</strong>) to communicate. Every server has a unique IP Address. For humans it becomes difficult to memorize long strings so instead of remembering these IP Addresses we use DNS.</p>
<h3 id="heading-dns-domain-name-system"><strong>DNS (Domain Name System)</strong></h3>
<p>DNS is the bridge between humans and computers. It is called the phonebook of the internet. When you type a domain name in your browser your computer calls up the DNS phonebook and ask it about the IP address for that domain name. DNS looks it up then provide the IP address to connect your computer.</p>
<h3 id="heading-why-we-need-records"><strong>Why We Need Records</strong></h3>
<p>If DNS is a phonebook then a DNS Record is a single entry in that book. A domain name doesn’t only display a website. You might want to receive emails at that domian. Because a domain has different jobs so the phonebook needs different types of entries. You can not use an email record to load a website and you can not use a mailing address to make a phone call.</p>
<h3 id="heading-the-manager-ns-record-name-server">The “Manager” NS Record (Name Server)</h3>
<p>Before finding the website we need to know the owner of the information.<br /><strong>The Problem</strong>: Who holds the <strong>master phonebook</strong> for this specific domain?<br /><strong>The Analogy:</strong> The Librarian.</p>
<p>The NS record doesn’t tell you where the website is. It only tell the internet which company manages your DNS settings. The registrar (like GoDaddy) sets themeselves as the manager whenever you buy a domain. Whenever you change NS records it means you are telling the internet that I have hired a new librarian go and ask them for my information.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769602262563/8341d0f9-7f84-4c64-b100-b1bba97b2259.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-street-address-a-record">The “Street Address” A Record</h3>
<p>This is known as the most important record for getting a website to load.<br /><strong>The Problem:</strong> Where is the server hosting this website located (using the standsard internet language)?<br /><strong>The Analogy:</strong> Your house street address (e.g 123 Main Street).</p>
<p>The “A” stands for Address. It maps your domain name directly to an IPv4 Address (the standard numbers and dots addresses). To display your site to users you need an A record.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769602497898/b9296bc4-bfc2-48c7-ad5f-24664ce822ff.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-modern-gps-aaaa-record">The “Modern GPS” AAAA Record</h3>
<p><strong>The Problem:</strong> The Internet is running out of standard addresses how do we use the newer system?<br /><strong>The Analogy:</strong> A highly precise, modern GPS coordinate.</p>
<p>The internet is upgrading to IPv6 which user much longer and complex address. The “AAAA” record maps the domain name to this modern IPv6 address. Nowadays many sites use these both A and AAAA records to make sure everyone can access the site.</p>
<h3 id="heading-the-nickname-cname-record">The “Nickname” CNAME Record</h3>
<p>The Problem: I want one name to just point to another name not a specific number.<br />The Analogy: A forwarding address, or a contact in your phone that just says “Hey dear.”</p>
<p>CNAME stands for “Cononical Name.” It creates an alias.</p>
<p>A common use is for the “www” version of your site. You often set up a CNAME for <code>www.yourdomain.com</code> that just points to <code>your.domain.com</code>. It tells the browser whatever the main domain does the “www” version should copy that.</p>
<p><strong>Common Confusion: A vs. CNAME</strong></p>
<p>An A Record connects a name to a phone number (IP Address). A CNAME Record connects a name to another name.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769609218957/bfd7a4c0-148a-4fbc-8bf9-d7598ba4eb9a.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-post-office-mx-record">The “Post Office” MX Record</h3>
<p><strong>The Problem:</strong> If someone sends an email to <code>@yourdomain.com</code>, where it should be delivered?<br /><strong>The Analogy</strong>: The local post office branch that handles your mail.</p>
<p>MX stands for “mail Mail Exchange” record is a DNS entry that tells the internet which mail server is responsible for receiving email on behalf of your domain. Your website might live on a single server but your email might be handled by a different company (like Google Workspace or Microsoft 365).</p>
<p><strong>Confusion Between NS vs MX Records</strong><br />NS records manage your entire domain’s DNS settings and MX records only handle email routing.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769618115434/36469ab8-86c0-48a6-9d35-1409cbca4f7b.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-sticky-note-txt-record">The “Sticky Note” TXT Record</h3>
<p><strong>The Problem</strong>: I need to store some text information to prove ownership or secure my email.<br /><strong>The Analogy</strong>: A sticky note on a file containing extra details.</p>
<p>The DNS text (TXT) record lets a domain owner to enter text into the DNS and it stores the text in the form of strings. A single domain cah have many TXT records. It helps to authenticate weather a message is from a trusted source or not.</p>
<p><strong>How do these work for a single website? Let’s imagine Asim’s site</strong></p>
<p>Asim buys the domain <code>balochcoder.com</code>. Here is what his DNS setup might look like":</p>
<p><strong>Ns Records:</strong> Point to her registrar, who manages the list.<br /><strong>A Record:</strong> Points <code>balochcoder.com</code> to the IP address of the server hosting his website pictures.<br /><strong>CNAME Record:</strong> Points <code>www.balochcoder.com</code> to <code>balochcoder.com</code> so both work perfectly.<br /><strong>MX Records:</strong> Point to Google's mail servers, so he receives email at <code>subscriber@balochcoder.com</code>.<br /><strong>TXT Record:</strong> A verification code he added to prove to Instagram that the website belongs to him.</p>
<p>All these records live peacefully side-by-side in the internet's phonebook to ensure that Asim’s site work properly.</p>
]]></content:encoded></item></channel></rss>