<?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[Hardik Babla]]></title><description><![CDATA[Hardik Babla]]></description><link>https://hardikdotdev.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6aa385803606a7bd7c205588/9effd9fb-950b-41d2-b3f6-2f464283dc77.png</url><title>Hardik Babla</title><link>https://hardikdotdev.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 21 Oct 2026 21:52:16 GMT</lastBuildDate><atom:link href="https://hardikdotdev.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Getting Started with cURL: Talk to Any Server From Your Terminal]]></title><description><![CDATA[Learn cURL step by step: send your first request, read status codes, and make GET and POST calls to an API from your terminal. A beginner-friendly guide.]]></description><link>https://hardikdotdev.hashnode.dev/getting-started-with-curl</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/getting-started-with-curl</guid><category><![CDATA[curl]]></category><category><![CDATA[http]]></category><category><![CDATA[api]]></category><category><![CDATA[networking]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[cURL for beginner]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Tue, 20 Oct 2026 14:30:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/ab01553b-e0f9-43b9-878d-cfacdd86b677.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every time you open a website or use an app, your device is talking to a <strong>server</strong>. A server is just a computer somewhere that stores data and answers questions. You ask, it replies.</p>
<p>Usually your browser does the asking for you. But what if you want to ask a server directly, without a browser, and see exactly what comes back? That’s what cURL is for, and by the end of this blog you’ll have used it yourself.</p>
<h3>What is cURL?</h3>
<p>cURL is a command-line tool that <strong>sends a message to a server and shows you the reply</strong>. That’s it.</p>
<p>Think of it as sending a text message to a server from your terminal. You type the address, hit Enter, and the server texts back.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/28165f6f-89d9-46c0-886f-967c56cf9735.png" alt="" style="display:block;margin:0 auto" />

<h3>Why Do Programmers Need cURL?</h3>
<p>When you build a backend or work with APIs, you constantly need to check things. Is my server running? What does this API return? Did my change work?</p>
<p>A browser can do some of this, but cURL is faster, scriptable, and shows you the raw conversation. It’s like a <strong>test drive for your server</strong>, with no fancy app in the way.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/f50b8181-71df-40d6-b107-ae69418ab664.png" alt="" style="display:block;margin:0 auto" />

<h3>Your First Request</h3>
<p>Open your terminal and type:</p>
<pre><code class="language-plaintext">curl https://example.com
</code></pre>
<p>Press Enter. You’ll see a block of text that starts with <code>&lt;!doctype html&gt;</code>. That’s the actual webpage code, the same thing your browser receives before turning it into a pretty page.</p>
<p>Congratulations, you just talked to a server.</p>
<h3>Understanding Request and Response</h3>
<p>Every conversation has two parts.</p>
<p><strong>Request:</strong> what you send. It says which address you want and what you want to do with it.</p>
<p><strong>Response:</strong> what the server sends back. It has two important parts:</p>
<ol>
<li><p><strong>Status code:</strong> a number telling you how it went. <code>200</code> means success, <code>404</code> means not found, and <code>500</code> means the server had a problem.</p>
</li>
<li><p><strong>Body:</strong> the actual data, like a webpage or some JSON.</p>
</li>
</ol>
<p>Want to see the status? Add <code>-i</code> to include the response details:</p>
<pre><code class="language-plaintext">curl -i https://example.com
</code></pre>
<p>You’ll see a line like <code>HTTP/2 200</code> at the top, then some headers (extra info about the response), then the body.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/8ca5476c-03b7-4c30-a4f9-1a2dd5bdab3a.png" alt="" style="display:block;margin:0 auto" />

<p>Think of status codes like a restaurant. <code>200</code> is “here’s your food,” <code>404</code> is “we don’t have that dish,” and <code>500</code> is “the kitchen is on fire.”</p>
<h3>Using cURL to Talk to APIs</h3>
<p>An API is a server that returns <strong>data</strong> instead of webpages, usually as JSON. Here’s a free practice API:</p>
<pre><code class="language-plaintext">curl https://jsonplaceholder.typicode.com/posts/1
</code></pre>
<p>You’ll get back something like:</p>
<pre><code class="language-plaintext">{
  "userId": 1,
  "id": 1,
  "title": "...",
  "body": "..."
}
</code></pre>
<p>That was a <strong>GET</strong> request, which means “give me this data.” It’s the default, so you didn’t have to type anything extra.</p>
<p>The other one you’ll meet early is <strong>POST</strong>, which means “here’s some data, please save it”:</p>
<pre><code class="language-plaintext">curl -X POST https://jsonplaceholder.typicode.com/posts \
  -H "Content-Type: application/json" \
  -d '{"title": "Hello", "body": "My first post", "userId": 1}'
</code></pre>
<p>Here, <code>-X POST</code> sets the method, <code>-H</code> adds a header saying we’re sending JSON, and <code>-d</code> is the data. The server replies with the created item.</p>
<p>For now, remember only this: <strong>GET is for reading, POST is for sending.</strong></p>
<h3>Common Mistakes Beginners Make</h3>
<ol>
<li><p><strong>Forgetting</strong> <code>https://</code><strong>.</strong> Always include the full address, or cURL may not behave as you expect.</p>
</li>
<li><p><strong>Messing up quotes in POST data.</strong> JSON needs double quotes inside, so wrap the whole thing in single quotes (on Windows PowerShell, quoting works differently, so be careful).</p>
</li>
<li><p><strong>Forgetting the Content-Type header</strong> when sending JSON. The server may not understand your data.</p>
</li>
<li><p><strong>Panicking at the wall of text.</strong> It’s normal. Look for the status code first, then the body.</p>
</li>
<li><p><strong>Ignoring the status code.</strong> A <code>404</code> or <code>500</code> tells you what went wrong before you read anything else.</p>
</li>
</ol>
<h3>Wrapping Up</h3>
<p>cURL is just a way to talk to servers from your terminal. Send a request, read the response, and check the status code. GET reads, POST sends. Start there, and everything else will make sense later.</p>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[TCP vs UDP explained for beginners: key differences, when to use each, real examples like video calls and banking, and how HTTP runs on top of TCP.]]></description><link>https://hardikdotdev.hashnode.dev/tcp-vs-udp-when-to-use-what</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/tcp-vs-udp-when-to-use-what</guid><category><![CDATA[TCP]]></category><category><![CDATA[UDP]]></category><category><![CDATA[networking]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[http]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Tue, 20 Oct 2026 14:22:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/41180dd8-f8b8-4cd8-a394-e80d3174e8a8.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine two computers on opposite sides of the world wanting to exchange data. Without agreed rules, it would be chaos. One side sends too fast, the other can’t keep up, and pieces get lost or jumbled.</p>
<p>So the internet runs on <strong>protocols</strong>, which are sets of rules for how data is sent. In this blog we’ll look at two main ways to send data (TCP and UDP), and then clear up one of the most common beginner confusions: how HTTP fits in.</p>
<h3>What are TCP and UDP?</h3>
<p>Both are <strong>transport protocols</strong>. Their job is to carry data from one computer to another. They just do it in very different ways.</p>
<p><strong>TCP</strong> is safe and reliable. It makes sure everything arrives, in order, and correctly.</p>
<p><strong>UDP</strong> is fast but risky. It sends data and doesn’t check if it arrived.</p>
<h3>The Analogies</h3>
<p><strong>TCP is a phone call.</strong> You dial, the other person picks up, you confirm you can hear each other, and you talk. If you miss something, you say “sorry, can you repeat that?” Nothing is lost.</p>
<p><strong>UDP is a public announcement.</strong> The speaker just talks into the microphone. If you were in the toilet and missed it, too bad. Nobody repeats it.</p>
<p>Another way to see it: TCP is a <strong>courier</strong> who gets your signature on delivery, while UDP is a <strong>live broadcast</strong> that keeps going whether or not you’re watching.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/a02b5814-ba60-4e67-8e54-349f6c4df768.png" alt="" style="display:block;margin:0 auto" />

<h3>Key Differences</h3>
<ol>
<li><p><strong>Connection:</strong> TCP sets up a connection first (the handshake). UDP just starts sending.</p>
</li>
<li><p><strong>Reliability:</strong> TCP resends lost data. UDP doesn’t.</p>
</li>
<li><p><strong>Order:</strong> TCP delivers data in the correct order. UDP may arrive jumbled.</p>
</li>
<li><p><strong>Speed:</strong> UDP is faster because it skips all the checking. TCP is slower because of the extra work.</p>
</li>
<li><p><strong>Overhead:</strong> TCP carries more bookkeeping. UDP is lightweight.</p>
</li>
</ol>
<p>In short: <strong>TCP trades speed for safety, and UDP trades safety for speed.</strong></p>
<h3>When to Use TCP</h3>
<p>Use TCP when <strong>every piece of data matters</strong>. If something is missing, the whole thing breaks.</p>
<p>Websites, email, file downloads, and banking are all good examples. Imagine a webpage with missing chunks of code, or a bank transfer where half the message vanished. Nobody wants that.</p>
<h3>When to Use UDP</h3>
<p>Use UDP when <strong>speed matters more than perfection</strong>, and a small loss is acceptable.</p>
<p>Live video calls, online games, and live streaming are the classic examples. If one frame drops in a video call, you barely notice. But if the call paused to resend an old frame, you’d get awkward lag. In a game, the player’s position from half a second ago is useless, so there’s no point resending it.</p>
<p>DNS lookups also typically use UDP, because the questions and answers are tiny and fast.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/7a0e41e2-e044-4f58-950a-a6b029f374c1.png" alt="" style="display:block;margin:0 auto" />

<h3>What is HTTP?</h3>
<p>Now for the confusing part. You’ve probably heard of HTTP, the protocol behind every website. But is it the same as TCP?</p>
<p><strong>No.</strong> HTTP is an <strong>application-level protocol</strong>. It defines <strong>what</strong> the browser and server say to each other: “GET me this page,” “here’s the page, status 200,” and so on. It’s about the message and its meaning.</p>
<p>TCP is a <strong>transport protocol</strong>. It decides <strong>how</strong> those messages travel safely across the network.</p>
<h3>HTTP Runs on Top of TCP</h3>
<p>Think of them as layers, stacked like this:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/fc934540-e8d9-46ce-838e-89ced73f92e6.png" alt="" style="display:block;margin:0 auto" />

<p>Think of sending a letter. HTTP is the <strong>letter you write</strong>. TCP is the <strong>registered post service</strong> that makes sure it arrives. They’re different things, and you need both.</p>
<h3>How an HTTP Request Flows Over TCP</h3>
<p>When you open a website:</p>
<ol>
<li><p>Your browser opens a <strong>TCP connection</strong> to the server (the handshake).</p>
</li>
<li><p>It sends an <strong>HTTP request</strong> through that connection.</p>
</li>
<li><p>The server sends back an <strong>HTTP response</strong>, also through that connection.</p>
</li>
<li><p>TCP makes sure all the pieces arrive intact and in order.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/e3f99d37-6924-47d4-897f-e2e7e769c20f.png" alt="" style="display:block;margin:0 auto" />

<h3>Why HTTP Doesn’t Replace TCP</h3>
<p>HTTP has no idea how to handle lost packets, ordering, or retransmission. That’s TCP’s whole job. HTTP simply assumes that whatever it sends will arrive safely, because TCP is quietly working underneath.</p>
<p>So when someone asks, “Is HTTP the same as TCP?”, the answer is: <strong>no, HTTP runs on top of TCP.</strong> (One small note for later: newer versions of HTTP, like HTTP/3, actually run over a UDP-based protocol called QUIC, but for now, “HTTP runs on TCP” is the right mental model.)</p>
<h3>Wrapping Up</h3>
<p>The internet needs rules, and these are three of the big ones. TCP is a careful phone call that guarantees delivery. UDP is a fast announcement that doesn’t look back. HTTP is the language websites speak, riding on top of TCP.</p>
<p>Pick TCP when accuracy matters, UDP when speed matters, and remember that HTTP and TCP are partners, not the same thing.</p>
]]></content:encoded></item><item><title><![CDATA[How TCP Works: The 3-Way Handshake and Reliable Communication]]></title><description><![CDATA[Learn how TCP works in simple terms : the 3-way handshake, sequence numbers, ACKs, retransmission, & how connections close. A beginner-friendly guide.]]></description><link>https://hardikdotdev.hashnode.dev/how-tcp-works-3-way-handshake</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/how-tcp-works-3-way-handshake</guid><category><![CDATA[TCP]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[networking]]></category><category><![CDATA[computer networking]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[beginners guide]]></category><category><![CDATA[networking for beginners]]></category><category><![CDATA[3-way handshake]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Tue, 20 Oct 2026 14:02:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/773941c8-3284-4745-9e8b-04521ad163b8.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine sending a 10-page letter by dropping each page into a different mailbox, with no page numbers and no way to know if any arrived. Some pages get lost. Some arrive in the wrong order. Some come twice. The reader gets a confusing mess.</p>
<p>That’s what sending data over a network looks like <strong>without rules</strong>. TCP is the set of rules that fixes it. This blog is for beginners, so we’ll keep it simple and skip packet-level details.</p>
<h3>What is TCP and Why Do We Need It?</h3>
<p>TCP (Transmission Control Protocol) is a protocol that makes sure data gets from one computer to another <strong>reliably, in order, and without damage</strong>.</p>
<p>Networks are messy. The internet is made of many devices passing little chunks of data (called packets) along different routes. Things go wrong, and TCP is the system that handles it, so your web pages, emails, and downloads arrive intact.</p>
<h3>Problems TCP Solves</h3>
<p>When data travels over a network, four things can go wrong:</p>
<ol>
<li><p><strong>Lost packets:</strong> some pieces never arrive.</p>
</li>
<li><p><strong>Out-of-order packets:</strong> pieces arrive in a different order than they were sent.</p>
</li>
<li><p><strong>Duplicate packets:</strong> the same piece arrives twice.</p>
</li>
<li><p><strong>Corrupted packets:</strong> a piece arrives damaged.</p>
</li>
</ol>
<p>TCP detects each of these and fixes them automatically, so the application on top (your browser, for example) never has to worry.</p>
<h3>The 3-Way Handshake: Saying Hello Properly</h3>
<p>Before sending any real data, TCP makes sure both sides are ready. It does this with a three-step greeting called the <strong>3-way handshake</strong>.</p>
<p>Think of a phone call:</p>
<p><strong>Step 1 (SYN):</strong> You call and say, “Hi, can you hear me?”</p>
<p><strong>Step 2 (SYN-ACK):</strong> They answer, “Yes, I can hear you. Can you hear me?”</p>
<p><strong>Step 3 (ACK):</strong> You say, “Yes, I can. Let’s talk.”</p>
<p>Now both sides know the line works in both directions.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/3584d462-1281-4700-8cb5-b5020edf1acf.png" alt="" style="display:block;margin:0 auto" />

<p>In TCP terms:</p>
<ol>
<li><p><strong>SYN (synchronize):</strong> The client says, “I want to connect, and I’ll start counting my data from number X.”</p>
</li>
<li><p><strong>SYN-ACK:</strong> The server says, “Got it. I’m ready too, and I’ll start counting from number Y.”</p>
</li>
<li><p><strong>ACK (acknowledge):</strong> The client says, “Got yours too. Connection open.”</p>
</li>
</ol>
<p>Those starting numbers are called <strong>sequence numbers</strong>, and they’re the key to everything that follows.</p>
<h3>How Data Transfer Works</h3>
<p>Once connected, TCP breaks your data into small pieces and gives each one a <strong>sequence number</strong>, like page numbers in a letter. The receiver sends back <strong>acknowledgements (ACKs)</strong> saying, “I got everything up to here.”</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/5d612929-4556-492a-8c81-42b6f2d281e4.png" alt="" style="display:block;margin:0 auto" />

<p>Sequence numbers let the receiver put pieces back in the right order, even if they arrive jumbled, and spot duplicates and throw them away.</p>
<h3>How TCP Ensures Reliability</h3>
<p><strong>Packet loss and retransmission:</strong> What if a piece goes missing? The sender waits for an ACK. If it doesn’t arrive within a short time, the sender assumes the piece was lost and <strong>sends it again</strong>. This is called <strong>retransmission</strong>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/4c542ec7-d1de-461b-9818-3919829d7ab6.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Correctness:</strong> Each piece also carries a small check value (a checksum). If the data arrives damaged, the receiver notices and discards it, and the missing ACK triggers a resend.</p>
<p><strong>Flow control:</strong> TCP also stops a fast sender from overwhelming a slow receiver, so it adjusts its speed to what the other side can handle.</p>
<p>Together, these give us reliability (nothing lost), order (correct sequence), and correctness (nothing damaged).</p>
<h3>How a TCP Connection is Closed</h3>
<p>When both sides are done, they say goodbye politely, again using a conversation:</p>
<ol>
<li><p><strong>FIN:</strong> One side says, “I’m finished sending.”</p>
</li>
<li><p><strong>ACK:</strong> The other side replies, “Got it.”</p>
</li>
<li><p><strong>FIN:</strong> The other side says, “I’m finished too.”</p>
</li>
<li><p><strong>ACK:</strong> The first side confirms, “Okay, bye.”</p>
</li>
</ol>
<p>Closing takes four steps because each direction of the connection is closed separately.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/4d941344-0969-4cdc-b67f-36d0450ad181.png" alt="" style="display:block;margin:0 auto" />

<h3>Why This Matters for Developers</h3>
<p>Almost everything you build on the web, including HTTP requests, APIs, and database connections, runs on top of TCP. When you see a “connection timeout” or “connection refused” error, the handshake is where things went wrong. And when a site feels slow, retransmissions caused by a bad network may be the reason.</p>
<h3>Wrapping Up</h3>
<p>TCP is a polite, careful conversation between two computers. They greet each other (3-way handshake), exchange numbered pieces and confirm each one (data transfer), resend anything lost (reliability), and say goodbye properly (connection close).</p>
]]></content:encoded></item><item><title><![CDATA[DNS Record Types Explained: A Beginner-Friendly Guide]]></title><description><![CDATA[New to DNS? Learn what A, AAAA, CNAME, MX, NS, and TXT records do, with easy analogies, clear examples, and a full setup you can follow.]]></description><link>https://hardikdotdev.hashnode.dev/dns-record-types-explained-beginner-guide</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/dns-record-types-explained-beginner-guide</guid><category><![CDATA[dns]]></category><category><![CDATA[webdevelopment]]></category><category><![CDATA[networking]]></category><category><![CDATA[Domain Name System]]></category><category><![CDATA[internet]]></category><category><![CDATA[dns-records]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Mon, 19 Oct 2026 13:34:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/98e026ee-6356-4fe5-b902-4235fd439534.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>How does a browser know where a website lives?</p>
<p>You type a name like <code>mysite.com</code>, and a moment later the page appears. But computers don’t understand names, they understand numbers. Somewhere in between, something looks up the name and finds the right place.</p>
<p>That something is DNS, and the details live in small entries called <strong>DNS records</strong>. Don’t worry, there are only a handful you need to know, and we’ll take them one at a time.</p>
<h3>What is DNS?</h3>
<p>DNS is the <strong>phonebook of the internet</strong>. You look up a name, and it gives you the number. You remember <code>mysite.com</code>, and DNS finds the address behind it.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/86cd2182-7b2b-44bf-a9f6-e0d60d7e3823.png" alt="" style="display:block;margin-left:auto" />

<h3>Why Do We Need DNS Records?</h3>
<p>A phonebook entry doesn’t just hold a number. Some entries hold an address, a work number, or an email. DNS works the same way. A domain needs to answer different questions: Where is the website? Who manages this domain? Where should emails go?</p>
<p>Each question is answered by a different <strong>record type</strong>. Let’s meet them.</p>
<h3>NS Record: Who’s in Charge?</h3>
<p>An NS (Name Server) record says <strong>which servers are responsible for your domain’s records</strong>. Think of it as the <strong>post office that handles all mail for your street</strong>. When anyone asks about your domain, they’re sent there first.</p>
<p>When you buy a domain and point it to a hosting or DNS provider, you’re setting its NS records.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/f3e0156e-ad84-44ca-91e7-07653ba73e76.png" alt="" style="display:block;margin:0 auto" />

<h3>A Record: Domain → IPv4 Address</h3>
<p>An A record connects a name to an <strong>IPv4 address</strong> (like <code>192.0.2.10</code>). It’s the <strong>house address</strong> of your website.</p>
<pre><code class="language-plaintext">mysite.com    A    76.76.1.1
</code></pre>
<p>This solves the most basic problem: “where is the server for this name?”</p>
<h3>AAAA Record: Domain → IPv6 Address</h3>
<p>Same job as an A record, but for the newer <strong>IPv6</strong> format (like <code>2001:db8::1</code>). The world was running out of IPv4 addresses, so IPv6 was created. Many sites keep both records so every visitor can connect.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/60e7d95b-c427-483c-ad4f-ccd43691763d.png" alt="" style="display:block;margin:0 auto" />

<h3>CNAME Record: One Name Pointing to Another</h3>
<p>A CNAME says “this name is just another name for that one.”</p>
<pre><code class="language-plaintext">www.mysite.com    CNAME    mysite.com
</code></pre>
<p>Think of it as a <strong>nickname</strong>. If you call someone “Hardik” and Hardy,” both lead to the same person. The big benefit is that if the real address changes, you only update one record and every nickname follows.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/65f76857-92bf-46c8-9070-ea057ab272a4.png" alt="" style="display:block;margin:0 auto" />

<p><strong>A vs CNAME, gently cleared up:</strong> An A record points a name to an <strong>IP address</strong>. A CNAME points a name to <strong>another name</strong>. If you know the IP, use A. If you want one name to follow another, use CNAME. One handy rule: a CNAME can’t normally sit on the bare root domain (<code>mysite.com</code>), so root domains use A records.</p>
<h3>MX Record: Where Does Email Go?</h3>
<p>When someone emails <code>hello@mysite.com</code>, how does the message find your mail server? Through MX (Mail Exchange) records, which tell the world which servers accept email for your domain.</p>
<pre><code class="language-plaintext">mysite.com  MX  10  mail.mysite.com
</code></pre>
<p>The number is a <strong>priority</strong>, and lower numbers are tried first. It’s like a <strong>mailbox address that’s separate from your house</strong>. Your website and your email can live in completely different places.</p>
<p><strong>NS vs MX, gently cleared up:</strong> NS says <strong>who manages the domain’s records</strong>. MX says <strong>where emails should be delivered</strong>. One handles control, the other handles mail.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/ae5608bd-6ef9-4794-b821-31ca013cf228.png" alt="" style="display:block;margin:0 auto" />

<h3>TXT Record: Extra Information</h3>
<p>A TXT record holds plain text notes about your domain. It’s mostly used for <strong>verification and email security</strong>, like proving to a service that you own the domain, or setting email rules (SPF, DKIM) so your emails don’t land in spam.</p>
<pre><code class="language-plaintext">mysite.com    TXT    "verification-code-abc123"
</code></pre>
<p>Think of it as a <strong>sticky note</strong> on your door that others can read to confirm it’s really yours.</p>
<h3>How They Work Together</h3>
<p>Here’s one small website with everything in place:</p>
<pre><code class="language-plaintext">mysite.com        NS       ns1.dnsprovider.com
mysite.com        A        76.76.1.1
mysite.com        AAAA     2001:db8::1
www.mysite.com    CNAME    mysite.com
mysite.com        MX       10 mail.mysite.com
mysite.com        TXT      "verification-code-abc123"
</code></pre>
<p>Visitors use A and AAAA to find the site. <code>www</code> follows along through the CNAME. Emails use MX to reach your inbox. Services use TXT to verify you. And NS makes sure everyone asks the right place.</p>
<h3>Wrapping Up</h3>
<p>NS says who’s in charge. A and AAAA say where the site lives. CNAME gives a name a nickname. MX handles email. TXT holds notes and proof. Six small records, and together they run your domain.</p>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works: What Happens Before a Website Loads]]></title><description><![CDATA[Learn how DNS resolution works step by step: browser cache, resolver, root, TLD, and authoritative servers. A beginner-friendly guide with dig example]]></description><link>https://hardikdotdev.hashnode.dev/how-dns-resolution-works</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/how-dns-resolution-works</guid><category><![CDATA[dns]]></category><category><![CDATA[#DNS Resolution]]></category><category><![CDATA[How DNS works]]></category><category><![CDATA[Domain Name System]]></category><category><![CDATA[networking]]></category><category><![CDATA[dig]]></category><category><![CDATA[root servers]]></category><category><![CDATA[#TLD]]></category><category><![CDATA[ip address]]></category><category><![CDATA[recursive resolver]]></category><category><![CDATA[networking for beginners]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Sun, 18 Oct 2026 06:46:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/363942fc-c59d-4d38-8475-d5ac3cae135b.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You type <code>google.com</code> and press Enter. Before a single byte of the page arrives, your computer has to answer one question: <strong>where is google.com?</strong></p>
<p>Computers don’t understand names. They understand IP addresses like <code>142.250.x.x</code>. DNS is the system that translates one into the other, and in this blog we’ll watch it work, live, using a tool called <code>dig</code>.</p>
<h3>What is DNS and Why Does It Exist?</h3>
<p>DNS (Domain Name System) is the <strong>internet’s phonebook</strong>. You remember names, but computers need numbers. DNS looks up the name and returns the number.</p>
<p>Imagine if you had to memorize an IP address for every website you use. DNS exists so you never have to.</p>
<h3>What is <code>dig</code>?</h3>
<p><code>dig</code> is a command-line tool that lets you ask DNS questions and see the raw answers. Developers use it to debug problems like “my domain isn’t loading” or “I changed my DNS settings, did it work?”</p>
<p>Think of it as a <strong>flashlight</strong> for DNS: normally the whole process is invisible, and <code>dig</code> lets you see inside.</p>
<h3>DNS Works in Layers</h3>
<p>No single server knows every website. Instead, DNS is a hierarchy with three levels:</p>
<p><strong>Root → TLD → Authoritative</strong></p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/a2b73401-faf1-4180-be36-cdca4bae4d82.png" alt="" style="display:block;margin-left:auto" />

<p>Each level only knows who to ask next. It’s like asking for directions: the first person says “go to that town,” the next says “go to that street,” and the last one points at the exact house.</p>
<p>Let’s walk through each layer with <code>dig</code>.</p>
<h3>Layer 1: Root Name Servers (<code>dig . NS</code>)</h3>
<pre><code class="language-shell">dig . NS
</code></pre>
<p>The single dot <code>.</code> represents the <strong>root</strong> of the internet. This command asks, “Who are the root name servers?”</p>
<p>The answer is a list of 13 named servers, <code>a.root-servers.net</code> through <code>m.root-servers.net</code>. (Each name is backed by many machines around the world, so there are far more than 13 physical servers.)</p>
<p><strong>NS records</strong> (Name Server records) simply say “these servers are responsible for this zone.” That’s what you’re seeing here.</p>
<p>The root servers don’t know where google.com is. They only know who handles <code>.com</code>, <code>.org</code>, <code>.net</code>, and the rest.</p>
<h3>Layer 2: TLD Name Servers (<code>dig com NS</code>)</h3>
<pre><code class="language-shell">dig com NS
</code></pre>
<p>TLD stands for Top-Level Domain, like <code>.com</code>. This command asks, “Who manages everything ending in .com?”</p>
<p>You’ll get servers like <code>a.gtld-servers.net</code>. These servers don’t know google.com’s IP either, but they know <strong>which servers are in charge of google.com</strong>.</p>
<h3>Layer 3: Authoritative Name Servers (<code>dig google.com NS</code>)</h3>
<pre><code class="language-shell">dig google.com NS
</code></pre>
<p>Now we’re at the last level. The answer lists servers like <code>ns1.google.com</code> through <code>ns4.google.com</code>. These are the <strong>authoritative</strong> servers, the ones Google itself controls. They hold the real, final answer.</p>
<p>This is why NS records matter: when you buy a domain and point it to a hosting provider, you’re setting its NS records, telling the world who is in charge of your domain.</p>
<h3>The Full Flow (<code>dig google.com</code>)</h3>
<pre><code class="language-shell">dig google.com
</code></pre>
<p>Now we ask the real question. In the output, look at the <strong>ANSWER SECTION</strong>. You’ll see an <code>A</code> record: google.com and its IP address. Next to it is a number called <strong>TTL</strong> (time to live), which tells caches how many seconds they can remember this answer.</p>
<p>But how did we get that answer without visiting each server by hand? That’s the job of the <strong>recursive resolver</strong>.</p>
<h3>The Recursive Resolver: Your Personal Assistant</h3>
<p>When your browser needs an IP, it asks a recursive resolver (usually run by your ISP, or something like 8.8.8.8). The resolver does all the legwork:</p>
<ol>
<li><p>Asks a <strong>root server</strong>: “Where is google.com?” → “Ask the .com servers.”</p>
</li>
<li><p>Asks a <strong>TLD server</strong>: “Where is google.com?” → “Ask ns1.google.com.”</p>
</li>
<li><p>Asks the <strong>authoritative server</strong>: “Where is google.com?” → “Here’s the IP.”</p>
</li>
<li><p>Returns the answer to your browser and <strong>caches</strong> it for the TTL.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/68c8b5f4-ca07-4e92-ab6e-b0c7d9f47fba.png" alt="" style="display:block;margin-left:auto" />

<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/7583f9e8-0323-4da2-bbc8-7a34c2ae985d.png" alt="" style="display:block;margin:0 auto" />

<p>Because of caching, most lookups skip these steps entirely and finish in milliseconds.</p>
<h3>Connecting It to Your Browser</h3>
<p>Here’s the real-world order of events when you open a website:</p>
<ol>
<li><p>The browser checks its own cache.</p>
</li>
<li><p>If it’s not there, it asks the recursive resolver.</p>
</li>
<li><p>The resolver finds the IP through root → TLD → authoritative (or its cache).</p>
</li>
<li><p>The browser connects to that IP and loads the page.</p>
</li>
</ol>
<p>DNS is step zero of every request. If it fails, nothing else happens, which is why “DNS issue” is a classic cause of “the site is down.”</p>
<h3>Why This Matters for Engineers</h3>
<p>Once you understand DNS, many mysteries get easier: why changes to your domain take time to spread (caching and TTL), why a site works on one network but not another (different resolvers), and why DNS providers are such a critical part of system design.</p>
<h3>Wrapping Up</h3>
<p>DNS translates names into IPs through layers: root points to TLD, TLD points to authoritative, and the authoritative server gives the final answer. The recursive resolver does the work for you, and <code>dig</code> lets you watch it happen.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices: How the Internet Actually Reaches Your Code]]></title><description><![CDATA[Learn how modems, routers, switches, hubs, firewalls, and load balancers work together to bring the internet to your code. A beginner-friendly guide.]]></description><link>https://hardikdotdev.hashnode.dev/understanding-network-devices</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/understanding-network-devices</guid><category><![CDATA[networking]]></category><category><![CDATA[network devices]]></category><category><![CDATA[computer networking]]></category><category><![CDATA[router]]></category><category><![CDATA[SWITCH]]></category><category><![CDATA[firewall]]></category><category><![CDATA[Load Balancer]]></category><category><![CDATA[modem]]></category><category><![CDATA[How the internet works ]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[networking for beginners]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Sun, 18 Oct 2026 06:40:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/74a18172-081b-467a-be1d-06a656f07225.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You open a website, and it loads in under a second. Looks like magic, right?</p>
<p>Behind that one click, your request passes through a chain of devices: a modem, a router, a switch, a firewall, and maybe a load balancer. As a software engineer, you don’t need to configure them, but you do need to know what they do. When your app is slow or unreachable, this is where the answers are.</p>
<p>This blog is for beginners. We’ll go one device at a time, with one job each.</p>
<h3>The Big Picture</h3>
<p>Your internet journey looks like this:</p>
<p><strong>Internet → Modem → Router → Switch → Your devices</strong></p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/9ec50c81-90ea-4b41-a103-a004c0e228d9.png" alt="" style="display:block;margin:0 auto" />

<p>Now let’s meet each one.</p>
<h3>Modem: The Translator</h3>
<p>Your internet provider sends data through cables or fiber, in a signal format your laptop can’t understand. The modem translates that signal into digital data your devices can use, and back again.</p>
<p>Analogy: the modem is the <strong>front door of your house</strong>. It’s the only way the outside world gets in. Without it, you have no internet at all.</p>
<h3>Router: The Traffic Police</h3>
<p>The modem brings the internet in, but who decides which device gets which data? That’s the router.</p>
<p>It gives every device a local IP address, sends the right data to the right device, and forwards your requests out to the internet. It also connects separate networks together, such as your home network and the internet.</p>
<p>Analogy: a <strong>traffic police officer</strong> at a crossroads, pointing every vehicle in the right direction.</p>
<p><strong>Modem vs Router:</strong> The modem connects you to the internet. The router shares that connection among your devices and directs traffic. Many home boxes combine both, which is why people confuse them.</p>
<h3>Hub vs Switch: How Local Networks Work</h3>
<p>Now you have a router, but what if an office has 50 computers? You plug them all into a device that links them together. There are two types.</p>
<p><strong>Hub:</strong> A hub is simple and not very smart. When it receives data, it sends it to <strong>every</strong> connected device. Everyone gets everything, even if it wasn’t meant for them. That wastes bandwidth and is a security risk.</p>
<p><strong>Switch:</strong> A switch is smarter. It learns which device sits on which port (using MAC addresses) and sends data <strong>only to the intended device</strong>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/c4c4e973-77a2-4c7e-939e-0c4524ccb608.png" alt="" style="display:block;margin:0 auto" />

<p>Analogy: a hub is a teacher shouting a message to the whole class. A switch is a teacher passing a note to one student. That’s why switches replaced hubs almost everywhere.</p>
<h3>Firewall: The Security Gate</h3>
<p>Not everything coming through your network is friendly. A firewall watches traffic and follows rules: allow this, block that.</p>
<p>For example, it can allow web traffic on port 443 and block everything else. It protects your network from unwanted access, and it can also stop your own systems from sending data where they shouldn’t.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/dc0f1f43-7ee9-4535-a491-90a6f6999fcc.png" alt="" style="display:block;margin:0 auto" />

<p>Analogy: a <strong>security guard at a gate</strong> checking everyone’s ID before letting them in. This is where security lives, and when you hear about “opening a port” on a server, a firewall rule is usually involved.</p>
<h3>Load Balancer: The Toll Booth Manager</h3>
<p>Imagine your app goes viral and 100,000 users arrive at once. One server can’t handle that. So you run multiple servers, but how do users know which one to hit?</p>
<p>A load balancer sits in front of your servers and spreads incoming requests across them. If one server crashes, it stops sending traffic there, so users never notice.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/3e402556-deea-4261-a31f-1f50a466852b.png" alt="" style="display:block;margin:0 auto" />

<p>Analogy: a <strong>toll plaza</strong> with many booths. The manager directs each car to the shortest line. This is why scalable systems need load balancers: they add capacity and reliability at the same time.</p>
<h3>How They Work Together</h3>
<p>Here’s a real web app setup, in order:</p>
<ol>
<li><p>A user sends a request from their phone.</p>
</li>
<li><p>It travels over the internet to your company’s network.</p>
</li>
<li><p>The <strong>firewall</strong> checks if the request is allowed.</p>
</li>
<li><p>The <strong>load balancer</strong> picks a healthy server.</p>
</li>
<li><p>The <strong>router</strong> and <strong>switch</strong> deliver it inside the network to that server.</p>
</li>
<li><p>The server processes the request and sends the response back the same way.</p>
</li>
</ol>
<p>In real cloud deployments, these exist as virtual services (security groups, virtual routers, managed load balancers), but the jobs are the same.</p>
<h3>Why This Matters for Backend Engineers</h3>
<p>When you deploy code, you’re deploying into this world. Once you know it, errors stop being scary:</p>
<p>A “connection timed out” error might be a firewall blocking your port. A server that’s down but your site still works? The load balancer is routing around it. An app that works locally but not in production? Networking is the first thing to check.</p>
<h3>Wrapping Up</h3>
<p>Modem brings the internet in. Router directs traffic. Switch connects local devices smartly. Firewall guards the gate. Load balancer shares the work. Remember those five jobs and you’ll understand how any system gets from your keyboard to your users.</p>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: Basics and Essential Commands]]></title><description><![CDATA[New to Git? Learn what Git is, why developers use it, the three areas of Git, and the essential commands: init, add, commit, log, revert, and reset.]]></description><link>https://hardikdotdev.hashnode.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[version control]]></category><category><![CDATA[Git for Beginners]]></category><category><![CDATA[Git Commands]]></category><category><![CDATA[git basics]]></category><category><![CDATA[git commit]]></category><category><![CDATA[git revert]]></category><category><![CDATA[git reset]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Programming Blogs]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Fri, 16 Oct 2026 01:50:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/27ae7f31-69a8-4fa8-a034-6770713f85d6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You’ve been working on your project for hours. Everything finally works. Then you try “one small change,” and suddenly nothing does. You hit undo again and again, but it’s too late. The old working version is gone.</p>
<p>Git exists so this never happens to you. This blog is for complete beginners, and by the end you’ll know what Git is, why developers swear by it, and the commands you’ll use every single day.</p>
<h3>What is Git?</h3>
<p>Git is a <strong>distributed version control system</strong>. In simple words, it’s a tool that remembers every version of your project, so you can go back to any earlier point in time.</p>
<p>“Distributed” means every developer has a full copy of the project and its history on their own computer. You don’t need the internet to save your work, and if one computer dies, the project still lives on the others.</p>
<h3>Why Git is Used</h3>
<p>Developers use Git for three big reasons:</p>
<ol>
<li><p><strong>Safety:</strong> You can always go back to a version that worked.</p>
</li>
<li><p><strong>Teamwork:</strong> Many people can work on the same project without overwriting each other.</p>
</li>
<li><p><strong>History:</strong> You can see who changed what, and why.</p>
</li>
</ol>
<p>Think of it as a “save point” in a video game. You don’t replay the whole game when you die. You just reload.</p>
<h3>Core Terminologies</h3>
<p>Before the commands, here are four words you’ll hear constantly.</p>
<p><strong>Repository (repo):</strong> Your project folder plus all of its saved history.</p>
<p><strong>Commit:</strong> A saved snapshot of your project at a moment in time, with a message describing what changed.</p>
<p><strong>Branch:</strong> A separate line of work. You can try a new feature on a branch without touching your main code. The default is usually called <code>main</code>.</p>
<p><strong>HEAD:</strong> A pointer that says where you are right now, usually the latest commit of your current branch.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/84f94696-115f-48d2-9abb-3a49e4b16f20.png" alt="" style="display:block;margin-left:auto" />

<h3>The Three Areas of Git</h3>
<p>This is the most important idea to understand. Your files move through three places:</p>
<ol>
<li><p><strong>Working directory:</strong> where you edit your files.</p>
</li>
<li><p><strong>Staging area:</strong> where you pick which changes go into the next commit.</p>
</li>
<li><p><strong>Repository:</strong> where the committed snapshots are stored permanently.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/3e4c9128-7127-47e8-9293-4db8f7180c18.png" alt="" style="display:block;margin-left:auto" />

<p>Staging is like packing a box before shipping. You choose what goes in, then you seal it with a commit.</p>
<h3>Essential Git Commands</h3>
<p>Let’s use them on a real project.</p>
<p><strong>1.</strong> <code>git init</code> starts Git in your folder.</p>
<pre><code class="language-shell">git init
</code></pre>
<p><strong>2.</strong> <code>git status</code> shows what’s changed, what’s staged, and what’s untouched. Use it all the time.</p>
<pre><code class="language-shell">git status
</code></pre>
<p><strong>3.</strong> <code>git add</code> moves changes into the staging area.</p>
<pre><code class="language-shell">git add index.html
git add .
</code></pre>
<p>The second one stages everything.</p>
<p><strong>4.</strong> <code>git commit</code> saves the staged changes with a message.</p>
<pre><code class="language-shell">git commit -m "Add homepage"
</code></pre>
<p><strong>5.</strong> <code>git log</code> shows your commit history.</p>
<pre><code class="language-shell">git log 
</code></pre>
<h4>6. <code>git revert</code></h4>
<p>Undoes a commit safely by creating a <strong>new commit</strong> that cancels out the old one. Your history stays intact, so it’s the right choice for work you’ve already shared.</p>
<pre><code class="language-shell">git log --oneline
# a1b2c3d Add login validation
# e4f5a6b Fix password bug

git revert a1b2c3d
</code></pre>
<p>Use the short code (hash) from <code>git log --oneline</code> to pick the commit you want to undo.</p>
<p>Under the hood, nothing is erased. Git just adds one more commit object on top of the chain, one whose snapshot undoes the old change.</p>
<h4>7. <code>git reset --hard</code></h4>
<p>Moves your project back to an older commit and deletes everything after it, including any uncommitted changes in your files.</p>
<pre><code class="language-shell">git reset --hard e4f5a6b
</code></pre>
<p><strong>Be careful :</strong> The commits after that point disappear from your history, and uncommitted work is gone for good. Never use it on commits you’ve already pushed and shared with others.</p>
<p>Two more you’ll need soon : <code>git branch</code> lists your branches, and <code>git clone &lt;url&gt;</code> copies an existing repository to your computer.</p>
<h3>A Basic Workflow From Scratch</h3>
<p>Here’s the whole thing together:</p>
<pre><code class="language-shell">mkdir my-project
cd my-project
git init
echo "Hello Git" &gt; hello.txt
git status
git add hello.txt
git commit -m "Add hello file"
git log --oneline
</code></pre>
<p>Now change the file, run <code>git status</code> again, and repeat <code>add</code> and <code>commit</code>. Each loop creates a new commit, and your history grows like a chain.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/8793cc21-006d-4bcc-8e0f-bc9f38c58029.png" alt="" style="display:block;margin-left:auto" />

<p>The loop is simple: <strong>edit, status, add, commit.</strong> Do it a few times and it becomes muscle memory.</p>
<h3>Wrapping Up</h3>
<p>Git isn’t scary. It’s the save button your projects always needed. Master the three areas and the seven commands above, and you’re ready for real projects. Start small, commit often, and never lose your work again.</p>
]]></content:encoded></item><item><title><![CDATA[Inside Git: How It Works and the Role of the .git Folder]]></title><description><![CDATA[Stop memorizing Git commands. Learn how Git works under the hood: the .git folder, blobs, trees, commits, hashes, and what add and commit really do.]]></description><link>https://hardikdotdev.hashnode.dev/inside-git-how-it-works-and-the-role-of-the-git-folder</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/inside-git-how-it-works-and-the-role-of-the-git-folder</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[version control]]></category><category><![CDATA[Git-Internals]]></category><category><![CDATA[How Git Works]]></category><category><![CDATA[Git for Beginners]]></category><category><![CDATA[git objects]]></category><category><![CDATA[git commit]]></category><category><![CDATA[git add]]></category><category><![CDATA[.git folder]]></category><category><![CDATA[git hash]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Fri, 16 Oct 2026 01:44:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/46da4b40-662a-4e2c-aaac-659926c29fae.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Remember the <code>final_v2_latest_REAL</code> folder nightmare? Git fixed it. But most beginners use Git like a magic spell : type <code>git add</code>, type <code>git commit</code>, and hope for the best.</p>
<p>Then one day something breaks, and you realize you have no idea what Git is actually doing. If that’s you, this blog is for you. We’ll skip the memorizing and build a mental model instead.</p>
<h3>The .git Folder: Git’s Brain</h3>
<p>Run <code>git init</code> in any project and Git quietly creates a hidden folder called <code>.git</code>. This folder is your repository. Your project files are just the visible part. Everything Git knows, including history, branches, and commits, lives inside <code>.git</code>.</p>
<p>That’s also why deleting it makes your project forget all its history, and why copying it to another machine copies the whole repository.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/6999b38c-033b-45a8-8a0b-2119cfd8b664.png" alt="" style="display:block;margin:0 auto" />

<p>Here are the key parts:</p>
<ol>
<li><p><code>objects/</code> sthores all your content (files, folders, commits).</p>
</li>
<li><p><code>refs/</code> stores branch names and where they point.</p>
</li>
<li><p><code>HEAD</code> tells Git which branch you’re currently on.</p>
</li>
<li><p><code>index</code> is the staging area, the waiting room for your next commit.</p>
</li>
</ol>
<h3>Git Objects: Blob, Tree, Commit</h3>
<p>Git is basically a database made of three simple object types.</p>
<p><strong>Blob</strong> stores the contents of a file. Only the content. It doesn’t even know the filename.</p>
<p><strong>Tree</strong> is like a folder. It lists which blobs and other trees belong together, along with their filenames.</p>
<p><strong>Commit</strong> is a snapshot. It points to one tree (the project at that moment), stores the author, message, and time, and points to its parent commit. That chain of parents is your history.</p>
<p>Think of it like a photo album. Blobs are the raw photos, trees are the pages that arrange them, and a commit is the album’s label saying “this is how it looked on Monday.”</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/c74043dd-4810-4a98-a569-3f595b3a705f.png" alt="" style="display:block;margin:0 auto" />

<h3>Hashes: How Git Keeps Things Honest</h3>
<p>Every object gets a name, which is a hash. It’s a long string like <code>a3f5c9...</code>, calculated from the object’s content. This gives Git two superpowers:</p>
<ol>
<li><p>Same content always gives the same hash, so Git never stores duplicates.</p>
</li>
<li><p>Change even one character and the hash changes completely. If a file gets corrupted or tampered with, Git notices.</p>
</li>
</ol>
<p>A commit’s hash also depends on its parent’s hash, so you can’t quietly rewrite history without everything after it changing too. That’s how Git guarantees integrity.</p>
<h3>What Happens During git add and git commit</h3>
<p>Now the fun part. Let’s say you edit <code>index.html</code> and run these:</p>
<pre><code class="language-shell">git add index.html
git commit -m "Update homepage"
</code></pre>
<p><strong>On git add:</strong> Git reads the file, calculates its hash, and saves its content as a blob inside <code>.git/objects</code>. Then it updates the <code>index</code> (staging area) to say, “this filename now points to this blob.”</p>
<p><strong>On git commit:</strong> Git turns the staging area into a tree object, creates a commit object that points to that tree and to the previous commit, and then moves your current branch forward to the new commit.</p>
<p>That’s it. Nothing is copied around or overwritten. Git just adds new objects and moves a pointer.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/d6c9085f-5927-452f-a565-9fa6d3beccd0.png" alt="" style="display:block;margin-left:auto" />

<h3>How Git Tracks Changes</h3>
<p>Here’s the part that surprises most people. Git doesn’t store “changes.” It stores snapshots. When you view a diff, Git is comparing two snapshots on the spot. And since unchanged files reuse the same blob, snapshots stay small and fast.</p>
<h3>Wrapping Up</h3>
<p>Once you see Git as blobs, trees, commits, and pointers, commands stop feeling like spells. <code>git add</code> makes blobs, <code>git commit</code> makes trees and commits, and branches are just labels pointing to commits.</p>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Problem]]></title><description><![CDATA[Overwritten code, lost changes, and files named final_v2_latest_REAL. Learn why version control exists and why every developer needs Git.]]></description><link>https://hardikdotdev.hashnode.dev/why-version-control-exists-the-pendrive-problem</link><guid isPermaLink="true">https://hardikdotdev.hashnode.dev/why-version-control-exists-the-pendrive-problem</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[versioncontrol]]></category><category><![CDATA[webdev]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[software development]]></category><dc:creator><![CDATA[Hardik Babla]]></dc:creator><pubDate>Wed, 14 Oct 2026 10:28:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/24e12e96-c602-4a06-a734-52a5e49ef183.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Picture this: it’s 2 AM, and your project is due in the morning. You and your friend Rahul have each been coding your half of a college project. He hands you a pendrive with his latest code. You copy it over, merge things by hand, and run it. Everything works.</p>
<p>Then Rahul calls: “Bro, did you use my latest file? I fixed a bug last night.”</p>
<p>Silence. You check, and you used the old one. Your own changes from this morning are gone too, because you pasted his files right over yours.</p>
<p>If you’re new to programming, this blog is for you. It explains why this nightmare is the reason version control exists.</p>
<h3>The Pendrive Workflow</h3>
<p>Before tools like Git, sharing code meant pendrives, emails, and USB cables. Folders looked like this:</p>
<pre><code class="language-plaintext">project_final
project_final_v2
project_final_v2_latest
project_final_v2_latest_REAL
project_final_v2_latest_REAL_dontTouch
</code></pre>
<p>Nobody could say which one was actually the latest. Everyone had their own copy, and every copy was slightly different.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/0e7f4c47-7722-4ad6-bc5f-2982b32d5e37.png" alt="" style="display:block;margin:0 auto" />

<h3>Overwriting Code</h3>
<p>Say you and Rahul both edit <code>login.js</code>. You add form validation, and he fixes a bug in the password check. You each save your own copy. When you finally combine them, whoever copies last wins, and the other person’s work vanishes silently. No warning appears and no error shows up. You only find out when something breaks.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/aab777c9-f822-4d16-a072-dd406982b2f1.png" alt="" style="display:block;margin-left:auto" />

<h3>Losing Changes</h3>
<p>Overwriting isn’t the only way to lose work. A pendrive gets corrupted. An email gets buried. You delete a function at 1 AM because it “looks useless,” save the file, and realize three days later that you needed it. Without a saved history, there is no undo button for yesterday. Whatever is gone stays gone.</p>
<h3>No Collaboration History</h3>
<p>Even when nothing was lost, one question had no answer: who changed this, and why?</p>
<p>Suppose the app crashes after a team update. You open the code and find a strange line. Who wrote it? When? What was it replacing? With pendrives and folders, nobody knows. You end up asking the whole team on WhatsApp, and everybody says, “Not me.”</p>
<img src="https://cdn.hashnode.com/uploads/covers/6aa385803606a7bd7c205588/bac9d1a3-6b94-4e77-9038-45a7c34c83dd.png" alt="" style="display:block;margin:0 auto" />

<h3>Why This Breaks Real Teams</h3>
<p>With two people, this is annoying. With ten, it’s chaos. Add up the problems:</p>
<ol>
<li><p>Nobody knows which file is the latest.</p>
</li>
<li><p>Two people’s work collides and one gets erased.</p>
</li>
<li><p>Mistakes can’t be undone.</p>
</li>
<li><p>There is no record of who changed what.</p>
</li>
</ol>
<p>Real software has thousands of files and many developers working at the same time. Sharing by pendrive doesn’t scale. Teams were losing hours, and sometimes weeks, to the same avoidable mistakes.</p>
<h3>Enter Version Control</h3>
<p>Developers needed one shared place for the code, a record of every change, and a safe way to combine everyone’s work. That is exactly what a Version Control System (VCS) provides. Instead of copying files around, you:</p>
<ol>
<li><p>Keep the project in one central place (a repository).</p>
</li>
<li><p>Save changes as small checkpoints called commits, each with a note on what changed and who made it.</p>
</li>
<li><p>Go back to any older version whenever you want.</p>
</li>
<li><p>Merge multiple people’s work without silently erasing anyone’s.</p>
</li>
</ol>
<p>It’s like having a “save point” in a video game. If you mess up, you reload instead of starting over.</p>
<h3>Why It Became Mandatory</h3>
<p>Today, no serious team writes code without version control. It protects your work, shows the full history, and lets many people build the same project together. Companies expect it, and so should you.</p>
<p>So the next time you see a folder named <code>final_v2_latest_REAL</code>, you’ll know that is the problem Git was built to solve.</p>
]]></content:encoded></item></channel></rss>