<?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[Somnath Sahu]]></title><description><![CDATA[Somnath Sahu]]></description><link>https://blog.somnathsahu.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 09:37:08 GMT</lastBuildDate><atom:link href="https://blog.somnathsahu.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Emmet for HTML: A beginner’s guide to writing faster markup]]></title><description><![CDATA[If you’ve ever spent an afternoon building a website, you know the feeling: your fingers are tired from typing < and > a thousand times. Writing HTML manually can feel like building a skyscraper one literal brick at a time. It’s slow, it’s repetitive...]]></description><link>https://blog.somnathsahu.dev/emmet-for-html</link><guid isPermaLink="true">https://blog.somnathsahu.dev/emmet-for-html</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[HTML5]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Wed, 28 Jan 2026 06:13:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769580789095/6258b9ba-d6e3-448e-ad16-4cf170689206.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you’ve ever spent an afternoon building a website, you know the feeling: your fingers are tired from typing <code>&lt;</code> and <code>&gt;</code> a thousand times. Writing HTML manually can feel like building a skyscraper one literal brick at a time. It’s slow, it’s repetitive, and it’s very easy to forget to close a tag, which breaks your entire layout.</p>
<p>Enter <strong>Emmet</strong>.</p>
<p>Emmet is the ultimate "cheat code" for web developers. It is a plugin (built into most modern editors like VS Code) that allows you to type short, CSS-like snippets and expand them into full blocks of HTML with a single tap of the <strong>Tab</strong> key. It turns minutes of typing into seconds of shorthand.</p>
<hr />
<h2 id="heading-what-is-emmet-really">What is Emmet, Really?</h2>
<p>In simple terms, Emmet is a <strong>shorthand language</strong>. Instead of writing the full "formal" version of HTML, you write a tiny abbreviation. When you hit <strong>Tab</strong>, Emmet looks at your shortcut, recognizes the pattern, and "expands" it into the correct HTML code.</p>
<p>Think of it like texting "omw" instead of "I am on my way." Your phone (the editor) knows exactly what you mean and fills in the rest.</p>
<hr />
<h2 id="heading-the-basics-creating-elements">The Basics: Creating Elements</h2>
<p>The simplest Emmet shortcut is just the name of the tag. If you want a paragraph tag, you don't need to type <code>&lt;p&gt;&lt;/p&gt;</code>.</p>
<p><strong>The Shortcut:</strong> <code>p</code></p>
<p><strong>The Result (after hitting Tab):</strong> <code>&lt;p&gt;&lt;/p&gt;</code></p>
<p>This works for almost every HTML tag: <code>h1</code>, <code>div</code>, <code>section</code>, <code>footer</code>, <code>nav</code>. You just type the word and Tab it into existence.</p>
<hr />
<h2 id="heading-adding-classes-and-ids">Adding Classes and IDs</h2>
<p>If you’ve started learning CSS, you know that we use <strong>Classes</strong> (with a <code>.</code>) and <strong>IDs</strong> (with a <code>#</code>) to identify our elements. Emmet uses that exact same syntax.</p>
<h3 id="heading-adding-a-class">Adding a Class</h3>
<p>If you want a <code>div</code> with a class of "container":</p>
<ul>
<li><p><strong>Abbreviation:</strong> <code>div.container</code></p>
</li>
<li><p><strong>Result:</strong> <code>&lt;div class="container"&gt;&lt;/div&gt;</code></p>
</li>
</ul>
<h3 id="heading-adding-an-id">Adding an ID</h3>
<p>If you want a header with an ID of "main-title":</p>
<ul>
<li><p><strong>Abbreviation:</strong> <code>h1#main-title</code></p>
</li>
<li><p><strong>Result:</strong> <code>&lt;h1 id="main-title"&gt;&lt;/h1&gt;</code></p>
</li>
</ul>
<p>You can even combine them! Typing <a target="_blank" href="http://div.box"><code>div.box</code></a><code>#hero</code> will give you a div with both the class "box" and the ID "hero."</p>
<hr />
<h2 id="heading-nested-elements-building-structures">Nested Elements: Building Structures</h2>
<p>This is where Emmet starts to feel like magic. You can describe the "family tree" of your HTML in a single line using the <code>&gt;</code> symbol (which means "inside").</p>
<p>Imagine you want a navigation bar (<code>nav</code>) that contains an unordered list (<code>ul</code>), which contains a list item (<code>li</code>).</p>
<ul>
<li><p><strong>Abbreviation:</strong> <code>nav&gt;ul&gt;li</code></p>
</li>
<li><p><strong>Result:</strong></p>
</li>
</ul>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
</code></pre>
<h2 id="heading-multiplication-creating-lists-fast">Multiplication: Creating Lists Fast</h2>
<p>One of the most annoying parts of HTML is writing repetitive lists. If you need five list items, you usually have to copy and paste. With Emmet, you just use the <code>*</code> (multiplication) symbol.</p>
<ul>
<li><p><strong>Abbreviation:</strong> <code>ul&gt;li*5</code></p>
</li>
<li><p><strong>Result:</strong> Emmet will generate a <code>ul</code> with five <code>li</code> tags inside it instantly.</p>
</li>
</ul>
<hr />
<h2 id="heading-attributes-and-text">Attributes and Text</h2>
<p>Need a link that points to Google? Or a paragraph that already has text inside it?</p>
<ul>
<li><p><strong>Attributes:</strong> Use square brackets <code>[]</code>.</p>
<ul>
<li><code>a[href="https://google.com"]</code> expands to <code>&lt;a href="https://google.com"&gt;&lt;/a&gt;</code>.</li>
</ul>
</li>
<li><p><strong>Text Content:</strong> Use curly braces <code>{}</code>.</p>
<ul>
<li><code>p{Hello World}</code> expands to <code>&lt;p&gt;Hello World&lt;/p&gt;</code>.</li>
</ul>
</li>
</ul>
<hr />
<h2 id="heading-the-ultimate-shortcut-the-boilerplate">The Ultimate Shortcut: The Boilerplate</h2>
<p>Every HTML file starts with the same "head" and "body" tags. Typing this out every time is a chore. In most editors, Emmet provides a global shortcut to generate the entire starting structure of a webpage.</p>
<p><strong>The Shortcut:</strong> <code>!</code><br /><strong>The Result:</strong> A full, valid HTML5 skeleton including the <code>&lt;!DOCTYPE&gt;</code>, <code>&lt;html&gt;</code>, <code>&lt;head&gt;</code>, and <code>&lt;body&gt;</code> tags.</p>
<hr />
<h2 id="heading-why-every-beginner-should-use-it">Why Every Beginner Should Use It</h2>
<p>You might think, "Shouldn't I learn to type it the long way first?"</p>
<p>While it's important to understand the structure, using Emmet actually helps you learn. Because Emmet uses CSS-style syntax (dots for classes, hashes for IDs), it reinforces the relationship between your HTML structure and your CSS styling. Plus, it prevents "syntax errors"—Emmet never forgets to close a tag or add a closing bracket.</p>
<h3 id="heading-how-to-practice">How to Practice</h3>
<ol>
<li><p>Open <strong>VS Code</strong>.</p>
</li>
<li><p>Create a file named <code>index.html</code>.</p>
</li>
<li><p>Type <code>!</code> and hit <strong>Tab</strong>.</p>
</li>
<li><p>Inside the <code>&lt;body&gt;</code>, try typing <code>div.wrapper&gt;h2{Welcome}+p*3</code> and hit <strong>Tab</strong>.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[CSS Selectors 101: targeting elements with precision]]></title><description><![CDATA[Imagine you have a document with dozens of paragraphs, five different buttons, and three separate menus. If you want to change the color of just one specific button to "sunset orange," how do you tell the browser which one you mean?
This is the job o...]]></description><link>https://blog.somnathsahu.dev/css-selectors</link><guid isPermaLink="true">https://blog.somnathsahu.dev/css-selectors</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[CSS]]></category><category><![CDATA[CSS Animation]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Wed, 28 Jan 2026 04:22:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769574130917/8e93a6a8-79e5-45df-b903-d0ca82a10d4b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine you have a document with dozens of paragraphs, five different buttons, and three separate menus. If you want to change the color of just <em>one</em> specific button to "sunset orange," how do you tell the browser which one you mean?</p>
<p>This is the job of <strong>CSS Selectors</strong>. If HTML is the skeleton of your site, CSS Selectors are the <strong>laser-guided targeting system</strong> that allows you to pick out exactly which part of that skeleton you want to style.</p>
<p>Without selectors, CSS would be a blunt instrument; you’d be forced to change every single paragraph on your site even if you only wanted to highlight one.</p>
<hr />
<h2 id="heading-the-real-world-analogy">The Real-World Analogy</h2>
<p>Think of a browser as a large crowd of people.</p>
<ul>
<li><p><strong>Element Selector:</strong> Calling out, "Everyone wearing a shirt, step forward!" (Broad)</p>
</li>
<li><p><strong>Class Selector:</strong> Calling out, "Everyone wearing a <em>blue</em> shirt, step forward!" (Specific)</p>
</li>
<li><p><strong>ID Selector:</strong> Calling out, "Hey, John Doe! Step forward!" (Unique)</p>
</li>
</ul>
<hr />
<h2 id="heading-1-the-element-selector">1. The Element Selector</h2>
<p>The simplest way to target something is by its HTML tag name. If you want every paragraph on your site to have a font size of 18px, you use the element selector.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">18px</span>;
}
</code></pre>
<p><strong>What it does:</strong> It finds every <code>&lt;p&gt;</code> tag on your page and applies the style. It’s great for setting "global" styles, like the default font for your whole site.</p>
<hr />
<h2 id="heading-2-the-class-selector">2. The Class Selector</h2>
<p>Usually, you don’t want <em>every</em> paragraph to look the same. You might want some paragraphs to look like standard text and others to look like "Alert" messages. This is where <strong>Classes</strong> come in.</p>
<p>In your HTML, you add a class attribute: <code>&lt;p class="alert-text"&gt;Be careful!&lt;/p&gt;</code>. In CSS, you target that class by starting with a <strong>dot (</strong><code>.</code>).</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.alert-text</span> {
  <span class="hljs-attribute">color</span>: red;
  <span class="hljs-attribute">font-weight</span>: bold;
}
</code></pre>
<p><strong>Why use it:</strong> Classes are reusable. You can give ten different elements the class <code>.alert-text</code>, and they will all turn red and bold.</p>
<hr />
<h2 id="heading-3-the-id-selector">3. The ID Selector</h2>
<p>Sometimes, an element is truly unique—like your navigation bar or your main "Hero" section. For these, we use an <strong>ID</strong>. In HTML, you use <code>id="main-header"</code>. In CSS, you target an ID by starting with a <strong>hashtag (</strong><code>#</code>).</p>
<pre><code class="lang-css"><span class="hljs-selector-id">#main-header</span> {
  <span class="hljs-attribute">background-color</span>: navy;
}
</code></pre>
<p><strong>The Rule:</strong> Unlike classes, an ID should only be used <strong>once</strong> per page. It’s like a Social Security number for an HTML element.</p>
<hr />
<h2 id="heading-4-grouping-selectors">4. Grouping Selectors</h2>
<p>What if you want your <code>h1</code>, <code>h2</code>, and <code>p</code> tags to all use the same font family? You <em>could</em> write three separate rules, but that's a lot of typing. Instead, you can group them using a <strong>comma</strong>.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">h1</span>, <span class="hljs-selector-tag">h2</span>, <span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">font-family</span>: Arial, sans-serif;
}
</code></pre>
<p>This tells the browser: "Apply this font to the h1, AND the h2, AND the p."</p>
<hr />
<h2 id="heading-5-descendant-selectors">5. Descendant selectors</h2>
<p>Sometimes you only want to style an element if it’s inside another specific element. For example, you might want links inside your <code>footer</code> to be gray, but links in your <code>main</code> content to be blue.</p>
<p>To do this, you list the "parent" selector followed by a space, then the "child" selector.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">footer</span> <span class="hljs-selector-tag">a</span> {
  <span class="hljs-attribute">color</span>: gray;
}
</code></pre>
<p><strong>Translation:</strong> "Find all <code>&lt;a&gt;</code> tags that are <em>descendants</em> of a <code>&lt;footer&gt;</code> tag and make them gray."</p>
<hr />
<h2 id="heading-6-who-wins-selector-priority">6. Who Wins? (selector priority)</h2>
<p>What happens if you have an element selector that says text should be black, but a class selector that says it should be red?</p>
<p>This is called <strong>Specificity</strong>. Think of it as a hierarchy of "who is the most specific."</p>
<ol>
<li><p><strong>ID (#)</strong> is the strongest (it’s a specific name).</p>
</li>
<li><p><strong>Class (.)</strong> is middle-tier (it’s a specific group).</p>
</li>
<li><p><strong>Element</strong> is the weakest (it’s just a general category).</p>
</li>
</ol>
<p>If you target the same paragraph with all three, the <strong>ID style</strong> will be the one that actually shows up on the screen.</p>
<hr />
<h2 id="heading-summary">Summary</h2>
<p>Mastering CSS isn't just about knowing how to change colors; it's about knowing how to point at the right thing.</p>
<ul>
<li><p>Use <strong>Element</strong> selectors for general base styles.</p>
</li>
<li><p>Use <strong>Classes</strong> for reusable styles (the most common method!).</p>
</li>
<li><p>Use <strong>IDs</strong> for unique, one-off sections.</p>
</li>
<li><p>Use <strong>Descendants</strong> to keep your styles organized within sections.</p>
</li>
</ul>
<p>By combining these, you can take a messy HTML file and turn it into a precisely styled, professional-looking website.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding HTML tags and elements]]></title><description><![CDATA[Building a website can feel like trying to solve a giant puzzle where the pieces are written in a foreign language. But once you peel back the layers of fancy graphics and animations, you find a remarkably simple foundation: HTML.
If a website were a...]]></description><link>https://blog.somnathsahu.dev/understanding-html-tags-and-elements</link><guid isPermaLink="true">https://blog.somnathsahu.dev/understanding-html-tags-and-elements</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[HTML5]]></category><category><![CDATA[HTML]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Wed, 28 Jan 2026 04:08:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769573279633/d67aa685-11bd-4c54-90f4-ee16e6ede840.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Building a website can feel like trying to solve a giant puzzle where the pieces are written in a foreign language. But once you peel back the layers of fancy graphics and animations, you find a remarkably simple foundation: <strong>HTML</strong>.</p>
<p>If a website were a house, HTML (HyperText Markup Language) would be the wooden studs, the bricks, and the foundation. It doesn’t decide what color the walls are (that’s CSS) or how the smart-locks work (that’s JavaScript). Instead, it tells the browser exactly what the content <em>is</em>. It says, "This is a heading," "This is a paragraph," or "This is a button."</p>
<p>To master the web, you have to understand the language of these building blocks: <strong>Tags and Elements</strong>.</p>
<h2 id="heading-what-exactly-is-an-html-tag">What exactly is an HTML tag?</h2>
<p>Think of an HTML tag as a set of instructions for the browser. On their own, browsers are actually pretty literal. If you send a browser a plain text file, it will just show a wall of text. It has no idea that the first line is supposed to be a title or that the third sentence should be a link.</p>
<p><strong>Tags</strong> are the labels we wrap around our text to give it meaning. They almost always come in pairs, acting like a set of invisible bookends.</p>
<h3 id="heading-the-anatomy-of-a-tag">The Anatomy of a Tag</h3>
<p>Most tags consist of three parts:</p>
<ol>
<li><p><strong>The Opening Tag:</strong> This tells the browser, "Hey, I'm starting a specific type of content here." It looks like this: <code>&lt;p&gt;</code>. The angle brackets <code>&lt; &gt;</code> are the signature of HTML.</p>
</li>
<li><p><strong>The Content:</strong> This is the actual stuff you want people to see, like "Hello, world!"</p>
</li>
<li><p><strong>The Closing Tag:</strong> This tells the browser, "Okay, that's the end of this specific section." It looks just like the opening tag but adds a forward slash: <code>&lt;/p&gt;</code>.</p>
</li>
</ol>
<h2 id="heading-tag-vs-element-whats-the-difference">Tag vs. Element: what’s the difference?</h2>
<p>In casual conversation, people often use the words "tag" and "element" interchangeably. However, if you want to speak like a pro, there is a subtle but important distinction.</p>
<ul>
<li><p><strong>The Tag</strong> is just the individual piece of code (like <code>&lt;p&gt;</code> or <code>&lt;/p&gt;</code>).</p>
</li>
<li><p><strong>The Element</strong> is the whole package. It’s the opening tag, the content inside, and the closing tag all combined.</p>
</li>
</ul>
<p>Think of it like a sandwich. The bread slices are the tags, the meat is the content, and the <strong>entire sandwich</strong> is the element. If you take away the bread, you just have a mess on your hands. If you take away the meat, you just have two pieces of bread. You need the whole "element" for it to be a satisfying meal for the browser.</p>
<h2 id="heading-self-closing-void-elements">Self-Closing (Void) elements</h2>
<p>In every language, there are exceptions to the rules. In HTML, some elements don't need a "sandwich" structure because they don't contain any text or other elements. These are called <strong>Self-closing</strong> or <strong>Void elements</strong>.</p>
<p>A classic example is an image. You don't put text "inside" an image; you just tell the browser where the image file is located. Another common one is the <code>&lt;br&gt;</code> tag, which simply creates a line break (like hitting "Enter" on your keyboard).</p>
<p>Because there’s no content to "wrap," these tags don't need a closing tag. They just stand alone: <code>&lt;img src="dog.jpg"&gt;</code> or <code>&lt;br&gt;</code>. It’s efficient and keeps your code from getting cluttered with unnecessary tags.</p>
<h2 id="heading-block-vs-inline-how-elements-behave">Block vs. Inline : how elements behave</h2>
<p>This is where beginners often get tripped up. Not all HTML elements take up the same amount of space on the screen. Depending on how they are categorized, they either like to share their "row" or they want the whole row to themselves.</p>
<h3 id="heading-1-block-level-elements">1. Block-Level Elements</h3>
<p>Block-level elements are the "space hogs" of the web. Whenever you use a block-level element, it automatically starts on a new line and stretches to the full width of the page. It creates a "block" of space.</p>
<ul>
<li><p><strong>Common examples:</strong> <code>&lt;div&gt;</code>, <code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code>, <code>&lt;p&gt;</code>, <code>&lt;ul&gt;</code>, and <code>&lt;li&gt;</code>.</p>
</li>
<li><p><strong>Analogy:</strong> Think of these like bricks in a wall. Each brick sits on its own level or takes up a specific chunk of vertical space.</p>
</li>
</ul>
<h3 id="heading-2-inline-elements">2. Inline Elements</h3>
<p>Inline elements are the "socialites." They only take up as much width as necessary and are perfectly happy sitting right next to other elements in the same line.</p>
<ul>
<li><p><strong>Common examples:</strong> <code>&lt;span&gt;</code>, <code>&lt;a&gt;</code> (links), and <code>&lt;strong&gt;</code> (bold text).</p>
</li>
<li><p><strong>Analogy:</strong> Think of these like words in a sentence. You can have a <strong>bold</strong> word in the middle of a paragraph without that word jumping to a new line.</p>
</li>
</ul>
<p>Understanding this distinction is the secret to moving from "my website looks like a mess" to "I know exactly why that button is jumping to the next line."</p>
<h2 id="heading-must-know-tags">"Must-Know" tags</h2>
<p>You don't need to memorize the hundreds of available HTML tags to build a great site. About 80% of the web is built using a small handful of workhorse tags:</p>
<ul>
<li><p><strong>Headings (</strong><code>&lt;h1&gt;</code> to <code>&lt;h6&gt;</code>): These define the hierarchy of your page. <code>&lt;h1&gt;</code> is your main title, while <code>&lt;h3&gt;</code> might be a sub-header.</p>
</li>
<li><p><strong>Paragraphs (</strong><code>&lt;p&gt;</code>): The standard tag for any chunk of text.</p>
</li>
<li><p><strong>Links (</strong><code>&lt;a&gt;</code>): Short for "anchor," this is what makes the web a <em>web</em>. It connects one page to another.</p>
</li>
<li><p><strong>Divisions (</strong><code>&lt;div&gt;</code>): This is a generic container. It doesn’t <em>do</em> anything to the text, but it’s used to group other elements together so you can style them later with CSS. It’s like a cardboard box for your code.</p>
</li>
<li><p><strong>Spans (</strong><code>&lt;span&gt;</code>): Similar to a div, but it’s inline. You use it to target a small piece of text inside a larger paragraph.</p>
</li>
</ul>
<h2 id="heading-inspect-element-dev-tools">Inspect element : dev tools</h2>
<p>One of the best ways to learn HTML isn't by reading a book—it's by "spying" on your favorite websites.</p>
<p>If you’re using a browser like Chrome or Firefox, right-click anywhere on a webpage and select <strong>"Inspect."</strong> A window will pop up showing you the exact HTML elements used to build that page. You can see how developers used <code>&lt;div&gt;</code> tags to create layouts and <code>&lt;a&gt;</code> tags for navigation. It turns the entire internet into your personal classroom.</p>
<hr />
<h2 id="heading-summary">Summary</h2>
<p>HTML tags and elements might seem intimidating at first, but they are just the labels that give the digital world structure.</p>
<ul>
<li><p><strong>Tags</strong> are the instructions (<code>&lt;p&gt;</code>).</p>
</li>
<li><p><strong>Elements</strong> are the complete units (<code>&lt;p&gt;Hello&lt;/p&gt;</code>).</p>
</li>
<li><p><strong>Block elements</strong> take up a whole line; <strong>inline elements</strong> sit side-by-side.</p>
</li>
</ul>
<p>Once you understand these basic rules, you aren't just a "user" of the internet anymore—you're a creator. Every complex website you’ve ever visited, from Facebook to Amazon, is just a giant collection of these simple building blocks stacked on top of each other.</p>
]]></content:encoded></item><item><title><![CDATA[TCP working: 3-way handshake & reliable communication]]></title><description><![CDATA[The internet is essentially that noisy room. Millions of devices are shouting data at once, and cables can get overloaded, causing pieces of information to just... vanish. If we sent data without rules, our emails would arrive scrambled, and our soft...]]></description><link>https://blog.somnathsahu.dev/tcp-working-3-way-handshake</link><guid isPermaLink="true">https://blog.somnathsahu.dev/tcp-working-3-way-handshake</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[TCP]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Tue, 27 Jan 2026 08:16:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769436396448/1dc4f85c-90e4-4221-8d49-b0a4e88a3912.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The internet is essentially that noisy room. Millions of devices are shouting data at once, and cables can get overloaded, causing pieces of information to just... vanish. If we sent data without rules, our emails would arrive scrambled, and our software updates would be missing vital pieces of code, rendering them useless.</p>
<p>This is why we have <strong>TCP (Transmission Control Protocol)</strong>. It is the "polite conversation" protocol that ensures every single bit of data arrives exactly as intended.</p>
<h2 id="heading-the-problems-tcp-solves">The Problems TCP Solves</h2>
<p>Before we look at how it works, we have to understand the chaos it prevents. When data travels across the web, it is broken into small "packets." Without TCP, three big things go wrong:</p>
<ol>
<li><p><strong>Packet Loss:</strong> A packet gets dropped by a router and never arrives.</p>
</li>
<li><p><strong>Out-of-Order Delivery:</strong> Packet #3 arrives before Packet #1 because it took a different physical path.</p>
</li>
<li><p><strong>Corruption:</strong> A packet arrives, but its data was mangled during the journey.</p>
</li>
</ol>
<p>TCP is designed to be the "quality control manager" that fixes all of these issues.</p>
<h2 id="heading-the-secret-sauce-the-3-way-handshake">The Secret Sauce: The 3-Way Handshake</h2>
<p>Before TCP sends a single byte of actual data (like your profile picture or a chat message), it needs to make sure the other side is ready, willing, and able to talk. It does this through a process called the <strong>3-Way Handshake</strong>.</p>
<p>Imagine two people, Alice and Bob, trying to start a phone call.</p>
<h3 id="heading-step-1-syn-synchronize">Step 1: SYN (Synchronize)</h3>
<p>Alice sends a message: <em>"Hey Bob, I want to talk. My starting sequence number is 1000."</em> In technical terms, the client sends a <strong>SYN</strong> packet. This packet contains a random "Sequence Number" that will be used to keep the data in order later.</p>
<h3 id="heading-step-2-syn-ack-synchronize-acknowledge">Step 2: SYN-ACK (Synchronize-Acknowledge)</h3>
<p>Bob hears Alice and responds: <em>"I hear you, Alice! I’m ready too. I received your 1000, so I’m looking for 1001 next. Also, my starting sequence number is 5000."</em> The server sends a <strong>SYN-ACK</strong>. It acknowledges Alice’s request and sends its own sequence number.</p>
<h3 id="heading-step-3-ack-acknowledge">Step 3: ACK (Acknowledge)</h3>
<p>Alice finishes the handshake: <em>"Got it, Bob! I’m looking for your 5001 next. Let’s start!"</em> Alice sends an <strong>ACK</strong> packet back. The "connection" is now officially established.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769436169385/1ca1196b-33dc-4622-94cd-0514df607199.png" alt="TCP protocol works" class="image--center mx-auto" /></p>
<h2 id="heading-how-data-actually-moves">How Data Actually Moves</h2>
<p>Once the handshake is done, the data transfer begins. But TCP doesn't just "send and forget." It uses a system of <strong>Sequence Numbers</strong> and <strong>Acknowledgements</strong>.</p>
<p>Think of it like a teacher handing out numbered worksheets to a student. The teacher gives the student Page 1, Page 2, and Page 3. The student then shouts back, "I have up to Page 3!"</p>
<p>If the teacher sends Page 4, but the student never acknowledges receiving it, the teacher assumes it was lost and sends Page 4 again. This is called <strong>Retransmission</strong>.</p>
<h3 id="heading-reliability-order-and-correctness">Reliability, Order, and Correctness</h3>
<ul>
<li><p><strong>Reliability:</strong> If the sender doesn't get an "ACK" for a specific packet within a certain timeframe, it sends that packet again.</p>
</li>
<li><p><strong>Order:</strong> If packets arrive in the order 1, 3, 2, TCP looks at the sequence numbers and puts them back in the correct order (1, 2, 3) before showing them to the user.</p>
</li>
<li><p><strong>Correctness:</strong> Every TCP packet has a "checksum"—a digital fingerprint. If the fingerprint doesn't match the data, TCP rejects it as corrupted and asks for a fresh copy.</p>
</li>
</ul>
<h2 id="heading-saying-goodbye-closing-the-connection">Saying Goodbye: Closing the Connection</h2>
<p>A TCP connection isn't just "cut off" when the data is done; it is politely closed. This is often called a "Four-Way Teardown" because both sides have to agree to stop.</p>
<ol>
<li><p><strong>FIN:</strong> The client sends a message saying, <em>"I'm done sending data."</em></p>
</li>
<li><p><strong>ACK:</strong> The server says, <em>"I hear you, I'll stop expecting data from you."</em> (The server can still send data for a moment if it needs to finish something up).</p>
</li>
<li><p><strong>FIN:</strong> The server then sends its own message: <em>"I'm done too."</em></p>
</li>
<li><p><strong>ACK:</strong> The client sends a final acknowledgement: <em>"Understood. Goodbye!"</em></p>
</li>
</ol>
<h2 id="heading-summary">Summary</h2>
<p>TCP is the reason the modern internet feels so stable. It takes a chaotic, unreliable network and turns it into a virtual "circuit" where data is guaranteed to be perfect. While the overhead of handshakes and acknowledgements makes it slightly slower than UDP, that is a small price to pay for knowing your data will arrive in one piece.</p>
]]></content:encoded></item><item><title><![CDATA[How a browser works: a beginner-friendly guide to browser internals]]></title><description><![CDATA[Have you ever wondered what happens in that split second after you type google.com and hit Enter? To most of us, the browser feels like a magic window. You type a name, and a world of images, text, and buttons instantly appears.
But under the hood, y...]]></description><link>https://blog.somnathsahu.dev/how-a-browser-works</link><guid isPermaLink="true">https://blog.somnathsahu.dev/how-a-browser-works</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Browsers]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Tue, 27 Jan 2026 04:17:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769487401113/e3c81425-834d-4259-9825-20bb32619be3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Have you ever wondered what happens in that split second after you type <code>google.com</code> and hit Enter? To most of us, the browser feels like a magic window. You type a name, and a world of images, text, and buttons instantly appears.</p>
<p>But under the hood, your browser is less like a window and more like a high-speed assembly line. It is one of the most sophisticated pieces of software on your computer, acting as a translator that turns raw code into something humans can actually understand.</p>
<h2 id="heading-what-is-a-browser">What is a Browser</h2>
<p>At its core, a browser is a <strong>resource fetcher and a renderer</strong>. Its job is to go out onto the internet, find the files that make up a website (HTML, CSS, and JavaScript), and "paint" them onto your screen.</p>
<p>While we often think of the browser as just the window where the website lives, it’s actually a collection of specialized parts working in harmony.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769487323214/67d2eeef-7c45-48fa-a74e-3c9e3848cdea.png" alt="How browser works" class="image--center mx-auto" /></p>
<h3 id="heading-the-main-components">The Main Components</h3>
<ol>
<li><p><strong>The User Interface (UI):</strong> This is everything you see that <em>isn't</em> the website itself—the address bar, the back button, the bookmarks menu, and the tabs.</p>
</li>
<li><p><strong>The Browser Engine:</strong> Think of this as the "manager." It coordinates actions between the UI and the Rendering Engine.</p>
</li>
<li><p><strong>The Rendering Engine:</strong> This is the heart of the browser. It’s responsible for displaying the content. If you use Chrome, this is <strong>Blink</strong>; if you use Safari, it's <strong>WebKit</strong>; and for Firefox, it's <strong>Gecko</strong>.</p>
</li>
</ol>
<h2 id="heading-step-1-networking-the-fetch">Step 1: Networking (The Fetch)</h2>
<p>Before the browser can show you anything, it needs the data. The <strong>Networking</strong> component handles this. It uses the rules we discussed previously (TCP/IP and HTTP) to talk to a server and ask for the files. It starts by grabbing the <strong>HTML</strong> file, which is the blueprint of the page.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769487371635/e832b072-03c6-423f-ba9f-58df57c2ba9d.png" alt="How browser works overall" class="image--center mx-auto" /></p>
<h2 id="heading-step-2-parsing">Step 2: Parsing</h2>
<p>Once the browser has the HTML, it has to "parse" it. <strong>Parsing</strong> is just a fancy word for breaking something down into a structure the computer understands.</p>
<p>Imagine I give you the sentence: <em>"The cat sat on the mat."</em> To understand it, your brain "parses" it into a Subject (The cat), a Verb (sat), and a Location (on the mat).</p>
<p>Browsers do the same with code. If it sees <code>1 + 2 * 3</code>, it doesn't just read left-to-right; it parses it into a tree: it knows it must multiply <code>2 * 3</code> first, then add <code>1</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769437130123/3a78d591-6be3-460d-8c2e-c2bb7c0a50a0.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-building-the-dom-tree">Building the DOM Tree</h3>
<p>As the browser reads your HTML, it builds the <strong>DOM (Document Object Model)</strong>. Think of the DOM as a family tree for your website. The <code>&lt;html&gt;</code> tag is the grandparent, the <code>&lt;body&gt;</code> is the parent, and <code>&lt;h1&gt;</code> or <code>&lt;p&gt;</code> tags are the children.</p>
<h2 id="heading-step-3-handling-the-style-cssom">Step 3: Handling the Style (CSSOM)</h2>
<p>While the HTML tree is being built, the browser encounters CSS files. It doesn't just slap the styles onto the HTML. Instead, it creates a second tree called the <strong>CSSOM (CSS Object Model)</strong>.</p>
<p>If the DOM is the "skeleton" of the site, the CSSOM is the "style guide" that tells the browser which bones should be blue, which should be hidden, and which should be 20 pixels wide.</p>
<h2 id="heading-step-4-the-render-tree-the-blueprint">Step 4: The Render Tree (The Blueprint)</h2>
<p>Now, the browser combines the DOM and the CSSOM into the <strong>Render Tree</strong>.</p>
<p>This is a critical step because the Render Tree only contains things that will actually be visible on the screen. If a piece of code says <code>display: none</code>, it exists in the DOM, but the Render Tree ignores it. It’s the final blueprint used to build the visual page.</p>
<h2 id="heading-step-5-layout-and-painting-the-finale">Step 5: Layout and Painting (The Finale)</h2>
<p>We have a blueprint, but we don't have pixels yet. The browser finishes with two final, heavy-lifting stages:</p>
<ol>
<li><p><strong>Layout (or Reflow):</strong> The browser calculates exactly where every element goes. It figures out that the "Submit" button should be 50 pixels from the top and 20 pixels wide. It’s like a construction crew marking the ground with chalk before they start building.</p>
</li>
<li><p><strong>Painting:</strong> Finally, the browser fills in the pixels. It draws the text, colors the buttons, and places the images. This happens incredibly fast, often in milliseconds.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769437210982/c2437ef8-7a7d-4df1-8a2b-f7f1fa363505.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-summary-from-url-to-pixels">Summary: From URL to Pixels</h2>
<p>The journey from typing a URL to seeing a webpage is an incredible relay race:</p>
<ul>
<li><p><strong>Networking</strong> grabs the files.</p>
</li>
<li><p><strong>Parsing</strong> turns HTML into the <strong>DOM</strong> (the skeleton).</p>
</li>
<li><p><strong>Parsing</strong> turns CSS into the <strong>CSSOM</strong> (the style).</p>
</li>
<li><p>The <strong>Render Tree</strong> combines them.</p>
</li>
<li><p><strong>Layout</strong> finds the coordinates.</p>
</li>
<li><p><strong>Painting</strong> puts the color on your screen.</p>
</li>
</ul>
<p>It’s a lot to take in, but remember: you don't need to memorize every gear in the machine to appreciate the engine. The browser is simply a master translator, turning code into the digital world we live in.</p>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: when to use what, and how TCP relates to HTTP]]></title><description><![CDATA[Imagine the internet as a massive, bustling postal system. Billions of messages fly across the globe every second, but without a set of shared rules, those messages would simply be a chaotic soup of digital noise. To make sense of it all, we use prot...]]></description><link>https://blog.somnathsahu.dev/tcp-vs-udp-when-to-use-what</link><guid isPermaLink="true">https://blog.somnathsahu.dev/tcp-vs-udp-when-to-use-what</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[networking]]></category><category><![CDATA[protocols]]></category><category><![CDATA[TCP]]></category><category><![CDATA[UDP]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Mon, 26 Jan 2026 13:22:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769433706596/66e31eac-1882-4a07-a8b3-964b67fa886d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine the internet as a massive, bustling postal system. Billions of messages fly across the globe every second, but without a set of shared rules, those messages would simply be a chaotic soup of digital noise. To make sense of it all, we use <strong>protocols</strong>—standardized sets of rules that determine how data moves from point A to point B.</p>
<p>Two of the most important rulesets at the heart of the internet are <strong>TCP</strong> and <strong>UDP</strong>. While they both live in the "Transport Layer" of networking, they behave like two very different types of delivery services.</p>
<hr />
<h2 id="heading-tcp-the-reliable-courier">TCP: the reliable courier</h2>
<p><strong>TCP (Transmission Control Protocol)</strong> is the internet’s gold standard for reliability. Think of it like a high-end courier service that requires a signature for every package.</p>
<p>When you use TCP, the sender and receiver perform a "three-way handshake" to establish a connection before any data even moves. Once the data starts flowing, TCP tracks every single packet. If a piece of data goes missing or arrives out of order, TCP stops everything and asks for it to be resent. It ensures that what you send is exactly what the other person receives—no exceptions.</p>
<p>It works via <strong>sync → sync ack → ack</strong> segment</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769433680161/2ee3fa3c-7797-4d9b-84bc-cf9be31ebe73.png" alt="TCP How it worked" class="image--center mx-auto" /></p>
<h2 id="heading-udp-the-live-broadcaster">UDP: the live broadcaster</h2>
<p><strong>UDP (User Datagram Protocol)</strong>, on the other hand, is built for speed. If TCP is a formal courier, UDP is like a live megaphone announcement. It doesn’t care if you missed the first three words of the sentence; it’s going to keep talking anyway.</p>
<p>UDP is "connectionless." It just starts throwing data at the destination without checking if the receiver is ready or if the data actually arrived. There is no error correction and no re-sending. It’s fast, lightweight, and efficient, but it’s "risky" because data can easily be lost in transit.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769433647802/428fc981-daee-4ca4-a61f-e422fe0d405c.png" alt="UDP Protocol- how it worked" class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-key-differences-at-a-glance">Key Differences at a Glance</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Feature</strong></td><td><strong>TCP</strong></td><td><strong>UDP</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Reliability</strong></td><td>Guaranteed delivery</td><td>No guarantee (Best effort)</td></tr>
<tr>
<td><strong>Speed</strong></td><td>Slower (due to overhead)</td><td>Faster (no handshakes)</td></tr>
<tr>
<td><strong>Order</strong></td><td>Data arrives in sequence</td><td>Data can arrive out of order</td></tr>
<tr>
<td><strong>Method</strong></td><td>Connection-oriented</td><td>Connectionless</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-when-to-use-what">When to Use What?</h2>
<h3 id="heading-choose-tcp-when-accuracy-is-non-negotiable">Choose TCP when accuracy is non-negotiable</h3>
<p>If losing a single "packet" of data would break the entire result, you need TCP.</p>
<ul>
<li><p><strong>Web Browsing:</strong> You wouldn't want a website to load with missing text or broken code.</p>
</li>
<li><p><strong>Email:</strong> An email missing the middle paragraph is useless.</p>
</li>
<li><p><strong>File Downloads:</strong> A corrupted .zip file won't open.</p>
</li>
</ul>
<h3 id="heading-choose-udp-when-speed-is-the-priority">Choose UDP when speed is the priority</h3>
<p>In "real-time" scenarios, a slight delay (latency) is much worse than a tiny bit of missing data.</p>
<ul>
<li><p><strong>Online Gaming:</strong> If you’re playing a fast-paced shooter, you need the most current data <em>now</em>. If a packet is lost, the game just moves on to the next one rather than pausing to find the old one.</p>
</li>
<li><p><strong>Video Streaming/VoIP:</strong> During a Zoom call, if the connection glitters for a millisecond, you might see a few stray pixels, but the video keeps playing. If Zoom used TCP, the video would freeze constantly to "catch up" on lost frames.</p>
</li>
</ul>
<hr />
<h2 id="heading-where-does-http-fit-in">Where Does HTTP Fit In?</h2>
<p>A common point of confusion for beginners is how <strong>HTTP</strong> (Hypertext Transfer Protocol) relates to these two. You might wonder: <em>"If I'm using HTTP to browse the web, am I still using TCP?"</em></p>
<p>The answer is <strong>yes</strong>.</p>
<p>To understand this, we use the <strong>OSI Model</strong>, which layers protocols on top of each other.</p>
<ul>
<li><p><strong>TCP</strong> is a <strong>Transport Layer</strong> protocol. It handles the "how" of moving data (the pipes).</p>
</li>
<li><p><strong>HTTP</strong> is an <strong>Application Layer</strong> protocol. It handles the "what" of the data (the actual website content).</p>
</li>
</ul>
<h3 id="heading-the-relationship-http-runs-on-tcp">The Relationship: HTTP Runs on TCP</h3>
<p>Think of it this way: <strong>TCP is the train tracks, and HTTP is the train.</strong> The tracks provide the path and the safety mechanisms to ensure the train doesn't derail. The train carries the actual passengers (the HTML, images, and data of a website).</p>
<p>Because websites need to be 100% accurate to function, HTTP almost always uses TCP. When you type a URL into your browser, your computer first opens a TCP connection to the server. Once that "pipe" is secure and open, the HTTP requests and responses travel through it.</p>
<h2 id="heading-why-http-doesnt-replace-tcp">Why HTTP Doesn't Replace TCP</h2>
<p>HTTP cannot replace TCP because they do completely different jobs. HTTP doesn't know how to "resend a lost packet" or "reorder data"—it relies on TCP to handle those messy networking details.</p>
<p>In recent years, a new version called <strong>HTTP/3</strong> has actually started using a protocol called <strong>QUIC</strong>, which is built on top of <strong>UDP</strong>. However, QUIC adds its own reliability features to UDP to make it act more like TCP but faster. Even then, the concept remains: the application (HTTP) needs a transport layer (TCP/UDP) to move its data across the web.</p>
<hr />
<h2 id="heading-summary">Summary</h2>
<p>The internet is a balance between <strong>reliability</strong> and <strong>velocity</strong>. TCP provides the sturdy foundation for our files, emails, and web pages, while UDP provides the raw speed needed for our calls and games. HTTP sits gracefully on top, focusing on delivering the content we love while trusting the layers below to handle the heavy lifting.</p>
]]></content:encoded></item><item><title><![CDATA[DNS resolution : how it works as a resolver and serve the web page]]></title><description><![CDATA[DNS or Domain name system works as a phonebook. So whenever any user type the name google.com in the browser, it automatically lookup the associated IP and display the required content from that server. This entire lookup system is moreover known as ...]]></description><link>https://blog.somnathsahu.dev/dns-resolution</link><guid isPermaLink="true">https://blog.somnathsahu.dev/dns-resolution</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[internet]]></category><category><![CDATA[dns resolver]]></category><category><![CDATA[dns]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Mon, 26 Jan 2026 11:27:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769426768193/8792b500-2b3c-4239-b704-b468b0f4d9c7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>DNS or Domain name system works as a phonebook. So whenever any user type the name <a target="_blank" href="http://google.com"><code>google.com</code></a> in the browser, it automatically lookup the associated IP and display the required content from that server. This entire <em>lookup system</em> is moreover known as a <strong>Domain Name System</strong> aka DNS.</p>
<h2 id="heading-how-dns-works"><strong>How DNS works?</strong></h2>
<p>DNS works like a telephone directory, where it stores all the associated IP with the human readable domain name. So whenever you have entered any domain name or my personal website in the browser like <a target="_blank" href="http://somnathsahu.dev"><code>somnathsahu.dev</code></a> it goes to the DNS resolver which is your ISP.</p>
<p>Now this resolver looks for the name server for the IP and this root server directs it to the Top-Level Domain (TLD) server (e.g., for <code>.dev</code>).</p>
<p>The resolver asks the TLD server, which points it to the Authoritative Nameserver for <a target="_blank" href="http://somnathsahu.dev"><code>somnathsahu.dev</code></a>. The Authoritative Nameserver holds the actual IP address and sends it back to the resolver. And the resolver sends the IP address to your browser.</p>
<p>Now your browser uses the IP address to connect to the website's server and display the website content.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768763413032/e5723d3b-9078-4a8e-9f11-1683c4de7189.png" alt /></p>
<h2 id="heading-dig-command-and-dns-resolution"><code>DIG</code> Command and DNS resolution</h2>
<p>DIG command is a powerful administrative tool that helps to query DNS name servers for troubleshooting, diagnostic, and educational purposes. It is available by default on Linux and macOS, often used to look up A, MX, or CNAME records directly from specific DNS servers.</p>
<p>Basic syntax of DIG command is</p>
<p><code>dig [server] [name] [type]</code></p>
<ol>
<li><p><code>[server]</code> it is an optional parameter for IP address or hostname of the DNS server to query.</p>
</li>
<li><p><code>[name]</code> it helps to query a domain name. This is the DNS resource record about which you want information.</p>
</li>
<li><p><code>[type]</code> it is an optional parameter. DNS record type to query, including A, MX, and NS. dig will query an A record if no type is specified by default.</p>
</li>
</ol>
<p>For example, to execute an A record for below example</p>
<p><code>dig example.com</code> it will return below response</p>
<pre><code class="lang-bash">; &lt;&lt;&gt;&gt; DiG 9.16.1-Ubuntu &lt;&lt;&gt;&gt; example.com
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 12345
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;example.com.   IN  A
;; ANSWER SECTION:
example.com.  3600  IN  A 93.184.216.34
;; AUTHORITY SECTION:
example.com.  3600  IN  NS ns1.example.com.
example.com.  3600  IN  NS ns2.example.com.
;; ADDITIONAL SECTION:
ns1.example.com.  3600  IN  A 192.0.2.1
;; Query time: 10 msec
;; SERVER: 192.0.2.53<span class="hljs-comment">#53(192.0.2.53)</span>
;; WHEN: Sun Jan 25 14:00:00 UTC 2026
;; MSG SIZE  rcvd: 123
</code></pre>
<h2 id="heading-some-important-dig-command">Some important <code>DIG</code> command</h2>
<h3 id="heading-mx-record"><strong>MX record</strong></h3>
<p>MX record returns mail exchange server details to send/receive emails. To troubleshoot this email records execute below command</p>
<p><code>dig example.com MX</code></p>
<pre><code class="lang-bash">...
;; QUESTION SECTION:
;example.com.  IN  MX
;; ANSWER SECTION:
example.com.  3600  IN  MX 10 mail.example.com.
;; ADDITIONAL SECTION:
mail.example.com.  3600  IN  A 192.0.2.2
...
</code></pre>
<h3 id="heading-ns-record"><strong>NS record</strong></h3>
<p>The name server (NS) record lists the name servers responsible for the domain. It helps to understand the domain’s DNS infrastructure.</p>
<p><code>dig example.com NS</code></p>
<pre><code class="lang-bash">...
;; QUESTION SECTION:
;example.com.  IN  NS
;; ANSWER SECTION:
example.com.  3600  IN  NS ns1.example.com.
example.com.  3600  3600  IN  NS ns2.example.com.
;; ADDITIONAL SECTION:
ns1.example.com.  3600  IN  A 192.0.2.1
...
</code></pre>
<h3 id="heading-soa-record"><strong>SOA record</strong></h3>
<p>The start of authority (SOA) record contains administrative information about the domain, including the primary name server and the domain administrator’s registered email.</p>
<p><code>dig example.com SOA</code></p>
<pre><code class="lang-bash">...
;; QUESTION SECTION:
;example.com.  IN  SOA
;; ANSWER SECTION:
example.com.  3600  IN  SOA ns1.example.com. hostmaster.example.com. 2021071601 3600 1800 1209600 300
...
</code></pre>
<h3 id="heading-tracing-the-dns-path"><strong>Tracing the DNS path</strong></h3>
<p>Tracing the DNS path involves following a DNS query from your computer to the authoritative name server. This process lets you see the route queries take to the final DNS server.</p>
<p>To trace the DNS path, append the <strong>+trace</strong> option to your command like this:</p>
<p><code>dig example.com +trace</code></p>
<p>The <strong>dig</strong> output shows the DNS servers involved at each step:</p>
<pre><code class="lang-bash">.                       518400  IN      NS      a.root-servers.net.
.                       518400  IN      NS      b.root-servers.net.
;; Received 512 bytes from 192.0.2.1 <span class="hljs-comment">#53(192.0.2.1) in 5 ms</span>
example.com.            3600    IN      NS      ns1.example.com.
example.com.            3600    IN      NS      ns2.example.com.
;; Received 200 bytes from 192.0.2.1<span class="hljs-comment">#53(192.0.2.1) in 10 ms</span>
example.com.            3600    IN      A       93.184.216.34
;; Received 100 bytes from 192.0.2.2<span class="hljs-comment">#53(192.0.2.2) in 15 ms</span>
</code></pre>
<h2 id="heading-final-words">Final words</h2>
<p>In this article, I’ve covered the essential uses of the Linux <strong>dig</strong> command, from fundamental DNS lookups to more advanced queries and troubleshooting methods. In addition, mastering <strong>dig</strong> can enhance your network management skills</p>
]]></content:encoded></item><item><title><![CDATA[cURL - Introduction and how to getting started]]></title><description><![CDATA[cURL is tool to transfer data from or to a server using URLs. cURL is known as a client URL. Without accessing through web, cURL tool allows to communicate with server directly. While transferring any data, it uses these protocols: DICT, FILE, FTP, F...]]></description><link>https://blog.somnathsahu.dev/introduction-of-curl</link><guid isPermaLink="true">https://blog.somnathsahu.dev/introduction-of-curl</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[curl]]></category><category><![CDATA[internet]]></category><category><![CDATA[api]]></category><category><![CDATA[API basics ]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Wed, 21 Jan 2026 07:08:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768979248782/5f1db6ce-6d99-425c-b75c-f3e0e45180a0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>cURL is tool to transfer data from or to a server using URLs. cURL is known as a client URL. Without accessing through web, cURL tool allows to communicate with server directly. While transferring any data, it uses these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.</p>
<h2 id="heading-how-to-start-with-curl">How to start with cURL</h2>
<p>cURL is a command line tool, directly accessible through terminal. In Mac OS/ Linux OS it comes with default but in Windows it will ask for permission first.</p>
<p><mark>Note: For Windows users can install git bash and it will behave and supports some Linux based command</mark></p>
<p>Use this following command to check the <code>curl -v</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768974877981/c75575e9-096f-4324-8351-7384811c68e4.png" alt class="image--center mx-auto" /></p>
<p>Execute following command <code>curl https://google.com</code> first time in Windows will prompt for security risk and you need to accept that</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768974744890/1b9869f7-2155-4e80-9e7b-609f67a734fe.png" alt class="image--center mx-auto" /></p>
<p>Once you have accepted that command you will see all the information regarding that URL.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768974802165/ea085f1a-8d53-4109-85e0-e230d75a2b01.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-how-curl-works">How cURL works:</h2>
<p>cURL is a command line tool, it directly communicated with server and return only text content with certain attributes which are not in a good human readable format. It consists of status code, content, status description, Header, RawContent.</p>
<p>The returning data is completely depending upon the calling URL, if the calling URL is an endpoint of an API, it will return those data whether it contains with JSON or XML without validating the data types.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768979221100/b230ddfb-1aaf-40f4-bb4d-9c23c661c27a.png" alt="How cURL works" class="image--center mx-auto" /></p>
<p>cURL becomes suitable alternative during API validation, it does not require any web interface to communicate, it directly call the server and returns the data.</p>
<p>Learn more about <a target="_blank" href="https://blog.somnathsahu.dev/dns-record-types">DNS Record types- How DNS works</a></p>
<h2 id="heading-curl-protocols">cURL protocols:</h2>
<p>curl supports numerous protocols, or put in URL terms: schemes. Here are the few protocols.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Protocol</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>DICT</td><td>Lets you lookup words using online dictionaries.</td></tr>
<tr>
<td>FILE</td><td>Read or write local files. cURL does not support accessing <a target="_blank"><code>file://</code></a> URL remotely, but when running on Microsoft Windows using the native UNC approach works. Only absolute paths.</td></tr>
<tr>
<td>FTP(S)</td><td>cURL supports the File Transfer Protocol with a lot of tweaks and levers. With or without using TLS.</td></tr>
<tr>
<td>GOPHER(S)</td><td>Retrieve files.</td></tr>
<tr>
<td>HTTP(S)</td><td>cURL supports HTTP with numerous options and variations. It can speak HTTP version 0.9, 1.0, 1.1, 2, and 3 depending on build options and the correct command line options.</td></tr>
<tr>
<td>IMAP(S)</td><td>Using the mail reading protocol, cURL can download emails for you. With or without using TLS.</td></tr>
<tr>
<td>LDAP(S)</td><td>cURL can do directory lookups for you, with or without TLS.</td></tr>
<tr>
<td>MQTT</td><td>cURL supports MQTT version 3. Downloading over MQTT equals subscribing to a topic while uploading/posting equals publishing on a topic. MQTT over TLS is not supported (yet).</td></tr>
<tr>
<td>POP3(S)</td><td>Downloading from a POP3 server means getting an email. With or without using TLS.</td></tr>
<tr>
<td>RTMP(S)</td><td>The Realtime Messaging Protocol is primarily used to serve streaming media and cURL can download it.</td></tr>
<tr>
<td>RTSP</td><td>cURL supports RTSP 1.0 downloads.</td></tr>
<tr>
<td>SCP</td><td>cURL supports SSH version 2 SCP transfers.</td></tr>
<tr>
<td>SFTP</td><td>cURL supports SFTP (draft 5) done over SSH version 2.</td></tr>
<tr>
<td>SMB(S)</td><td>cURL supports SMB version 1 for upload and download.</td></tr>
<tr>
<td>SMTP(S)</td><td>Uploading contents to an SMTP server means sending an email. With or without TLS.</td></tr>
<tr>
<td>TELNET</td><td>Fetching a telnet URL starts an interactive session where it sends what it reads on stdin and outputs what the server sends it.</td></tr>
<tr>
<td>TFTP</td><td>cURL can do TFTP downloads and uploads.</td></tr>
<tr>
<td>WS(S)</td><td>WebSocket done over HTTP/1. WSS implies that it works over HTTPS.</td></tr>
</tbody>
</table>
</div><h2 id="heading-few-curl-uses">Few cURL uses:</h2>
<h3 id="heading-get-request-with-curl">GET Request with cURL:</h3>
<p>This uses default GET request while you curl any URLs like: <code>https://jsonplaceholder.typicode.com/users/</code></p>
<p>Open your terminal and type the following: <code>curl https://jsonplaceholder.typicode.com/users/</code></p>
<p>It will return the users and their properties as the response directly in your terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768975880141/752d6c02-bc7c-4507-b42e-afd023537f30.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-post-request-with-curl"><strong>POST request with cURL</strong></h3>
<p><strong>POST request</strong> is mainly used to add new data or resources to a database by sending information to a server. You can make a POST request using <strong>cURL</strong> like this:</p>
<pre><code class="lang-bash">curl -X POST https://yourapiurl.com \
  -H <span class="hljs-string">"Authorization: Bearer aoiueio2123olsudoas"</span> \
  -H <span class="hljs-string">"Content-Type: application/json"</span> \
  -d <span class="hljs-string">'{
    "name": "your name"
  }'</span>
</code></pre>
<h3 id="heading-explanation"><strong>Explanation</strong></h3>
<ul>
<li><p><code>-X POST</code> → Specifies the HTTP method as <strong>POST</strong></p>
</li>
<li><p><code>-H "Authorization: ..."</code> → Requires authorization token in the request header to authenticate with server</p>
</li>
<li><p><code>-H "Content-Type: application/json"</code> → Tells the server that the request body is JSON</p>
</li>
<li><p><code>-d</code> → Contains the data that will be sent to the server</p>
</li>
</ul>
<p>This request sends JSON data to the API, allowing the server to create a new resource in its database.</p>
<h3 id="heading-final-thoughts"><strong>Final Thoughts</strong></h3>
<p>Now a days there are tools like Postman, SOAP tool to communicate directly with that API using interface, but those UI tools works on the layer of cURL, so cURL is core for those tools, you can execute those command without modern tools as well. Yeah! sometimes during POST method these web tools are required to modify and update request body in the ui itself rather than using a command line.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding network devices - the way internet serves]]></title><description><![CDATA[Internet is very common term in now a days and how internet works that’s more fascinating. Internet is travelling through network devices whether it is a wireless or wired connection. Network devices are the core part of an internet. Lets dive into t...]]></description><link>https://blog.somnathsahu.dev/understanding-network-devices</link><guid isPermaLink="true">https://blog.somnathsahu.dev/understanding-network-devices</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Tue, 20 Jan 2026 07:34:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768892751687/6a5fc807-c99d-4915-b296-673b2d024917.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Internet is very common term in now a days and how internet works that’s more fascinating. Internet is travelling through network devices whether it is a wireless or wired connection. Network devices are the core part of an internet. Lets dive into that network devices and how many are their and how it works.</p>
<p>Network devices are physical devices required for communication between multiple computer on a computer network. Depending upon individual’s functionality those devices are used for generating signals, forwarding, packet transferring, firewall, protocol conversion and access control to ensure secure and reliable connection.</p>
<h2 id="heading-significance-of-network-devices">Significance of network devices:</h2>
<p>Network devices are taking key role to transmitting / receiving internet. There are following significance for the network devices.</p>
<ol>
<li><p>Facilitates data communication and transmission between devices.</p>
</li>
<li><p>Enables secure and efficient packet transaction.</p>
</li>
<li><p>Reduce traffic congestion and managing the traffic.</p>
</li>
<li><p>Routes the traffic to make more fast and efficient.</p>
</li>
<li><p>Provides security by providing access controlling and unauthorized access.</p>
</li>
<li><p>Extend network coverage and solve signal limitations.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768894406411/13fcbc7e-66f3-469e-9b59-078880c6e1d3.png" alt="Common Types of Network Devices" class="image--center mx-auto" /></p>
<h2 id="heading-layer-1-physical-device">Layer 1: Physical device</h2>
<p>This is core layer for any network devices, these devices are raw physical devices deals with electrical/optical signals in bit. It does not understand about MAC address or IP Address more over it deals with electrical signals.</p>
<h3 id="heading-1-hub"><strong>1. Hub</strong></h3>
<ul>
<li><p><strong>Function:</strong> Hub is known for central connection point for devices in a LAN. It is an essential multiport device that connects multiple Ethernet devices into a single broadcast network segment, which makes them a central connection point during traffic congestion.</p>
</li>
<li><p><strong>How it Works:</strong> It takes an incoming signal on one port and blindly broadcasts it to all other ports. It does not know who the recipient is.</p>
</li>
<li><p><strong>Drawback:</strong> High network traffic collisions and security risks (everyone sees everyone's data).</p>
</li>
<li><p><strong>Status: Currently this is Obsolete.</strong> Replaced by Switches.</p>
</li>
</ul>
<h3 id="heading-2-repeater"><strong>2. Repeater</strong></h3>
<ul>
<li><p><strong>Function:</strong> A repeater operating at the OSI model’s physical layer (Layer 1) is a powered device that extends the signal to keep traveling further. It regenerates signals to extend the range of a network.</p>
</li>
<li><p><strong>How it Works:</strong> It receives a weak signal (due to attenuation over long cables), amplifies it, and retransmits it.</p>
</li>
<li><p><strong>Use Case:</strong> Extending WiFi range or Ethernet cables beyond 100 meters.</p>
</li>
</ul>
<h3 id="heading-3-modem-modulator-demodulator"><strong>3. Modem (Modulator-Demodulator)</strong></h3>
<ul>
<li><p><strong>Function:</strong> Connects home network to the ISP (Internet Service Provider).</p>
</li>
<li><p><strong>How it Works:</strong> Converts all the analog signals to digital signals (known as Demodulation) and digital signals to analog signals which transmits further to cable/ telephone wire lines (known as a Modulation).</p>
</li>
</ul>
<h2 id="heading-layer-2-data-link-layer">Layer 2: Data link layer</h2>
<p>This data link layer mostly involves to transmit the data and it holds own MAC address. More over in the layer defines the location of the receiver and sender’s data.</p>
<h3 id="heading-4-switch"><strong>4. Switch</strong></h3>
<ul>
<li><p><strong>Function:</strong> Connects devices in a LAN (Local Area Network) with MAC address.</p>
</li>
<li><p><strong>How it Works:</strong> It learns the MAC address of every connected device. It transmits data only to the specific port where the target device is connected. It reduces the network congestion and improves speed and security. It has two types of switch:</p>
<ul>
<li><p><strong>Unmanaged</strong>: plug and play (suitable for home/small office)</p>
</li>
<li><p><strong>Managed</strong>: configurable for enterprise or large office use (configured VLANs, Qos)</p>
</li>
</ul>
</li>
</ul>
<h3 id="heading-5-bridge"><strong>5. Bridge</strong></h3>
<ul>
<li><p><strong>Function:</strong> Connects two separate LAN segments of a switch and make them appear as one.</p>
</li>
<li><p><strong>How it Works:</strong> Filters traffic based on MAC addresses to keep local traffic local, reducing congestion. Largely replaced by Switches (which are essentially multi-port bridges).</p>
</li>
</ul>
<h3 id="heading-6-access-point-ap"><strong>6. Access Point (AP)</strong></h3>
<ul>
<li><p><strong>Function:</strong> Access point required to create a Wireless Local Area Network (WLAN).</p>
</li>
<li><p><strong>How it Works:</strong> It acts as a bridge between wired Ethernet and wireless WiFi devices.</p>
</li>
<li><p><strong>Difference from Router:</strong> An Access point can only provides WiFi signal; it does not route traffic or any assign IP addresses (unless it is a "Wireless Router" combo unit).</p>
</li>
</ul>
<h2 id="heading-layer-3-network-layer">Layer 3: Network layer</h2>
<p>In this layer multiple network inter connected and communicated. It manages and distributed by an IP address.</p>
<h3 id="heading-7-router"><strong>7. Router</strong></h3>
<ul>
<li><p><strong>Function:</strong> Connects multiple networks (e.g., Home LAN to the Internet WAN). It stop broad cast traffic and make them isolate from each other.</p>
</li>
<li><p><strong>How it Works:</strong> It uses IP Addresses to determine the best path for data packets to travel. It maintains a Routing Table to make these decisions.</p>
</li>
</ul>
<h3 id="heading-8-brouter-bridging-router"><strong>8. Brouter (Bridging Router)</strong></h3>
<ul>
<li><p><strong>Function:</strong> A hybrid device that acts as both a Bridge and a Router.</p>
</li>
<li><p><strong>How it Works:</strong> It can route known protocols (like TCP/IP) and bridge unknown protocols (like non-routable legacy traffic) at the same time. Rarely used today.</p>
</li>
</ul>
<h2 id="heading-layer-4-advance-processing-layer">Layer 4: Advance processing layer</h2>
<p>In this layer mostly security underlying. Packets are communicating and filtered in this layer to prevent unauthorized access and make more secure.</p>
<h3 id="heading-9-gateway"><strong>9. Gateway</strong></h3>
<ul>
<li><p><strong>Function:</strong> Acts as a translator between two dissimilar networks. It works to translate private LAN request into a public internet requests.</p>
</li>
<li><p><strong>How it Works:</strong> It can convert protocols, data formats, or architectures (e.g., connecting a TCP/IP network to a legacy Mainframe network).</p>
</li>
</ul>
<h3 id="heading-10-firewall"><strong>10. Firewall</strong></h3>
<ul>
<li><p><strong>Function:</strong> Security guard. Controls incoming and outgoing traffic based on security rules.</p>
</li>
<li><p><strong>How it works:</strong> It acts as a security guard and controls all the incoming and outgoing traffic to prevent unauthorized access. It comes with hardware and software both. In hardware it installed on the network edge and in software it is installed on a particular server. It filters data packet by looking at headers (IP/Port) and tracks all active connections.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[DNS record types : explanation and detailed overview]]></title><description><![CDATA[In this digital era, every time whenever you have visited any website and your website is failed to open, now you might think - “what the hell this website is not working properly? does my internet not working…”. So before thinking why this website i...]]></description><link>https://blog.somnathsahu.dev/dns-record-types</link><guid isPermaLink="true">https://blog.somnathsahu.dev/dns-record-types</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[dns]]></category><category><![CDATA[dns-records]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Sun, 18 Jan 2026 20:11:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768761751244/b6270801-8363-4f10-8822-f4e09312e8dc.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this digital era, every time whenever you have visited any website and your website is failed to open, now you might think - “what the hell this website is not working properly? does my internet not working…”. So before thinking why this website is not working, let’s understand how any website works. Each website which serves the content, hosted their content in a location which is known as a server. Each server has a unique address which is known for IP address. IP address is consists or random number like <code>123.44.34.2</code> which is quite a elusive. Now, the website owner has reserved a unique name which helps them to share that name with the customer like (<code>google.com</code>) and that name does not change unlike IP address changes.</p>
<p>So whenever any user type the name <code>google.com</code> in the browser, it automatically lookup the associated IP and display the required content from that server. This entire <em>lookup system</em> is moreover known as a <strong>Domain Name System</strong> aka DNS.</p>
<h2 id="heading-how-dns-works">How DNS works?</h2>
<p>DNS works like a telephone directory, where it stores all the associated IP with the human readable domain name. So whenever you have entered any domain name or my personal website in the browser like <code>somnathsahu.dev</code> it goes to the DNS resolver which is your ISP.</p>
<p>Now this resolver looks for the name server for the IP and this root server directs it to the Top-Level Domain (TLD) server (e.g., for <code>.dev</code>).</p>
<p>The resolver asks the TLD server, which points it to the Authoritative Nameserver for <code>somnathsahu.dev</code>. The Authoritative Nameserver holds the actual IP address and sends it back to the resolver. And the resolver sends the IP address to your browser.</p>
<p>Now your browser uses the IP address to connect to the website's server and display the website content.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768763413032/e5723d3b-9078-4a8e-9f11-1683c4de7189.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-why-dns-records-are-required">Why DNS records are required?</h2>
<p>Generally, DNS is not only showing the website content. More over DNS records are used to control of a domain and its authority. DNS contains many records like <code>A</code>, <code>AAAA</code>, <code>CNAME</code>, <code>MX</code>, <code>TXT</code>, <code>NS</code> and each records types has different work to manage the domain, sending emails, creating aliases and many more.</p>
<p>So more over DNS has different types of records for different purposes.</p>
<ul>
<li><p>Website server and file management publicly.</p>
</li>
<li><p>Email delivery and communication.</p>
</li>
<li><p>Manages / ownership validation of domain.</p>
</li>
<li><p>Manages the subdomain or aliases.</p>
</li>
</ul>
<p>DNS records has 4 columns i.e. <strong>type</strong>, <strong>name</strong>, <strong>value</strong> , <strong>TTL</strong>.</p>
<ul>
<li><p><strong>type</strong> refers to record type like A, MX, TXT etc.</p>
</li>
<li><p><strong>name</strong> refers to domain name or subdomain name (mostly it is written as <code>@</code>, <code>blog</code>)</p>
</li>
<li><p><strong>value</strong> refers to where that name is pointing too whether it would be any text or any IP.</p>
</li>
<li><p><strong>TTL</strong> refers how long a DNS resolver (like your ISP's server) caches that particular DNS record</p>
</li>
</ul>
<h3 id="heading-a-record">A Record:</h3>
<p>The "A" stands for "address" and this record stores the IPV4 address of the website where the website is hosted. It looks similar like this <code>123.34.45.2</code></p>
<p>This A record is only the responsible records which allows to directing the web traffic. If you are using a managed web hosting or even an EC2 or a VPS, these servers are allocated an IP address which is actually directing the web traffic to that destination website.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768764541244/bc012515-e947-4e38-8e1e-83ea127803d0.png" alt="How domain looks like" class="image--center mx-auto" /></p>
<p>Here is an example of an A record:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>somnathsahu.dev</strong></td><td><strong>record type:</strong></td><td><strong>value:</strong></td><td><strong>TTL</strong></td></tr>
</thead>
<tbody>
<tr>
<td>@</td><td>A</td><td>198.0.2.1</td><td>14400</td></tr>
</tbody>
</table>
</div><h3 id="heading-aaaa-record">AAAA Record:</h3>
<p>AAAA records match a domain name with respect to an IPv6 address. This AAAA records are exactly like DNS A records, except that they store a domain's IPv6 address instead of its IPv4 address.</p>
<p>Here is an example of an AAAA record:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>somnathsahu.dev</strong></td><td><strong>record type:</strong></td><td><strong>value:</strong></td><td><strong>TTL</strong></td></tr>
</thead>
<tbody>
<tr>
<td>@</td><td>AAAA</td><td>2891:0db8:87c3:0000:</td><td></td></tr>
<tr>
<td>0000:8a2e:0b70:7334</td><td>14400</td><td></td></tr>
</tbody>
</table>
</div><h3 id="heading-cname-record">CNAME Record:</h3>
<p>A "canonical name" (CNAME) record points from an alias domain to a "canonical" domain or subdomain. A CNAME record is used in lieu of an A record, when a domain or subdomain is an alias of another domain.</p>
<p>For example, <a target="_blank" href="https://blog.somnathsahu.dev">blog.somnathsahu.dev</a> has a CNAME record with a value of "hashnode.network" (without the "blog"). This means when a DNS server hits this blog.somnathsahu.dev domain, it actually triggers another DNS lookup for somnathsahu.dev and their it found CNAME with “blog” named which is referring to a hasnode.network domain. Now it actually triggers another DNS lookup to hashnode.network and returning hashnode.network’s IP address via its A record.</p>
<p>Example of a CNAME record:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>somnathshau.dev</strong></td><td><strong>record type:</strong></td><td><strong>value:</strong></td><td><strong>TTL</strong></td></tr>
</thead>
<tbody>
<tr>
<td>blog</td><td>CNAME</td><td>hashnode.network</td><td>32600</td></tr>
</tbody>
</table>
</div><h3 id="heading-mx-record">MX Record:</h3>
<p>MX either way Mail Exchange record directs email to a mail server. The MX record indicates how any email message should be routed in accordance with the Simple Mail Transfer Protocol (SMTP, the standard protocol for all email).</p>
<p>Example of an MX record:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>somnathsahu.dev</strong></td><td><strong>record type:</strong></td><td><strong>priority:</strong></td><td><strong>value:</strong></td><td><strong>TTL</strong></td></tr>
</thead>
<tbody>
<tr>
<td>@</td><td>MX</td><td>10</td><td>mailhost1.example.com</td><td>45000</td></tr>
<tr>
<td>@</td><td>MX</td><td>20</td><td>mailhost2.example.com</td><td>45000</td></tr>
</tbody>
</table>
</div><h3 id="heading-txt-record">TXT Record:</h3>
<p>TXT record lets a domain manager to enter text into the Domain Name System (DNS). Text is stored in the form of one or more strings within quotation marks. The TXT record was originally intended as a place for human-readable notes. However, now it is also possible to put some machine-readable data into TXT records. One domain can have many TXT records.</p>
<p>Example of a TXT record:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>somnathsahu.dev</strong></td><td><strong>record type:</strong></td><td><strong>value:</strong></td><td><strong>TTL</strong></td></tr>
</thead>
<tbody>
<tr>
<td>@</td><td>TXT</td><td>"txt:22323njf"</td><td>32600</td></tr>
</tbody>
</table>
</div><p>Today, two of the most important uses for DNS TXT records are email spam prevention and domain ownership verification, although TXT records were not designed for these uses originally.</p>
<h3 id="heading-ns-record">NS Record:</h3>
<p>NS stands for ‘nameserver,’ and the nameserver record indicates which DNS server is authoritative for that domain. Basically, this records tell the Internet where to go to find out a domain's IP address. A domain often has multiple NS records which can indicate primary and secondary nameservers for that domain. Without properly configured NS records, users will be unable to load a website or application.</p>
<p>Here is an example of an NS record:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>somnathsahu.dev</strong></td><td><strong>record type:</strong></td><td><strong>value:</strong></td><td><strong>TTL</strong></td></tr>
</thead>
<tbody>
<tr>
<td>@</td><td>NS</td><td>ns1.exampleserver.com</td><td>21600</td></tr>
</tbody>
</table>
</div><h2 id="heading-wrap-up">Wrap up</h2>
<p>DNS is a quite important topic which actually keep your website live.</p>
<p>And now we have discussed the <strong>five main DNS record types</strong>:</p>
<ul>
<li><p><strong>A Record</strong> – Website address IPV4</p>
</li>
<li><p><strong>AAAA record</strong> - similar like A record but contains IPV6 address</p>
</li>
<li><p><strong>CNAME Record</strong> – Domain alias or subdomain creation</p>
</li>
<li><p><strong>MX Record</strong> – Email routing</p>
</li>
<li><p><strong>NS Record</strong> – DNS control</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768767030385/7f15c47c-f0ad-4d67-8205-fe8555c30f48.png" alt="Important DNS record name and their function" class="image--center mx-auto" /></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Why version control exists: the pen drive problem]]></title><description><![CDATA[Developing an application is easy, but the difficulties come with maintaining that application. Any application is built on someone’s local machine, and now the challenge is to ship that application to a server or someone else's machine. Generally, s...]]></description><link>https://blog.somnathsahu.dev/why-version-control-exists-the-pen-drive-problem</link><guid isPermaLink="true">https://blog.somnathsahu.dev/why-version-control-exists-the-pen-drive-problem</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Thu, 08 Jan 2026 06:29:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Bb_X4JgSqIM/upload/1804d96f8531b4f38b2c67448626dd83.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Developing an application is easy, but the difficulties come with maintaining that application. Any application is built on someone’s local machine, and now the challenge is to ship that application to a server or someone else's machine. Generally, shipping a physical product through a courier and shipping an application are not very different; it works the same way, but the medium has changed.</p>
<p>Let's say you have written a complete todo application where you can add and delete your daily todo list and maintain it on your local machine. Now, your friend wants to use that application on his system. So the general and easiest way to share that code is to copy all the files to a pen drive and give it to your friend. Now, your friend is using your todo application on his machine, and wahoo! You will feel so proud that you did a wonderful job.</p>
<p>One fine day, after gaining some coding knowledge, your friend added a simple and important feature where he can modify his created todo item, which is a new feature that was not present earlier. He modifies all his code in the existing coding files that you shared with him.</p>
<p>Meanwhile, you have changed some design layouts of that application to look more appropriate and beautiful on your system.</p>
<p>Now the time come when you want to share that design with your friend and your friend want to share that additional feature with you.</p>
<p>If you took your friend’s code into your machine, your recent design changes will be overwritten and the other side if your friend took your code, his functionality will be overwritten.</p>
<p>Now the problem arise!! This problem occurs when only two person involved but think of a large application where multiple team member are working on same project, multiple people are working on even same project files.</p>
<p>So to solve this problem <strong>version control system</strong> has introduced, using version control every change (add, delete, modify) to project files in a special repository, creating a history or "time machine" for your code, allowing you to see who changed what and when, compare versions, and easily revert to older, stable states if errors occur, all while enabling seamless collaboration by managing simultaneous edits from multiple people through concepts like branching and merging. It prevents lost work and conflicting edits by offering a central record and controlled ways to integrate changes, making development safer and more efficient.</p>
<h2 id="heading-types-of-version-control-system">Types of Version Control System:</h2>
<p>there are two types of version control system:</p>
<h3 id="heading-local-version-control-systems-local-vcs">Local Version Control Systems (Local VCS)</h3>
<p>A Local Version Control System operates entirely on your local machine without any connection to a remote repository. All changes and version history are stored in a local database on your computer.</p>
<h3 id="heading-centralized-version-control-systems">Centralized Version Control Systems</h3>
<p>In a Centralized Version Control System, all the files and their version history are stored in a single central server. Developers connect to this server to access or modify files.</p>
<p><img src="https://media.geeksforgeeks.org/wp-content/uploads/20250821120143145168/Centralized-Version-Control.webp" alt="Centralized-Version-Control" /></p>
<p>Image reference: <a target="_blank" href="https://www.geeksforgeeks.org/">https://www.geeksforgeeks.org/</a></p>
]]></content:encoded></item><item><title><![CDATA[Git for beginners: basics and essential commands]]></title><description><![CDATA[Git is an open-sourced distributed version control system (DVCS) to manage the collaborative or personal coding files effectivity. Git installed in the local system and manages from the local with the remote repository. In the server side, modern man...]]></description><link>https://blog.somnathsahu.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://blog.somnathsahu.dev/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Tue, 06 Jan 2026 19:24:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767727503741/0ffe2734-3671-489d-87ad-2875f0e0b50f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Git is an open-sourced <strong>distributed version control system</strong> (DVCS) to manage the collaborative or personal coding files effectivity. Git installed in the local system and manages from the local with the remote repository. In the server side, modern management system like Github, GitLab manages the coding files and extends to deploy those code in the server destination like CI/CD approaches.</p>
<h2 id="heading-why-git-is-used">Why git is used</h2>
<p>Git's main ideas include its distributed setup, where developers have the entire project history on their local machines, a repository as the main storage, commits as snapshots of the project, and branching and merging for working separately and then combining changes.</p>
<h2 id="heading-how-git-works">How git works</h2>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/1*NQ4244rrGsfMbslP3Fs6Ig.png" alt="Git Workflow" class="image--center mx-auto" /></p>
<p><em>Git workflow, from</em> <a target="_blank" href="https://madewithml.com/courses/mlops/git/"><em>https://madewithml.com/courses/mlops/git/</em></a></p>
<p>To start working on git, you need to install and configure the git in your local system. To understand the git as how it works and the role of this .git folder. Refer this article: <a target="_blank" href="https://somnathsahu.hashnode.dev/inside-git-how-it-works-and-the-role-of-the-git-folder"><strong>Inside Git: How It Works and the Role of the .git Folder</strong></a></p>
<p>Starting from <code>git init</code> to initialize the local repo → <code>git add .</code> to stages all the local changes → <code>git commit</code> to commit all the local changes with message → <code>git push</code> to store all the local changes to server → <code>git pull</code> to take other’s committed file in to the local system to keep the system at sync.</p>
<h2 id="heading-git-basics-and-core-terminologies">Git basics and core terminologies</h2>
<ul>
<li><p><strong>Repository (Repo):</strong> A project's storage location, containing all files and their complete revision history.</p>
</li>
<li><p><strong>Commit:</strong> A snapshot of your files at a specific point in time. Each commit has a unique ID (SHA) and a description of changes.</p>
</li>
<li><p><strong>Branch:</strong> A parallel version of the repository. It allows you to develop features or fix bugs in isolation from the main codebase (usually called <code>main</code> or <code>master</code> or <code>dev</code>).</p>
</li>
<li><p><strong>Staging Area (Index):</strong> A "buffer" zone where you prepare changes before they are officially committed to the history.</p>
</li>
<li><p><strong>HEAD:</strong> A pointer to the current branch or specific commit you are currently working on.</p>
</li>
<li><p><strong>Remote:</strong> A version of your repository hosted on a server (e.g., GitHub, GitLab) that allows for collaboration.</p>
</li>
<li><p><strong>Merge:</strong> The process of combining changes from one branch into another.</p>
</li>
<li><p><strong>Clone:</strong> Creating a local copy of a remote repository on your computer.</p>
</li>
<li><p><strong>Fork:</strong> A personal copy of someone else's project on a remote server, used for contributing to open-source projects. </p>
</li>
</ul>
<h2 id="heading-basic-git-workflow"><strong>Basic git workflow</strong></h2>
<p>To manage changes effectively, Git follows a specific workflow involving three main trees: the <strong>Working Directory</strong>, the <strong>Staging Area</strong>, and the <strong>Repository</strong>. </p>
<ol>
<li><p><strong>Initialize/Clone:</strong> Start a new repo with <code>git init</code> or copy an existing one with <code>git clone [URL]</code>.</p>
</li>
<li><p><strong>Modify:</strong> Make changes to files in your <strong>Working Directory</strong>.</p>
</li>
<li><p><strong>Stage:</strong> Use <code>git add [file]</code> to move changes to the <strong>Staging Area</strong>.</p>
</li>
<li><p><strong>Commit:</strong> Use <code>git commit -m "message"</code> to permanently save staged changes to the <strong>Repository</strong> history.</p>
</li>
<li><p><strong>Push/Pull:</strong> Share your work by sending commits to a remote repo using <code>git push</code>, or update your local repo with others' changes using <code>git pull</code></p>
</li>
</ol>
<h2 id="heading-common-git-commands">Common git commands</h2>
<p><code>git config --global</code> <a target="_blank" href="http://user.name"><code>user.name</code></a> <code>“[firstname lastname]”</code> : set a name that is identifiable for credit when review version history</p>
<p><code>git config --global</code> <a target="_blank" href="http://user.email"><code>user.email</code></a> <code>“[valid-email]”</code> : set an email address that will be associated with each history marker</p>
<p><code>git init</code> : initialize an existing directory as a Git repository</p>
<p><code>git clone [url]</code> : retrieve an entire repository from a hosted location via URL</p>
<p><code>git remote add [alias] [url]</code> : add a git URL as an alias</p>
<p><code>git fetch [alias]</code> : fetch down all the branches from that Git remote</p>
<p><code>git merge [alias]/[branch]</code> : merge a remote branch into your current branch to bring it up to date</p>
<p><code>git push [alias] [branch]</code> : Transmit local branch commits to the remote repository branch</p>
<p><code>git pull</code> : fetch and merge any commits from the tracking remote branch</p>
<p><code>git status</code> : show modified files in working directory, staged for your next commit</p>
<p><code>git add [file]</code> : add a file as it looks now to your next commit (stage)</p>
<p><code>git reset [file]</code> : unstage a file while retaining the changes in working directory</p>
<p><code>git diff</code> : difference between file about what is changed but not staged</p>
<p><code>git diff --staged</code> : difference of what is staged but not yet committed</p>
<p><code>git commit -m “[message]”</code> : commit your staged content as a new commit snapshot</p>
<p><code>git branch</code> : list all the branches. a <code>*</code> will appear next to the currently active branch</p>
<p><code>git branch [branch-name]</code> : create a new branch at the current commit</p>
<p><code>git checkout</code> : switch to another branch and check it out into current working directory</p>
<p><code>git merge [branch]</code> : merge the specified branch’s history into the current one</p>
<p><code>git log</code> : show all commits in the current branch’s history</p>
<p><code>git stash</code> : Save modified and staged changes</p>
<p><code>git stash list</code> : list stack-order of stashed file changes</p>
<p><code>git stash pop</code> : write working from top of stash stack</p>
<p><code>git stash drop</code> : discard the changes from top of stash stack</p>
<p><code>git rebase [branch]</code> : apply any commits of current branch ahead of specified one</p>
<p><code>git reset --hard [commit]</code> : clear staging area, rewrite working tree from specified commit</p>
<p><code>git log branchB..branchA</code> : show the commits on branchA that are not on branchB</p>
<p><code>git log --follow [file]</code> : show the commits that changed file, even across renames</p>
<p><code>git diff branchB...branchA</code> : show the diff of what is in branchA that is not in branchB</p>
<p><code>git show [SHA]</code> : show any object in Git in human-readable format</p>
<p><code>git rm [file]</code> : delete the file from project and stage the removal for commit</p>
<p><code>git mv [existing-path] [new-path]</code> : change an existing file path and stage the move</p>
<p><code>git am &lt;patch_file&gt;</code> : applies the specified patch to the current branch.</p>
<p><code>git am --abort</code> : cancel the entire operation and revert your branch to its original state before you started the <code>am</code> command.</p>
]]></content:encoded></item><item><title><![CDATA[Inside git: how it works and the role of the .git folder]]></title><description><![CDATA[Git is a distributed version control system which helps a developer to track and manages personal or collaborative code files over the time. GIT is an open-source system created by Linus Torvalds in 2005.
To start working on git, you need to install ...]]></description><link>https://blog.somnathsahu.dev/inside-git-how-it-works-and-the-role-of-the-git-folder</link><guid isPermaLink="true">https://blog.somnathsahu.dev/inside-git-how-it-works-and-the-role-of-the-git-folder</guid><category><![CDATA[Git]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Gitcommands]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Tue, 06 Jan 2026 06:12:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767680084777/b5bd1db5-ca78-486f-aaa6-a3cb05e36894.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Git is a distributed version control system which helps a developer to track and manages personal or collaborative code files over the time. GIT is an open-source system created by <strong>Linus Torvalds</strong> in 2005.</p>
<p>To start working on git, you need to install and configure the git in your local system. To understand the git as how it works and the role of this .git folder. Let’s dive into this.</p>
<h2 id="heading-what-is-git-folder">What is <code>.git</code> folder:</h2>
<p><code>.git</code> folder is automatically created during your first initializing the project or folder by running <code>git init</code> command in your terminal. Git stores everything including files, directories, and history. It stores as immutable objects identified by a 40-character SHA-1 hash. These are stored in <code>.git/objects</code>.</p>
<h2 id="heading-key-components-of-git-folder"><strong>Key components of</strong> <code>.git</code> folder</h2>
<p>The contents of the <code>.git</code> folder might seem confusing at first, but every file and subdirectory has a specific purpose.</p>
<h3 id="heading-1-head"><strong>1. HEAD</strong></h3>
<ul>
<li><p>The <code>HEAD</code> file points to the current branch reference.</p>
</li>
<li><p>For example: <code>ref: refs/heads/main</code></p>
</li>
<li><p>It tracks which branch you're currently on.</p>
</li>
</ul>
<h3 id="heading-2-config"><strong>2. config</strong></h3>
<p>This <code>config</code> contains repository-specific configuration settings (like remotes, user info, aliases), separate from global git config.</p>
<ul>
<li><p>Example:</p>
</li>
<li><pre><code class="lang-plaintext">  [core]
      repositoryformatversion = 0
      filemode = false
      bare = false
      logallrefupdates = true
      symlinks = false
      ignorecase = true    
  [remote "origin"]
          url = git@github.com:user/repo.git
          fetch = +refs/heads/*:refs/remotes/origin/*
</code></pre>
</li>
</ul>
<h3 id="heading-3-description"><strong>3. description</strong></h3>
<p>This <code>description</code> is text file which used mostly by graphical interfaces or Github desktop or git lenses to describe the repository. Usually ignored in bare repositories.</p>
<h3 id="heading-4-hooks"><strong>4. hooks/</strong></h3>
<p>This <code>hooks</code> folder Contains scripts that git can trigger at key events, such as before a commit (<code>pre-commit</code>) or after a push (<code>post-receive</code>). It has stored custom logic for code quality checks, CI/CD, etc., can be executed here.</p>
<h3 id="heading-5-info"><strong>5. info/</strong></h3>
<p>Inside this <code>info/</code> folder consists of the <code>exclude</code> file, which can be used to ignore files locally, supplementing <code>.gitignore</code>. It helps prevent pushing any confidential or unnecessary files.</p>
<h3 id="heading-6-objects"><strong>6. objects/</strong></h3>
<p>This <code>objects/</code> folder is known for the <strong>heart of Git’s content storage.</strong> Here git stores everything—files, directories, commits—as <strong>objects</strong> using the content-addressed storage model. Here the objects are named based on the SHA-1 (or SHA-256) hash of their content. In this folder every objects have a unique address.</p>
<ul>
<li><ul>
<li><p><strong>blobs:</strong> store file contents</p>
<p>    * <strong>trees:</strong> represent directory structures</p>
<p>    * <strong>commits:</strong> record changes and metadata</p>
<p>    * <strong>tags:</strong> point to specific objects</p>
</li>
</ul>
</li>
<li><p>Structure example: <code>objects/bg/3cg3434567r34...</code></p>
</li>
</ul>
<h3 id="heading-7-refs"><strong>7. refs/</strong></h3>
<p>This <code>refs/</code> folder contains references, or <strong>pointers to commits</strong>.</p>
<ul>
<li><p><code>refs/heads/</code>: Referred local branches</p>
</li>
<li><p><code>refs/tags/</code>: Referred for Tags</p>
</li>
<li><p><code>refs/remotes/</code>: Referred for Remote branches</p>
</li>
</ul>
<h3 id="heading-8-logs"><strong>8. logs/</strong></h3>
<p>Logs folder stores recent updates to references which helps recover the lost commits or even you can see previous <code>HEAD</code> position. The command is used to check the recent updates : <code>git reflog</code></p>
<h3 id="heading-9-index"><strong>9. index</strong></h3>
<p><code>index</code> is a binary file which keeps track of changes staged for the next commit. In this file every content has been tracked.</p>
<h3 id="heading-10-packed-files"><strong>10. Packed files</strong></h3>
<p>Git may also optimize storage using <strong>packfiles</strong> (visible as <code>pack</code> subfolder within <code>objects/</code>). It combines many objects into compressed files to save space and improve performance.</p>
<h2 id="heading-final-words">Final words</h2>
<p>The <code>.git</code> folder is much more than a hidden subdirectory—it’s a central nervous system of your project repository. By understanding what’s inside and how Git builds its history through objects, trees, commits, and references.</p>
<p>Disclaimer: image sourced from <a target="_blank" href="https://www.geeksforgeeks.org/">https://www.geeksforgeeks.org/</a></p>
]]></content:encoded></item><item><title><![CDATA[Python Is Eating the DATA & AI World!]]></title><description><![CDATA[🧠💡 Why Python? Because Even AI Likes Simplicity!
Let’s face it. Python isn’t just a snake 🐍 anymore — it’s the new king of the Data & AI jungle! From machine learning to data analysis, Python is seamlessly integrating into every tech stack like it...]]></description><link>https://blog.somnathsahu.dev/python-is-eating-the-data-and-ai-world</link><guid isPermaLink="true">https://blog.somnathsahu.dev/python-is-eating-the-data-and-ai-world</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[chai-code ]]></category><dc:creator><![CDATA[Somnath Sahu]]></dc:creator><pubDate>Wed, 16 Apr 2025 08:43:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1744792895461/c080fc15-7db0-4555-b39b-8b87556bbed3.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why-python-because-even-ai-likes-simplicity">🧠💡 Why Python? Because Even AI Likes Simplicity!</h2>
<p>Let’s face it. Python isn’t just a snake 🐍 anymore — it’s the new king of the Data &amp; AI jungle! From machine learning to data analysis, Python is seamlessly integrating into every tech stack like it owns the place.</p>
<p>But <strong>why Python?</strong> Why not Java, C++, or even, dare I say, Excel macros? 😅</p>
<hr />
<h2 id="heading-most-popular-programming-languages-in-2025">📊 Most Popular Programming Languages in 2025</h2>
<p><em>(Based on GitHub usage, Stack Overflow trends &amp; developer surveys)</em></p>
<p>Here’s a snapshot of how the programming languages are stacking up in 2025:</p>
<h3 id="heading-top-7-languages-2025">🏆 Top 7 Languages (2025):</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Rank</td><td>Language</td><td>Popularity (%)</td></tr>
</thead>
<tbody>
<tr>
<td>1️⃣</td><td><strong>Python</strong></td><td>29.5% 🔥</td></tr>
<tr>
<td>2️⃣</td><td>JavaScript</td><td>19.7% ⚡</td></tr>
<tr>
<td>3️⃣</td><td>Java</td><td>14.3% ☕</td></tr>
<tr>
<td>4️⃣</td><td>C#</td><td>9.2% 💻</td></tr>
<tr>
<td>5️⃣</td><td>C/C++</td><td>7.8% 🔧</td></tr>
<tr>
<td>6️⃣</td><td>TypeScript</td><td>6.1% 🚀</td></tr>
<tr>
<td>7️⃣</td><td>Go</td><td>4.9% 🐹</td></tr>
</tbody>
</table>
</div><blockquote>
<p><strong>Python is #1</strong> — leading the charge thanks to Data Science, AI, and Automation dominance. 🧠🚀</p>
</blockquote>
<hr />
<h2 id="heading-python-vs-the-world-why-python-wins">⚔️ Python vs. The World: Why Python Wins 🏆</h2>
<p>Let’s settle this once and for all</p>
<h3 id="heading-1-less-code-more-chill">🔹 1. <strong>Less Code, More Chill</strong></h3>
<ul>
<li><p><strong>Python:</strong> <code>if hungry: eat()</code></p>
</li>
<li><p><strong>Java:</strong> <code>public class Hunger { public static void main(String[] args) { if(hungry) { eat(); } } }</code></p>
</li>
<li><p><strong>Javascript:</strong> <code>if (hungry) {eat();}</code></p>
</li>
</ul>
<h3 id="heading-2-easier-to-learn-even-for-non-tech-folks">🔹 2. <strong>Easier to Learn (Even for Non-Tech Folks)</strong></h3>
<p>Python reads like plain English. It’s great for:</p>
<ul>
<li><p>Students 👨‍🎓</p>
</li>
<li><p>Scientists 🧪</p>
</li>
<li><p>Developers 🧑‍💻</p>
</li>
<li><p>And anyone who is willing too..</p>
</li>
</ul>
<h3 id="heading-3-massive-libraries-amp-frameworks">🔹 3. <strong>Massive Libraries &amp; Frameworks</strong></h3>
<p>From <strong>TensorFlow</strong> to <strong>scikit-learn</strong>, <strong>Pandas</strong> to <strong>PyTorch</strong>, Python has a package for almost <em>everything</em>:</p>
<ul>
<li><p>Machine Learning 🧠</p>
</li>
<li><p>Data Science 📊</p>
</li>
<li><p>Web Scraping 🌐</p>
</li>
<li><p>Automation ⚙️</p>
</li>
</ul>
<h3 id="heading-4-huge-community-faster-help">🔹 4. <strong>Huge Community = Faster Help</strong></h3>
<p>As Python has large community support. So Stuck? Just Google it. Chances are, someone on Stack Overflow has already solved it — twice. 💬</p>
<h3 id="heading-5-cross-platform-amp-versatile">🔹 5. <strong>Cross-Platform &amp; Versatile</strong></h3>
<p>Write once, run anywhere. From small Raspberry Pi projects to giant AI systems on the cloud — Python doesn’t discriminate. 🥧☁️</p>
<hr />
<h2 id="heading-how-python-powers-the-data-amp-ai-world">🤯 How Python Powers the DATA &amp; AI World 🔍📊</h2>
<p>In the Data &amp; AI realm, Python is like that kid in class who knows everything, finishes assignments early, and still helps everyone else.</p>
<p>Here’s how it shines:</p>
<h3 id="heading-1-data-science">🧬 1. <strong>Data Science</strong></h3>
<p>With <strong>Pandas</strong>, <strong>NumPy</strong>, and <strong>Matplotlib</strong>, Python makes data analysis a piece of cake 🍰<br />Just don’t eat the pie chart.</p>
<h3 id="heading-2-machine-learning">🧠 2. <strong>Machine Learning</strong></h3>
<p>Frameworks like <strong>scikit-learn</strong>, <strong>PyTorch</strong>, and <strong>TensorFlow</strong> make training models as smooth as butter.</p>
<h3 id="heading-3-ai-amp-deep-learning">🛰️ 3. <strong>AI &amp; Deep Learning</strong></h3>
<p>Whether you're building self-driving cars, image recognition tools, or just teaching a bot to flirt on Tinder — Python’s your wingman 💘🤖</p>
<hr />
<h2 id="heading-big-brands-that-python">🏆 Big Brands That ❤️ Python</h2>
<p>Python isn’t just for hobbyists and side hustles. These tech giants are riding the Python train too:</p>
<ul>
<li><p><strong>Google</strong> – Uses Python for AI &amp; automation 🤖</p>
</li>
<li><p><strong>Netflix</strong> – Python recommends your next binge 📺</p>
</li>
<li><p><strong>Instagram</strong> – Built using Django, a Python framework 📸</p>
</li>
</ul>
<hr />
<h2 id="heading-the-future-of-python-in-data-amp-ai">🚀 The Future of Python in DATA &amp; AI</h2>
<p>Will Python stay on top?</p>
<p>✅ Easy syntax<br />✅ Endless libraries<br />✅ Open-source love ❤️<br />✅ Works with cloud, edge, and IoT</p>
<hr />
<h2 id="heading-tldr-python-is-the-real-mvp">👨‍💻 TL;DR — Python is the Real MVP</h2>
<ul>
<li><p>🥇 Easiest to learn</p>
</li>
<li><p>🚀 Rich in libraries</p>
</li>
<li><p>🧠 Built for AI, ML &amp; data</p>
</li>
<li><p>🤝 Supported by a huge global community</p>
</li>
<li><p>🧩 Integrates easily with cloud, IoT, APIs, you name it.</p>
</li>
</ul>
<hr />
<h2 id="heading-ready-to-ride-the-python-wave">🐍 Ready to ride the Python wave?</h2>
<p><strong>Start learning today</strong> — because in the world of DATA &amp; AI, Python isn’t just a trend,<br />…it’s a full-blown revolution. ✊📊</p>
]]></content:encoded></item></channel></rss>