<?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[Aniket Dey]]></title><description><![CDATA[Aniket Dey]]></description><link>https://blog.aniketdey.in</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1762845780583/050e93ba-d49c-4dfd-a1e8-8572246031c1.png</url><title>Aniket Dey</title><link>https://blog.aniketdey.in</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 12:49:59 GMT</lastBuildDate><atom:link href="https://blog.aniketdey.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How Does a Browser Know Where a Website Lives?]]></title><description><![CDATA[When you type www.aniketdey.in into your browser and hit Enter, it feels like magic. In a split second, a website appears. But behind the scenes, there’s a frantic game of "connect the dots" happening.
The big question is: How does your browser know ...]]></description><link>https://blog.aniketdey.in/how-does-a-browser-know-where-a-website-lives</link><guid isPermaLink="true">https://blog.aniketdey.in/how-does-a-browser-know-where-a-website-lives</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Dey]]></dc:creator><pubDate>Mon, 26 Jan 2026 18:30:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769693900889/48325ea6-1a99-47d7-9aca-5495e19abfa2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When you type <a target="_blank" href="http://www.aniketdey.in"><code>www.aniketdey.in</code></a> into your browser and hit Enter, it feels like magic. In a split second, a website appears. But behind the scenes, there’s a frantic game of "connect the dots" happening.</p>
<p>The big question is: <strong>How does your browser know where that website actually lives?</strong></p>
<p>The answer is <strong>DNS</strong>.</p>
<h3 id="heading-what-is-dns-the-phonebook-analogy"><strong>What is DNS? (The "Phonebook" Analogy)</strong></h3>
<p>Think of the internet as a massive city. Computers are great with numbers, but humans are great with names.</p>
<ul>
<li><p><strong>Humans</strong> remember: <a target="_blank" href="http://google.com"><code>google.com</code></a></p>
</li>
<li><p><strong>Computers</strong> need: <code>142.250.190.14</code> (This is an IP address)</p>
</li>
</ul>
<p><strong>DNS (Domain Name System)</strong> is the translator. It’s the internet's phonebook. You look up "Mom" in your contacts, and your phone knows to dial her specific 10-digit number. DNS does the exact same thing for the web.</p>
<hr />
<h3 id="heading-why-do-we-need-different-records"><strong>Why Do We Need Different "Records"?</strong></h3>
<p>A phonebook doesn't just list names; it might list a home address, a work number, or an email. DNS records are just different "fields" in that contact card.</p>
<p>Each record handles one specific job. Let’s walk through them—no jargon, just common sense.</p>
<h4 id="heading-1-ns-record-the-manager"><strong>1. NS Record: The Manager</strong></h4>
<p><strong>NS = Name Server.</strong> The NS record answers: <em>"Who is in charge of this domain?"</em></p>
<ul>
<li><p><strong>Real-life example:</strong> Imagine a massive office building. The receptionist doesn't give you the files you need; they tell you which floor and which manager has them.</p>
</li>
<li><p><strong>The Job:</strong> It tells the internet, "For anything related to <a target="_blank" href="http://aniketdey.in"><code>aniketdey.in</code></a>, go ask these specific servers."</p>
</li>
</ul>
<h4 id="heading-2-a-record-the-home-address"><strong>2. A Record: The Home Address</strong></h4>
<p><strong>A = Address.</strong> This is the most important one. It answers: <em>"What is the actual GPS coordinate (IPv4) for this site?"</em></p>
<ul>
<li><p><strong>The Connection:</strong> <a target="_blank" href="http://aniketdey.in"><code>aniketdey.in</code></a> → <code>93.184.216.34</code></p>
</li>
<li><p><strong>The Job:</strong> If your website loads, an A record is doing the heavy lifting. It connects the name to the physical server.</p>
</li>
</ul>
<h4 id="heading-3-aaaa-record-the-new-neighborhood"><strong>3. AAAA Record: The New Neighborhood</strong></h4>
<p>Think of this as the "A Record" for the modern world. IPv4 addresses (the old numbers) are running out, so we created IPv6.</p>
<ul>
<li><p><strong>A Record</strong> = Old school (IPv4)</p>
</li>
<li><p><strong>AAAA Record</strong> = High-tech (IPv6)</p>
</li>
<li><p><em>Don't sweat this one—your browser usually picks the best one automatically.</em></p>
</li>
</ul>
<h4 id="heading-4-cname-record-the-nickname"><strong>4. CNAME Record: The Nickname</strong></h4>
<p><strong>CNAME = Canonical Name.</strong> This answers: <em>"This name is just an alias—go look at the main name instead."</em></p>
<ul>
<li><p><strong>Example:</strong> You might have <a target="_blank" href="http://www.aniketdey.in"><code>www.aniketdey.in</code></a> and <a target="_blank" href="http://blog.aniketdey.in"><code>blog.aniketdey.in</code></a>. Instead of giving them both IP addresses, you tell the <code>www</code> version: "Just do whatever the main <a target="_blank" href="http://aniketdey.in"><code>aniketdey.in</code></a> is doing."</p>
</li>
<li><p><strong>Pro Tip:</strong> An A record points to a <strong>number (IP)</strong>. A CNAME points to another <strong>name</strong>.</p>
</li>
</ul>
<h4 id="heading-5-mx-record-the-mail-slot"><strong>5. MX Record: The Mail Slot</strong></h4>
<p><strong>MX = Mail Exchange.</strong> This answers: <em>"Where should I drop off the letters?"</em></p>
<ul>
<li><p><strong>The Logic:</strong> Often, your website lives on one server (like Vercel or Hostinger), but your emails live on another (like Gmail or Outlook).</p>
</li>
<li><p><strong>The Job:</strong> MX records make sure that when someone emails you, it doesn't get "delivered" to your website code by mistake.</p>
</li>
</ul>
<h4 id="heading-6-txt-record-the-sticky-note"><strong>6. TXT Record: The Sticky Note</strong></h4>
<p><strong>TXT = Text.</strong> These are essentially notes you leave for other services to read. They don't "do" anything for the visitor, but they prove ownership.</p>
<ul>
<li><p><strong>Real-life example:</strong> It's like showing your ID at a security desk.</p>
</li>
<li><p><strong>The Job:</strong> When Google or GitHub asks, "Do you really own this domain?", you add a TXT record with a secret code to prove it.</p>
</li>
</ul>
<hr />
<h3 id="heading-putting-it-all-together"><strong>Putting It All Together</strong></h3>
<p>When you visit <a target="_blank" href="http://www.aniketdey.in"><code>www.aniketdey.in</code></a>, a tiny "conversation" happens in milliseconds:</p>
<ol>
<li><p><strong>NS Record:</strong> "Who’s in charge here?" (Answer: Cloudflare/GoDaddy/etc.)</p>
</li>
<li><p><strong>CNAME Record:</strong> "Is <code>www</code> a nickname?" (Answer: "Yes, look at the main domain.")</p>
</li>
<li><p><strong>A Record:</strong> "Where is the main domain parked?" (Answer: "IP 93.184.xx.xx")</p>
</li>
<li><p><strong>Browser:</strong> "Got it! Loading the site now." 🎉</p>
</li>
</ol>
<h3 id="heading-a-quick-closing-thought"><strong>A Quick Closing Thought</strong></h3>
<p>If this feels like a lot to take in, <strong>that’s okay.</strong> Most developers look this up every single time they set up a new project.</p>
<p>Just remember:</p>
<ul>
<li><p><strong>DNS</strong> is the phonebook.</p>
</li>
<li><p><strong>Records</strong> are the specific details.</p>
</li>
</ul>
<hr />
<h3 id="heading-lets-connect"><strong>Let's Connect! 🚀</strong></h3>
<p>Thanks for reading! If you found this guide helpful, feel free to check out my other projects or reach out via the links below:</p>
<ul>
<li><p>🌐 <strong>Portfolio:</strong> <a target="_blank" href="https://aniketdey.in/"><strong>aniketdey.in</strong></a></p>
</li>
<li><p>💻 <strong>GitHub:</strong> <a target="_blank" href="https://github.com/AniketDey06"><strong>github.com/AniketDey06</strong></a></p>
</li>
<li><p>🐦 <strong>X (Twitter):</strong> <a target="_blank" href="https://x.com/AniketDey_"><strong>x.com/AniketDey_</strong></a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The "Pendrive Problem" and the Chaos of final_v2_REAL_final 📁🔥]]></title><description><![CDATA[If you’ve ever worked on a college project or a design file, you know the feeling. You finish your work, save it, and then realize you need one tiny change. Suddenly, your folder looks like this:

project.zip 📦

project_final.zip ✅

project_final_v2...]]></description><link>https://blog.aniketdey.in/why-version-control-exists</link><guid isPermaLink="true">https://blog.aniketdey.in/why-version-control-exists</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Dey]]></dc:creator><pubDate>Thu, 15 Jan 2026 07:31:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768462188001/ee9ea817-3dd2-45a4-ab7f-0e756a544ed9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you’ve ever worked on a college project or a design file, you know the feeling. You finish your work, save it, and then realize you need one tiny change. Suddenly, your folder looks like this:</p>
<ul>
<li><p><a target="_blank" href="http://project.zip"><code>project.zip</code></a> 📦</p>
</li>
<li><p><code>project_</code><a target="_blank" href="http://final.zip"><code>final.zip</code></a> ✅</p>
</li>
<li><p><code>project_final_</code><a target="_blank" href="http://v2.zip"><code>v2.zip</code></a> 🛠️</p>
</li>
<li><p><code>project_final_</code><a target="_blank" href="http://FIXED.zip"><code>FIXED.zip</code></a> 😭</p>
</li>
<li><p><code>project_DO_NOT_DELETE_THIS_</code><a target="_blank" href="http://ONE.zip"><code>ONE.zip</code></a> 🛑</p>
</li>
</ul>
<p>In the software development world, we call this the <strong>"Pendrive Problem."</strong> Before tools like Git existed, this wasn't just a minor annoyance—it was a catastrophic way to build software. 📉</p>
<hr />
<h2 id="heading-the-pendrive-analogy-development-in-the-dark-ages">The Pendrive Analogy: Development in the "Dark Ages" 🕵️‍♂️</h2>
<p>Imagine a team of three developers in 2005. They don't have Version Control Systems (VCS). To collaborate, they rely on the <strong>Pendrive Workflow</strong>:</p>
<ol>
<li><p><strong>The Hand-off:</strong> Developer A writes some code, saves it onto a physical pendrive 💾 (or attaches it to a clunky email 📧), and hands it to Developer B.</p>
</li>
<li><p><strong>The Black Box:</strong> While Developer B is adding a new feature, Developer A realizes there is a massive bug in the original code. 🐛</p>
</li>
<li><p><strong>The Collision:</strong> Developer A fixes the bug on their local machine. Meanwhile, Developer B finishes the feature. Now, they have two different versions of the project. <strong>Chaos ensues.</strong> 🤯</p>
</li>
</ol>
<p>How do they merge them? Usually, it involves a long night of manually copying and pasting lines of code, praying they don’t delete something important. ☕️🕯️</p>
<hr />
<h2 id="heading-the-major-problems-faced-before-vcs">The Major Problems Faced Before VCS ⚠️</h2>
<p>Before Git became the industry standard, teams faced three "Silent Killers" of productivity:</p>
<h3 id="heading-1-the-overwrite-disaster">1. The Overwrite Disaster ❌</h3>
<p>Without a system to track changes, if two people worked on <code>index.html</code> at the same time, whoever saved their file last "won." The other person’s work simply vanished into the digital void. There was no "Undo" button for a whole team.</p>
<h3 id="heading-2-zero-collaboration-history">2. Zero Collaboration History 🕵️</h3>
<p>If a bug appeared on Tuesday, but the code worked on Friday, there was no easy way to see <strong>what</strong> changed, <strong>who</strong> changed it, or <strong>why</strong>. You couldn't "travel back in time" 🏎️💨 to a stable version of the app without a manual backup.</p>
<h3 id="heading-3-the-scaling-nightmare">3. The Scaling Nightmare 📈</h3>
<p>A pendrive or email-based workflow works for two people. It becomes impossible for 200 people. Without a central "source of truth," a large-scale project like Windows or a modern web app would never get off the ground. 🏗️</p>
<hr />
<h2 id="heading-from-chaos-to-clarity-why-vcs-became-mandatory">From Chaos to Clarity: Why VCS Became Mandatory 🛠️✨</h2>
<p>Version Control Systems like Git changed the game by moving away from "tracking files" to "tracking changes."</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Feature</strong></td><td><strong>The Pendrive Way 💾</strong></td><td><strong>The Git Way (VCS) 🌿</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Backups</strong></td><td>Manual (Copy-pasting) 📂</td><td>Automatic (Snapshots) 📸</td></tr>
<tr>
<td><strong>Collaboration</strong></td><td>Sequential (Wait your turn) 🚶‍♂️</td><td>Parallel (Branching) 🛣️</td></tr>
<tr>
<td><strong>Accountability</strong></td><td>The "Blame Game" 🤷‍♂️</td><td><code>git blame</code> (Transparent history) 👀</td></tr>
<tr>
<td><strong>Experimentation</strong></td><td>Dangerous (High risk) 💣</td><td>Safe (Separate branches) 🧪</td></tr>
</tbody>
</table>
</div><h3 id="heading-the-transition-to-modern-dev">The Transition to Modern Dev 🚀</h3>
<p>Today, Version Control is the backbone of DevOps. It allows developers across different time zones to work on the same codebase simultaneously. It ensures that the "Main" version of the code is always protected, while new ideas can be tested in "Branches" without risk. 🛡️</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768462434996/5f4fa5e4-0d9f-4ed4-8987-8679bb0036a4.png" alt class="image--center mx-auto" /></p>
<p>*image credited Gemini</p>
<hr />
<h3 id="heading-lets-connect"><strong>Let's Connect! 🚀</strong></h3>
<p>Thanks for reading! If you found this guide helpful, feel free to check out my other projects or reach out via the links below:</p>
<ul>
<li><p>🌐 <strong>Portfolio:</strong> <a target="_blank" href="https://aniketdey.in/"><strong>aniketdey.in</strong></a></p>
</li>
<li><p>💻 <strong>GitHub:</strong> <a target="_blank" href="https://github.com/AniketDey06"><strong>github.com/AniketDey06</strong></a></p>
</li>
<li><p>🐦 <strong>X (Twitter):</strong> <a target="_blank" href="https://x.com/AniketDey_"><strong>x.com/AniketDey_</strong></a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Stop Losing Your Code: A Beginner’s Guide to Git Magic]]></title><description><![CDATA[What is Git?
At its heart, Git is a Distributed Version Control System (VCS).
Think of it as a sophisticated "undo" button for your entire project. Unlike a standard "Save" button that overwrites your file, Git keeps a record of every change you make...]]></description><link>https://blog.aniketdey.in/beginners-guide-to-git-magic</link><guid isPermaLink="true">https://blog.aniketdey.in/beginners-guide-to-git-magic</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Dey]]></dc:creator><pubDate>Tue, 13 Jan 2026 07:35:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768289323961/25a00a10-eae7-4cf8-90d6-cbc431ce3f91.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-git">What is Git?</h2>
<p>At its heart, <strong>Git</strong> is a <strong>Distributed Version Control System (VCS)</strong>.</p>
<p>Think of it as a sophisticated "undo" button for your entire project. Unlike a standard "Save" button that overwrites your file, Git keeps a record of every change you make. Because it is <em>distributed</em>, every developer has a full copy of the project history on their own machine, making it fast and reliable.</p>
<h2 id="heading-why-is-git-used">Why is Git Used?</h2>
<ul>
<li><p><strong>Collaboration:</strong> Multiple developers can work on the same codebase without overwriting each other’s work.</p>
</li>
<li><p><strong>Version Tracking:</strong> You can revisit any previous version of your code if a new update breaks things.</p>
</li>
<li><p><strong>Experimentation:</strong> You can create "branches" to try new features without affecting the main project.</p>
</li>
<li><p><strong>Backup:</strong> Since every contributor has a copy, the risk of losing the project is nearly zero.</p>
</li>
</ul>
<hr />
<h2 id="heading-git-basics-and-core-terminologies">Git Basics and Core Terminologies</h2>
<p>Before jumping into commands, you need to understand the "Three Trees" of Git. This is the conceptual heart of how your files move from your folder to the final history.</p>
<ol>
<li><p><strong>Repository (Repo):</strong> A directory or storage space where your project lives, including all the history and metadata.</p>
</li>
<li><p><strong>Working Directory:</strong> The actual files you see and edit on your computer.</p>
</li>
<li><p><strong>Staging Area (Index):</strong> A "prep zone." You place changes here before officially committing them to history.</p>
</li>
<li><p><strong>Commit:</strong> A snapshot of your changes. Each commit has a unique ID (hash) and a message explaining what changed.</p>
</li>
<li><p><strong>Branch:</strong> A parallel version of your repository. The default branch is usually called <code>main</code>.</p>
</li>
<li><p><strong>HEAD:</strong> A pointer that tells Git which branch or commit you are currently looking at.</p>
</li>
</ol>
<hr />
<h2 id="heading-essential-git-commands">Essential Git Commands</h2>
<p>Here are the commands you’ll use 90% of the time as a developer.</p>
<h3 id="heading-1-starting-a-project">1. Starting a Project</h3>
<ul>
<li><p><code>git init</code>: Initializes a brand new Git repository in your current folder.</p>
</li>
<li><p><code>git clone &lt;url&gt;</code>: Downloads an existing repository from a remote source (like GitHub).</p>
</li>
</ul>
<h3 id="heading-2-the-daily-workflow">2. The Daily Workflow</h3>
<ul>
<li><p><code>git status</code>: The most important command! It tells you which files are modified and what is currently in the staging area.</p>
</li>
<li><p><code>git add &lt;filename&gt;</code>: Moves a file to the Staging Area. Use <code>git add .</code> to stage all changes.</p>
</li>
<li><p><code>git commit -m "Your message"</code>: Saves your staged changes into the repository history.</p>
</li>
</ul>
<h3 id="heading-3-reviewing-history">3. Reviewing History</h3>
<ul>
<li><p><code>git log</code>: Shows a list of all previous commits in chronological order.</p>
</li>
<li><p><code>git diff</code>: Shows the specific lines of code that changed between your working directory and your last commit.</p>
</li>
</ul>
<hr />
<h2 id="heading-a-basic-developer-workflow-from-scratch">A Basic Developer Workflow (From Scratch)</h2>
<p>Imagine you are starting a new website project. Here is how you would use Git step-by-step:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Step</strong></td><td><strong>Action</strong></td><td><strong>Command</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>1</strong></td><td>Create a new project folder</td><td><code>mkdir my-website &amp;&amp; cd my-website</code></td></tr>
<tr>
<td><strong>2</strong></td><td>Initialize Git</td><td><code>git init</code></td></tr>
<tr>
<td><strong>3</strong></td><td>Create a file</td><td><code>touch index.html</code></td></tr>
<tr>
<td><strong>4</strong></td><td>Check the status</td><td><code>git status</code> (It will show as untracked)</td></tr>
<tr>
<td><strong>5</strong></td><td>Stage the file</td><td><code>git add index.html</code></td></tr>
<tr>
<td><strong>6</strong></td><td>Record the snapshot</td><td><code>git commit -m "Initial commit: Add index page"</code></td></tr>
<tr>
<td><strong>7</strong></td><td>View your progress</td><td><code>git log</code></td></tr>
</tbody>
</table>
</div><h3 id="heading-lets-connect">Let's Connect! 🚀</h3>
<p>Thanks for reading! If you found this guide helpful, feel free to check out my other projects or reach out via the links below:</p>
<ul>
<li><p>🌐 <strong>Portfolio:</strong> <a target="_blank" href="https://aniketdey.in">aniketdey.in</a></p>
</li>
<li><p>💻 <strong>GitHub:</strong> <a target="_blank" href="https://github.com/AniketDey06">github.com/AniketDey06</a></p>
</li>
<li><p>🐦 <strong>X (Twitter):</strong> <a target="_blank" href="https://x.com/AniketDey_">x.com/AniketDey_</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[🌐 Understanding the Backbone of the Internet: IP Addresses, Domain Names System & Routing]]></title><description><![CDATA[Have you ever wondered how clicking a link opens a webpage in seconds?
Like, you hit enter on youtube.com, and boom videos. But what’s really happening behind that click is a fascinating digital relay race.
Let’s decode the backbone of the internet u...]]></description><link>https://blog.aniketdey.in/understanding-the-backbone-of-the-internet-ip-addresses-domain-names-system-and-routing</link><guid isPermaLink="true">https://blog.aniketdey.in/understanding-the-backbone-of-the-internet-ip-addresses-domain-names-system-and-routing</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Dey]]></dc:creator><pubDate>Fri, 06 Jun 2025 14:56:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1762882669089/4e035710-ea8d-4f34-bb7e-cadd6a5fb434.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-have-you-ever-wondered-how-clicking-a-link-opens-a-webpage-in-seconds"><strong>Have you ever wondered how clicking a link opens a webpage in seconds?</strong></h2>
<p>Like, you hit enter on <a target="_blank" href="http://youtube.com"><code>youtube.com</code></a>, and boom videos. But what’s really happening behind that click is a fascinating digital relay race.</p>
<p>Let’s decode the backbone of the internet using a simple analogy: <strong>the internet as a city full of roads, addresses, and delivery vehicles</strong>.</p>
<h2 id="heading-ip-addresses-the-home-address-of-every-device">📍 IP Addresses The Home Address of Every Device</h2>
<p>Think of <strong>IP addresses</strong> as the exact street address of a house. Every device on the internet your phone, your laptop, even a smart fridge has one.</p>
<h3 id="heading-types">Types:</h3>
<ul>
<li><p><strong>IPv4</strong> – like <code>192.168.0.1</code> (limited, running out)</p>
</li>
<li><p><strong>IPv6</strong> – like <code>2400:cb00:2048:1::c629:d7a2</code> (much bigger space)</p>
</li>
</ul>
<p>These addresses help computers find each other just like Google Maps finds locations.</p>
<h2 id="heading-domain-names-human-friendly-names-for-computers">🏷️ Domain Names Human-Friendly Names for Computers</h2>
<p>We humans can’t remember long strings of numbers. That’s where <strong>domain names</strong> come in they’re like contact names saved in your phone.</p>
<ul>
<li><a target="_blank" href="http://google.com"><code>google.com</code></a> → easier than → <code>142.250.182.206</code></li>
</ul>
<p>When you enter a domain, your device asks:</p>
<blockquote>
<p>“Hey DNS, what’s the IP of this domain?”</p>
</blockquote>
<p>DNS (Domain Name System) replies with the IP just like looking up someone’s number in your contacts list.</p>
<h2 id="heading-routing-the-delivery-path-of-data">🛰️ Routing The Delivery Path of Data</h2>
<p>Once the IP is known, your data starts its journey. Imagine your data as a <strong>parcel</strong>, and routers as <strong>highways and traffic signals</strong> guiding it from one city (device) to another (server).</p>
<p>This is where <strong>routing</strong> happens:</p>
<ul>
<li><p>Your <strong>ISP (Internet Service Provider)</strong> is like your local post office.</p>
</li>
<li><p><strong>Routers</strong> decide the fastest way for your parcel to travel.</p>
</li>
<li><p><strong>BGP (Border Gateway Protocol)</strong> acts like Google Maps for data, ensuring packets take the best path.</p>
</li>
</ul>
<p>Data doesn’t travel in one big piece it's split into <strong>packets</strong> that may take different routes, reuniting at the destination. Like a relay race where each runner has a piece of the message.</p>
<h2 id="heading-all-together-now-the-full-journey">🔁 All Together Now The Full Journey</h2>
<p>Here’s how it all comes together every time you load a page:</p>
<h3 id="heading-step-by-step-with-analogy">🧭 Step-by-step (with analogy):</h3>
<ol>
<li><p><strong>You type</strong> <a target="_blank" href="http://example.com"><code>example.com</code></a><br /> → Like writing a friend’s name on a letter.</p>
</li>
<li><p><strong>DNS Lookup</strong><br /> → You ask the phonebook (DNS) for their address.</p>
</li>
<li><p><strong>Your ISP connects to the server</strong><br /> → Like your local post office sending the letter out.</p>
</li>
<li><p><strong>Routers guide the data packets</strong><br /> → Each packet follows the fastest road.</p>
</li>
<li><p><strong>Server responds</strong><br /> → Your friend replies, and the message travels back the same way.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1749221740021/881f80ed-0ba3-45fa-a111-a8fa3735d8f1.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Teleporting a Human: Understanding Serialization & Deserialization in JavaScript]]></title><description><![CDATA[Introduction
Imagine you could teleport from one place to another instantly. In the world of JavaScript, serialization is like breaking down a person into structured data, and deserialization is like reconstructing them at another location. This conc...]]></description><link>https://blog.aniketdey.in/teleporting-a-human-understanding-serialization-deserialization-in-javascript</link><guid isPermaLink="true">https://blog.aniketdey.in/teleporting-a-human-understanding-serialization-deserialization-in-javascript</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Dey]]></dc:creator><pubDate>Tue, 11 Feb 2025 06:50:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1739256506221/a55b46e1-e9ba-424f-9e65-df1e47f9d2f8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Imagine you could teleport from one place to another instantly. In the world of JavaScript, <strong>serialization</strong> is like breaking down a person into structured data, and <strong>deserialization</strong> is like reconstructing them at another location. This concept plays a crucial role in data transfer between a server and a client, storage mechanisms, and even debugging processes.</p>
<h2 id="heading-why-use-serialization-and-deserialization">Why Use Serialization and Deserialization?</h2>
<ol>
<li><p><strong>Data Transmission</strong>: Just like teleportation requires encoding a human into data, sending structured data over HTTP needs serialization.</p>
</li>
<li><p><strong>Storage</strong>: A teleported human’s data needs to be stored temporarily, much like objects stored in <code>localStorage</code>, databases, or cache.</p>
</li>
<li><p><strong>Reconstruction</strong>: Upon arrival, the data must be decoded back into its original form, similar to how deserialization reconstructs JavaScript objects.</p>
</li>
<li><p><strong>Handling Complex Data</strong>: Sometimes, challenges arise—data loss, corruption, or format incompatibility, much like teleportation mishaps in sci-fi movies.</p>
</li>
</ol>
<h2 id="heading-json-serialization-and-deserialization">JSON Serialization and Deserialization</h2>
<p>The most common teleportation-friendly format is <strong>JSON (JavaScript Object Notation)</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739256543799/df97b318-e121-4122-ac5f-3b2fc9053df4.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-serializing-a-person-object">Serializing a Person Object</h3>
<p>To convert a JavaScript object into a JSON string for teleportation, use <code>JSON.stringify()</code>:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> human = {
    <span class="hljs-attr">name</span>: <span class="hljs-string">"John Doe"</span>,
    <span class="hljs-attr">age</span>: <span class="hljs-number">30</span>,
    <span class="hljs-attr">location</span>: <span class="hljs-string">"Earth"</span>
};

<span class="hljs-keyword">const</span> teleportedHuman = <span class="hljs-built_in">JSON</span>.stringify(human);
<span class="hljs-built_in">console</span>.log(teleportedHuman);
<span class="hljs-comment">// Output: '{"name":"John Doe","age":30,"location":"Earth"}'</span>
</code></pre>
<h3 id="heading-deserializing-a-teleported-object">Deserializing a Teleported Object</h3>
<p>Once the data reaches its destination, we use <code>JSON.parse()</code> to reconstruct it:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> reconstructedHuman = <span class="hljs-built_in">JSON</span>.parse(teleportedHuman);
<span class="hljs-built_in">console</span>.log(reconstructedHuman); <span class="hljs-comment">// Output: { name: 'John Doe', age: 30, location: 'Earth' }</span>
</code></pre>
<h2 id="heading-challenges-in-teleportation-serialization">Challenges in Teleportation (Serialization)</h2>
<ol>
<li><p><strong>Data Loss</strong>: Some properties (<code>undefined</code>, functions) might disappear.</p>
</li>
<li><p><strong>Corruption</strong>: Incorrect parsing can lead to broken reconstructions.</p>
</li>
<li><p><strong>Format Incompatibility</strong>: Different teleporters (systems) may not handle data the same way.</p>
</li>
</ol>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Just as teleportation requires precise encoding and decoding, serialization and deserialization in JavaScript are crucial for seamless data exchange. JSON is the most commonly used format, but handling complex data types requires extra care. By mastering these concepts, you can ensure safe and efficient data teleportation!</p>
]]></content:encoded></item><item><title><![CDATA[JavaScript Array Methods x Hera Pheri]]></title><description><![CDATA[A hot summer day in Mumbai, a small chawl, and three unemployed men – Baburao Ganpatrao Apte (Babu Bhaiya), Raju, and Shyam. Their lives were already a mess of Hera Pheri, when one day, a brilliant idea struck – learning JavaScript!
Babu Bhaiya said,...]]></description><link>https://blog.aniketdey.in/javascript-array-methods-x-hera-pheri</link><guid isPermaLink="true">https://blog.aniketdey.in/javascript-array-methods-x-hera-pheri</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Dey]]></dc:creator><pubDate>Tue, 04 Feb 2025 08:05:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738655816857/74dd4830-2a03-4f44-bc34-05023e763227.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A hot summer day in Mumbai, a small chawl, and three unemployed men – <strong>Baburao Ganpatrao Apte (Babu Bhaiya), Raju, and Shyam</strong>. Their lives were already a mess of <strong>Hera Pheri</strong>, when one day, a brilliant idea struck – <strong>learning JavaScript!</strong></p>
<p>Babu Bhaiya said, “How do we double our money? We must learn this!”<br />Raju replied, “It’s all about array method, Babu Bhaiya. If we master this, our life is set!”<br />Shyam grabbed a laptop, and all three dived into the magical world of JavaScript arrays.</p>
<hr />
<h2 id="heading-1-push-paisa-add-karo-re-baba"><strong>1.</strong> <code>push()</code> – Paisa Add Karo Re Baba!</h2>
<p>Raju started explaining, “<code>push()</code> is like adding money to our savings.”</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> money = [<span class="hljs-string">'₹500'</span>, <span class="hljs-string">'₹1000'</span>];
money.push(<span class="hljs-string">'₹2000'</span>);
<span class="hljs-built_in">console</span>.log(money); <span class="hljs-comment">// ['₹500', '₹1000', '₹2000']</span>
</code></pre>
<p>Babu Bhaiya exclaimed, “Arre wah! This is a great scheme! Double, double!”</p>
<hr />
<h2 id="heading-2-pop-paisa-gaya-system-lucha"><strong>2.</strong> <code>pop()</code> – Paisa Gaya, System Lucha!</h2>
<p>When Babu Bhaiya went to the ATM, the system behaved like <code>pop()</code> and removed the last amount.</p>
<pre><code class="lang-javascript">money.pop();
<span class="hljs-built_in">console</span>.log(money); <span class="hljs-comment">// ['₹500', '₹1000']</span>
</code></pre>
<p>Shyam laughed, “Babu Bhaiya, this method is just like your wallet – money disappears instantly!”</p>
<hr />
<h2 id="heading-3-shift-babu-bhaiya-ka-udhaar"><strong>3.</strong> <code>shift()</code> – Babu Bhaiya Ka Udhaar</h2>
<p>Raju said, “We must clear Babu Bhaiya’s debts first. That’s why we use <code>shift()</code>.”</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> debts = [<span class="hljs-string">'Raju ka ₹500'</span>, <span class="hljs-string">'Shyam ka ₹1000'</span>, <span class="hljs-string">'Bank ka ₹2000'</span>];
debts.shift();
<span class="hljs-built_in">console</span>.log(debts); <span class="hljs-comment">// ['Shyam ka ₹1000', 'Bank ka ₹2000']</span>
</code></pre>
<p>Babu Bhaiya shouted, “Arre! Why is my money always the first to go?”</p>
<hr />
<h2 id="heading-4-unshift-naya-loan-aya-hai"><strong>4.</strong> <code>unshift()</code> – Naya Loan Aya Hai!</h2>
<p>When Raju took a new loan, it got added to the beginning using <code>unshift()</code>.</p>
<pre><code class="lang-javascript">debts.unshift(<span class="hljs-string">'Raju ka naya ₹3000'</span>);
<span class="hljs-built_in">console</span>.log(debts); <span class="hljs-comment">// ['Raju ka naya ₹3000', 'Shyam ka ₹1000', 'Bank ka ₹2000']</span>
</code></pre>
<p>Shyam smirked, “Raju, your loans are increasing like an infinite array!”</p>
<hr />
<h2 id="heading-5-map-idea-chhapo"><strong>5.</strong> <code>map()</code> – Idea Chhapo!</h2>
<p>Babu Bhaiya had an idea: “Let’s multiply our money by 10!”</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> money = [<span class="hljs-number">100</span>, <span class="hljs-number">200</span>, <span class="hljs-number">300</span>];
<span class="hljs-keyword">let</span> doubleMoney = money.map(<span class="hljs-function"><span class="hljs-params">amount</span> =&gt;</span> amount * <span class="hljs-number">10</span>);
<span class="hljs-built_in">console</span>.log(doubleMoney); <span class="hljs-comment">// [1000, 2000, 3000]</span>
</code></pre>
<p>Raju shouted, “Arre Babu Bhaiya! This is the real <strong>double-your-money</strong> scheme!”</p>
<hr />
<h2 id="heading-6-filter-sirf-munafa"><strong>6.</strong> <code>filter()</code> – Sirf Munafa!</h2>
<p>Shyam decided to filter out only <strong>profit</strong> transactions.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> transactions = [<span class="hljs-number">-100</span>, <span class="hljs-number">500</span>, <span class="hljs-number">-200</span>, <span class="hljs-number">1000</span>, <span class="hljs-number">-50</span>];
<span class="hljs-keyword">let</span> profitOnly = transactions.filter(<span class="hljs-function"><span class="hljs-params">amount</span> =&gt;</span> amount &gt; <span class="hljs-number">0</span>);
<span class="hljs-built_in">console</span>.log(profitOnly); <span class="hljs-comment">// [500, 1000]</span>
</code></pre>
<p>Babu Bhaiya was impressed, “Just focus on profits! Who cares about losses?!”</p>
<hr />
<h2 id="heading-7-reduce-sabko-ek-kar-dala"><strong>7.</strong> <code>reduce()</code> – Sabko Ek Kar Dala!</h2>
<p>Babu Bhaiya said, “Let’s calculate the total earnings for the year.”</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> money = [<span class="hljs-number">500</span>, <span class="hljs-number">1000</span>, <span class="hljs-number">1500</span>, <span class="hljs-number">2000</span>];
<span class="hljs-keyword">let</span> total = money.reduce(<span class="hljs-function">(<span class="hljs-params">acc, curr</span>) =&gt;</span> acc + curr, <span class="hljs-number">0</span>);
<span class="hljs-built_in">console</span>.log(total); <span class="hljs-comment">// 5000</span>
</code></pre>
<p>Shyam sighed, “Babu Bhaiya, your total money is just ₹5000!”<br />Babu Bhaiya: “What?! Such a small total? System looted, re baba!”</p>
<hr />
<h2 id="heading-8-find-raju-ka-loan-kahan-gaya"><strong>8.</strong> <code>find()</code> – Raju Ka Loan Kahan Gaya?</h2>
<p>Shyam asked, “Which loan belongs to Raju?”</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> loans = [{<span class="hljs-attr">name</span>: <span class="hljs-string">'Raju'</span>, <span class="hljs-attr">amount</span>: <span class="hljs-number">1000</span>}, {<span class="hljs-attr">name</span>: <span class="hljs-string">'Shyam'</span>, <span class="hljs-attr">amount</span>: <span class="hljs-number">2000</span>}];
<span class="hljs-keyword">let</span> rajuLoan = loans.find(<span class="hljs-function"><span class="hljs-params">loan</span> =&gt;</span> loan.name === <span class="hljs-string">'Raju'</span>);
<span class="hljs-built_in">console</span>.log(rajuLoan); <span class="hljs-comment">// {name: 'Raju', amount: 1000}</span>
</code></pre>
<p>Raju laughed, “Arre! My loan was found so easily!”</p>
<hr />
<h2 id="heading-9-some-koi-bhi-amir-hai-kya"><strong>9.</strong> <code>some()</code> – Koi Bhi Amir Hai Kya?</h2>
<p>Babu Bhaiya wondered, “Check if anyone in the chawl is rich.”</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> bankBalance = [<span class="hljs-number">500</span>, <span class="hljs-number">1000</span>, <span class="hljs-number">1500</span>, <span class="hljs-number">10000</span>];
<span class="hljs-keyword">let</span> isAnyoneRich = bankBalance.some(<span class="hljs-function"><span class="hljs-params">amount</span> =&gt;</span> amount &gt;= <span class="hljs-number">10000</span>);
<span class="hljs-built_in">console</span>.log(isAnyoneRich); <span class="hljs-comment">// true</span>
</code></pre>
<p>Raju: “Yes, Babu Bhaiya, there’s one person who is rich!”<br />Babu Bhaiya: “Who is he?! Where’s his money?!”</p>
<hr />
<h2 id="heading-10-every-sab-gareeb-hain-kya"><strong>10.</strong> <code>every()</code> – Sab Gareeb Hain Kya?</h2>
<p>Shyam asked, “Are all chawl residents poor?”</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> bankBalance = [<span class="hljs-number">500</span>, <span class="hljs-number">1000</span>, <span class="hljs-number">1500</span>, <span class="hljs-number">2000</span>];
<span class="hljs-keyword">let</span> allPoor = bankBalance.every(<span class="hljs-function"><span class="hljs-params">amount</span> =&gt;</span> amount &lt; <span class="hljs-number">10000</span>);
<span class="hljs-built_in">console</span>.log(allPoor); <span class="hljs-comment">// true</span>
</code></pre>
<p>Babu Bhaiya sighed, “Everyone’s in the same boat, re baba!”</p>
<hr />
<h2 id="heading-hera-pheri-ka-ant"><strong>Hera Pheri Ka Ant</strong></h2>
<p>And just like that, <strong>Babu Bhaiya, Raju, and Shyam</strong> mastered JavaScript array methods! But… they were still broke!</p>
<p>Babu Bhaiya concluded with his legendary dialogue:<br /><strong>“System set hai re baba! Only money is missing!”</strong></p>
<p><img src="https://im.indiatimes.in/content/2020/Apr/maxresdefault_5e8459894bb6d.jpg?w=640&amp;h=427&amp;cc=1&amp;webp=1&amp;q=75" alt="“System set hai re baba! Only money is missing!”" class="image--center mx-auto" /></p>
<p>And that, dear friends, was the <strong>Hera Pheri x JavaScript Arrays</strong> story! 😂</p>
]]></content:encoded></item><item><title><![CDATA[Deepdive into CSS Specificity Algorithm]]></title><description><![CDATA[Definition of Specificity
It is a set of rules where it is defined which property (like color, etc.) applies first and which would be last. This Algo. is responsible for in which condition which property will be applied to which component (like hover...]]></description><link>https://blog.aniketdey.in/deepdive-into-css-specificity-algorithm</link><guid isPermaLink="true">https://blog.aniketdey.in/deepdive-into-css-specificity-algorithm</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Dey]]></dc:creator><pubDate>Sat, 25 Jan 2025 07:26:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737896600264/ccd78cc9-6195-45fe-a964-a22959470c1c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-definition-of-specificity">Definition of Specificity</h2>
<p>It is a set of rules where it is defined which property (like color, etc.) applies first and which would be last. This Algo. is responsible for in which condition which property will be applied to which component (like hover, mobile view).</p>
<h2 id="heading-how-specificity-is-calculated">How Specificity is Calculated</h2>
<h3 id="heading-inline-styling"><strong>Inline styling</strong></h3>
<p>By using inline styling, we can also style a component or a tag. It is not part of the selector, which is why I put it before the “Selectors Weight Categories” section, although it carries the highest weight (1-0-0-0) among all.</p>
<p><mark>*Specificity is calculated on basis of selectors weight</mark></p>
<h3 id="heading-selectors-weight-categories">Selectors Weight Categories</h3>
<p><strong>ID Selectors:</strong> An ID selector means a tag can be accessed by its ID. and it carries the highest weight (1-0-0) compared to the other selectors. <code>#example</code></p>
<p><strong>Class Selectors:</strong> An class selector means a tag can be accessed by its class. and it carries the 2nd highest weight (0-1-0) compared to the other selectors <code>.example</code> . And includes attribute selectors like <code>[type="radio"]</code> and<code>[lang|="fr"]</code> and pseudo-classes, such as<code>:hover</code> <code>:nth-of-type(3n)</code> and<code>:required</code> For each class, attribute selector, or pseudo-class in a matching selector.</p>
<p><strong>Element Selectors:</strong> An tag selector can be accessed by its name <code>h1</code> <code>p</code> <code>table</code> and includes pseudo-elements <code>::before</code>. It carries weight (0-0-1)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737895855243/5abc6e92-6067-4d38-81af-3533350f5391.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-examples-of-specificity-in-action"><strong>Examples of Specificity in Action</strong></h3>
<p>Let’s break it down with some examples:</p>
<p>In this case:</p>
<ul>
<li><p>The <code>p</code> selector has a specificity of <strong>1</strong>.</p>
</li>
<li><p><code>.container p</code> has a specificity of <strong>11</strong>.</p>
</li>
<li><p><code>#main p</code> has a specificity of <strong>101</strong>.</p>
</li>
</ul>
<p>Result: The paragraph will be <strong>red</strong> because <code>#main p</code> has the highest specificity.</p>
<h3 id="heading-common-pitfalls-and-how-to-avoid-them"><strong>Common Pitfalls and How to Avoid Them</strong></h3>
<ol>
<li><p><strong>Overusing</strong> <code>!important</code><br /> While <code>!important</code> can override specificity, it’s often considered bad practice because it makes your code harder to maintain. Use it sparingly.</p>
<p> <strong>Copy</strong></p>
<p> <strong>Copy</strong></p>
<pre><code class="lang-plaintext">  p {
    color: black !important;
  }
</code></pre>
<p> In this case, the <code>!important</code> rule will win, regardless of specificity.</p>
</li>
<li><p><strong>Conflicting Rules</strong><br /> If your styles are getting overridden, check for higher-specificity selectors or inline styles that might be the culprit.</p>
</li>
<li><p><strong>Using Too Many IDs</strong><br /> IDs have very high specificity, so overusing them can lead to a cascade of specificity wars in your CSS. Favor classes for reusable styles.</p>
</li>
</ol>
<h3 id="heading-how-to-keep-specificity-in-check"><strong>How to Keep Specificity in Check</strong></h3>
<ol>
<li><p><strong>Stick to Classes</strong><br /> Classes provide enough specificity for most use cases and are more reusable than IDs.</p>
</li>
<li><p><strong>Keep Your Selectors Simple</strong><br /> Avoid overly complex selectors like <code>div ul li:first-child a</code>. They’re hard to read, and you might end up unintentionally increasing specificity.</p>
</li>
<li><p><strong>Organize Your Stylesheets</strong><br /> Write your CSS in a way that minimizes conflicts. Group related styles and use a consistent naming convention.</p>
</li>
</ol>
<h3 id="heading-wrapping-it-up"><strong>Wrapping It Up</strong></h3>
<p>CSS specificity might seem intimidating at first, but once you understand how it works, you’ll gain better control over your styles. Think of it as learning the rules of the road for CSS—once you’ve got them down, you’ll navigate your projects with ease.</p>
<p>Here’s a quick recap:</p>
<ul>
<li><p>Specificity is calculated based on the type of selector.</p>
</li>
<li><p>Inline styles &gt; IDs &gt; Classes &gt; Elements.</p>
</li>
<li><p>Avoid <code>!important</code> unless absolutely necessary.</p>
</li>
</ul>
]]></content:encoded></item></channel></rss>