<?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[shyamhzdotdev]]></title><description><![CDATA[shyamhzdotdev]]></description><link>https://blog.shyamhz.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/695021914b3378c025dc03ce/a872df6a-84d3-4d00-9da5-468649b6b999.png</url><title>shyamhzdotdev</title><link>https://blog.shyamhz.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 23:50:37 GMT</lastBuildDate><atom:link href="https://blog.shyamhz.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Investigating how Linux works under the hood — a file-system-led exploration]]></title><description><![CDATA[Linux is not a single monolithic black box that run on magic, Linux is a collection of independent and purposeful smaller systems moving in unison and appears like one unified structure.
To really und]]></description><link>https://blog.shyamhz.dev/linux-filesystem-and-how-it-works</link><guid isPermaLink="true">https://blog.shyamhz.dev/linux-filesystem-and-how-it-works</guid><category><![CDATA[Linux]]></category><category><![CDATA[linux-filesystem]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Wed, 22 Apr 2026 15:40:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/1df729f0-f02e-4905-b4d9-ff66139947e8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Linux is not a single monolithic black box that run on magic, Linux is a collection of independent and purposeful smaller systems moving in unison and appears like one unified structure.</p>
<p>To really understand Linux we need to look underneath the layers, at the heart of the Linux filesystem that is true flesh and bones of Linux.</p>
<h2>Investigative study</h2>
<ul>
<li>Linux file system is not just a random directory structure that we can traverse through blindly, every single part has it's purpose and importance , so the order matters.</li>
</ul>
<h2><code>/etc</code> : the intent of the system</h2>
<p><code>/etc</code> is not just a directory it is the command center for the whole system, from turning the system on to running the processes every <code>"how"</code> lives inside here.</p>
<p>Users, passwords, mounts, hostname, DNS configuration, service behavior—all of it lives here. Files like <code>/etc/passwd</code>, <code>/etc/fstab</code>, <code>/etc/hostname</code>, <code>/etc/resolv.conf</code> define identity and expected behavior.</p>
<p>How to mount the filesystem while booting up? what are the network configurations? How the services should behave? what users exist on the system? You name it and it lives inside <code>/etc/</code> . It's the backbone and nervous system of Linux.</p>
<h2>DNS and name resolution:</h2>
<p>Following up with the <code>/etc/</code> directory, we reach very crucial part of the system, at the heart of the internet lies DNS lookup and resolution, fail here and your system is isolated from the Internet.</p>
<p>When a program asks for a hostname, the system does not immediately query DNS. It follows a resolution order defined in <code>/etc/nsswitch.conf</code>: check local files, then DNS, maybe LDAP or other sources.</p>
<p>Inside <code>/etc</code> lives files like <code>resolv.conf</code> that is phonebook for DNS servers. without it you have no destination or address for your target. <code>/etc/resolv.conf</code> does not always point directly to real DNS servers—it is often a stub managed by something like systemd-resolved, acting as a local intermediary.</p>
<p>Name resolution is not optional it's what runs the Internet. Without it Servers are just isolated boxes with no real use.</p>
<h2>Networking and routing</h2>
<p>If name resolution tells you where to go <code>ip routes</code> <em>(also available as a command)</em> tells your system how to go there.. It's like a map that your system uses send data to the destination in the correct path.<br />Routing is not just one time address detection like DNS resolution, configuration in <code>/etc</code> or network managers may claim a route exists, but DHCP clients, VPNs, or container systems can overwrite it dynamically.</p>
<p>If something behaves unpredictably, the kernel table is the only reliable source.</p>
<h2><code>/proc</code> : the system as it is now</h2>
<p><code>/proc</code> is the live view of the system. It does not describe what should happen, it shows what is happening.</p>
<p>Every process has a directory under <code>/proc</code> that exposes its state. You can inspect the exact command it was launched with, its environment variables, the files and sockets it has open, and its memory usage. This is direct access to runtime behavior.</p>
<p>If a process is behaving incorrectly, <code>/proc</code> shows you why. You can see what resources it holds, what files it is interacting with, and what its execution context looks like.</p>
<p>Beyond per-process data, <code>/proc</code> also exposes kernel-level configuration through entries like /proc/sys. These values directly control system behavior at runtime, from networking parameters to memory management.</p>
<p>This is where assumptions get validated or disproven. It is the closest view to the actual system state.</p>
<h2><code>/dev</code> and <code>/sys</code></h2>
<p><code>/dev</code> presents devices as files, but it is not where devices are defined. It is an interface layer.</p>
<p>The real source of truth is <code>/sys,</code> where the kernel exposes hardware and driver state. Devices are detected by the kernel, described in <code>/sys</code>, and then user-space tools dynamically create corresponding nodes in <code>/dev</code>.</p>
<p>This means device names in <code>/dev</code> are not guaranteed to be stable. They can change across boots unless persistent identifiers like <code>UUID</code>s are used.</p>
<p>If a device disappears, changes behavior, or fails, the explanation will not be in <code>/dev</code>. It will be in <code>/sys</code>, where the kernel tracks the actual hardware state.</p>
<p>Understanding this separation avoids misdiagnosing symptoms as causes.</p>
<h2><code>/boot</code> : where everything starts</h2>
<p>Before the system reaches <code>/etc</code> or any runtime state, it must boot. <code>/boot</code> contains the kernel, the <code>initramfs</code>, and the <code>bootloader</code> configuration that define how the system starts.</p>
<p>This stage determines how hardware is initialized, how the <code>root filesystem</code> is located, and what early setup steps occur. The <code>initramfs</code> can mount <code>filesystems</code>, unlock encrypted disks, or configure networking before the main system even begins.</p>
<p>This means the behavior during early boot can differ from what is declared later in <code>/etc</code>. A system might mount a disk using a <code>UUID</code> during boot, even if <code>/etc/fstab</code> references a device name.</p>
<p>If something fails early or behaves inconsistently during startup, the root cause is almost always here, not in the later configuration.</p>
<h2>Services and execution</h2>
<p>Services are not simply executed, they are orchestrated.</p>
<p>System managers like <code>systemd</code> read configuration, resolve dependencies, and determine the order and conditions under which services run. Unit files define desired behavior, but overrides, dependencies, and runtime conditions define actual behavior.</p>
<p>A service starting late, failing, or behaving differently is often not an issue with the service itself. It is usually the result of dependency ordering, conflicting configurations, or environmental differences.</p>
<h2>Logs: the sequence of events</h2>
<p>Files show structure, logs show time. Without logs you only see the current state, with logs you understand how that state was reached.</p>
<p>Logs capture events across the system, kernel messages, service activity, hardware changes, and configuration updates. They reveal what changed, when it changed, and which component caused the change.</p>
<p>A configuration file alone cannot explain behavior. A log showing that a service rewrote that configuration minutes later can.</p>
<p>Understanding a system requires building a timeline. Logs are how you construct that timeline.</p>
<h2>Users, permissions, and control</h2>
<p>User definitions exist in <code>/etc</code>, but control is enforced through permissions and capabilities.</p>
<p>Files, processes, and services operate under specific privilege levels. <code>Setuid</code> binaries, file capabilities, and group memberships define what actions are allowed. Small misconfigurations in these areas can create large security risks.</p>
<p>Security is not a single setting, it is the interaction between identity, permissions, and execution context. To understand control, you must examine all three together.</p>
<p>Security in Linux is not just an add-on it is how the system "thinks" and operates. You touch only what you own .</p>
<h2>Environment and execution context</h2>
<p>Programs do not run in isolation, they inherit an environment.</p>
<p>Environment variables can come from shell configuration, system-wide defaults, or service definitions. A program started in a terminal may behave differently from the same program started as a system service because the environment is different.</p>
<p>Variables like <code>PATH</code> or <code>LD_LIBRARY_PATH</code> can change how binaries are located and executed. These differences are often the source of subtle bugs.</p>
<p>Same binary, different environment, different behavior.</p>
<h2>The core principle and conclusion</h2>
<p>Linux is not a single chunk of a system, it is a set of layers interacting through the filesystem.</p>
<p>To understand it, read what was intended in <code>/etc</code>, identify which component enforces that intent, verify what is actually happening through <code>/proc</code> and <code>/sys</code>, and confirm it with <code>logs</code>.</p>
<blockquote>
<p>Most failures are not isolated issues, they are mismatches between layers.</p>
</blockquote>
<p>The only reliable approach is to trace across them until intent, enforcement, trail and the reality align.</p>
]]></content:encoded></item><item><title><![CDATA[Control Flow in JavaScript: If, Else, and Switch Explained]]></title><description><![CDATA[In a typical day to day programming there are a lot of decisions that need to be made inside our code files depending on which we perform different actions.. Typically Conditional operators are used t]]></description><link>https://blog.shyamhz.dev/control-flow-in-javascript-if-else-and-switch-explained</link><guid isPermaLink="true">https://blog.shyamhz.dev/control-flow-in-javascript-if-else-and-switch-explained</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[control flow]]></category><category><![CDATA[javascript control flow]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 15 Mar 2026 17:29:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/19699850-e496-415c-8fa5-37431326fd78.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In a typical day to day programming there are a lot of decisions that need to be made inside our code files depending on which we perform different actions.. Typically Conditional operators are used to make such decisions. This decision making and deciding and controlling the flow of the program is called control flow.</p>
<p>We will learn today how we can write control flows for our programs in this article. Let's start</p>
<h2>If statements</h2>
<p><code>If statements</code> allow you to perform different actions conditionally based on output of a condition at runtime. Let's take an example</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/56ab6fb0-0eeb-4028-b578-638080ea84b6.png" alt="" style="display:block;margin:0 auto" />

<p>As you can see based on a condition we can conditionally print a congratulate message. This is what a typical control flow looks like. But we can do better.</p>
<h2><code>If-else</code> statement</h2>
<p>We can also perform an action if certain condition does not result in a truthy value. Think adding a new entry in a database, what if it fails? user needs to informed of that right?</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/160bf4c5-99ee-4e35-8dc7-7f6eff37f7f4.png" alt="" style="display:block;margin:0 auto" />

<h2><code>else if</code> ladder</h2>
<p>But what if we are in a situation where there can be many outcomes or possibilities how do handle it then ? when there can be multiple truthy values for different cases?<br />For that we use following syntax</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/a54f1363-7101-4b4b-9e07-8c71d3a26274.png" alt="" style="display:block;margin:0 auto" />

<h2><code>switch</code> statement</h2>
<p>This is used when you want to do simple match based conditioning.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/ec6e2721-8a26-4ac0-89df-4c17e6489bb7.png" alt="" style="display:block;margin:0 auto" />

<p>In switch-case you cannot use any expression for that you need to use <code>if-else</code>, in every case it must be a constant. <code>default</code> case is for all the invalid values that does not match with any provided cases. <code>break</code> in each case is must so that the all next <code>case</code> does not execute including <code>default</code> automatically.</p>
<h2>Conclusion</h2>
<p>This is how we can control the flow of our program and make decision at the runtime dynamically depending of values and conditions. Hopefully now you can use your own control flows.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Objects in JavaScript]]></title><description><![CDATA[In JavaScript you can group multiple items that are related to each other in a single array, but what if those items has multiple properties? let's take a real life example.
Suppose you are holding a ]]></description><link>https://blog.shyamhz.dev/understanding-objects-in-javascript</link><guid isPermaLink="true">https://blog.shyamhz.dev/understanding-objects-in-javascript</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[javascript objects]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 15 Mar 2026 16:31:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/619bc8a0-b440-4231-a4a7-0893e5f902aa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In JavaScript you can group multiple items that are related to each other in a single array, but what if those items has multiple properties? let's take a real life example.</p>
<p>Suppose you are holding a party at your house and you need to properly store all the items that needs to be bought and their amount and maybe a maximum budget for them. Let's try doing that using arrays..</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/4bcbf778-e53b-460a-8701-b9a80863dc1b.png" alt="" style="display:block;margin:0 auto" />

<p>Do you see the problem? if you need to store more than 5 or 10 attributes then this method of storing becomes very cumbersome and messy. Then what is solution?  </p>
<p>To escape this problem JavaScript allows us to create a customized data type that stores <code>key-value</code> pairs .. these datatypes are known as <code>Objects</code> in JavaScript.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/deaf0a76-e08c-4f67-9f5a-8367d00f9c82.png" alt="" style="display:block;margin:0 auto" />

<p><code>itemList</code> is an array of objects.</p>
<p>This datatype helps us store multiple attributes or related information in on single variable as a collection of <code>key-value</code> pairs.  </p>
<p>Now let's see what are the ways we can create objects in JavaScript.</p>
<h2>Creating Objects</h2>
<p>There are many ways to create a object in JS.. we will see most commonly used ones and you will be able to create objects easily in these ways.</p>
<h3>Literals</h3>
<p>You can create an Object literally like this</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/b109d600-999a-4684-968a-9d3c90f9a19f.png" alt="" style="display:block;margin:0 auto" />

<h3>Constructors</h3>
<p>You can also create an Object using the Object constructor.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/8c4a9d01-f63b-4cfa-85f3-22eadeea8f20.png" alt="" style="display:block;margin:0 auto" />

<h2>Accessing <code>Objects</code></h2>
<p>You can access any <code>Object</code> in mainly two ways</p>
<ul>
<li><code>Dot</code> notation</li>
</ul>
<p>In this way you can use <code>.</code> to access Object keys-value pairs.</p>
<p>you need to write first object name and then key name of that object separated by a <code>dot</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/1821d20c-1669-476b-80ff-62c05cae79f8.png" alt="" style="display:block;margin:0 auto" />

<p>Another way to access an object value is using brackets <code>[</code> <code>]</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/744c9f7b-6309-4ba6-a3fa-8f7f79612222.png" alt="" style="display:block;margin:0 auto" />

<p>This way of accessing object items are handy because you can use any string as a key in that case.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/a2957a25-33ef-480b-a4c2-1e6ecc9bcf9d.png" alt="" style="display:block;margin:0 auto" />

<h2>Updating properties</h2>
<p>Each key value pair is also known as property of the object. These properties can be easily updated using the very same way of accessing them.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/3d4045f6-48f4-4f19-9a3f-51d511df7d53.png" alt="" style="display:block;margin:0 auto" />

<p>you can also use the dot notation as well there is not right or wrong here, juts be careful in case of strings with space like <code>"unique key"</code> .. those values cannot be used as keys in <code>dot notation</code> .</p>
<h2>Adding and deleting properties</h2>
<p>In Objects there are more than one ways to add and delete properties. Let's see them one by one.</p>
<h3>Adding properties</h3>
<p>You can simply use a dot notation or use brackets to add a new property.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/892950d2-730b-4238-92eb-cf9123f2d03a.png" alt="" style="display:block;margin:0 auto" />

<p>or you can use <strong>Object.assign()</strong> to add a new property as a key-value pair.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/121ea76a-2bdc-4cd2-b352-e7c5ba4c4c47.png" alt="" style="display:block;margin:0 auto" />

<h3>Deleting properties</h3>
<p>You can use <code>delete</code> operator to delete a key-value pair or a property from the object.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/ca378272-6905-4754-9c03-c96d08c1b9da.png" alt="" style="display:block;margin:0 auto" />

<h2>Looping over Object keys</h2>
<p>There are more than one way to loop over object keys</p>
<h3>for...in</h3>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/71c87bc5-5297-4cf3-9b08-6967ef9605da.png" alt="" style="display:block;margin:0 auto" />

<p>This image is self explanatory but simply said you can use <code>for ... in</code> loop to iterate over Object keys to access each property one after another.</p>
<h3><code>Object.keys()</code> method</h3>
<p>Object.keys() method return an array of all the property keys of the object passed as a values to the keys() method.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/9a43aa80-f310-4c7c-8a8d-0595a86b843e.png" alt="" style="display:block;margin:0 auto" />

<h2>Conclusion</h2>
<p>This was a brief and very basic overview on <code>Objects</code> in JavaScript hopefully now you understand the very basics of JavaScript and how to use them , how to create, update and delete object properties and how to iterate over Object keys.</p>
]]></content:encoded></item><item><title><![CDATA[Array Methods You Must Know]]></title><description><![CDATA[In the last article in the series we learnt what Arrays are in JavaScript why we need them and how we can create , update and iterate them.
In this article we will learn about some commonly used and v]]></description><link>https://blog.shyamhz.dev/array-methods-you-must-know</link><guid isPermaLink="true">https://blog.shyamhz.dev/array-methods-you-must-know</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[javascript array methods]]></category><category><![CDATA[javascript arrays]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 15 Mar 2026 15:15:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/e62b8922-9ebb-450b-8d7b-2e032096280a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the last article in the series we learnt what <code>Array</code>s are in JavaScript why we need them and how we can create , update and iterate them.</p>
<p>In this article we will learn about some commonly used and very useful methods that come attached with an <code>Array</code> in JavaScript.</p>
<h2>Array methods</h2>
<p><code>Array</code> methods or functions are part of a set of properties of any Array() you create in JavaScript. These methods gives you control and ability over any particular array to access, manipulate, transform, update and make other modifications on it.</p>
<p>Let's one by one see what these methods or functions are and how to use them</p>
<h3><code>push()</code> and <code>pop()</code></h3>
<p>Both of these methods work at the very end of an Array on which they are called, we will see in moment how, these methods adds and deletes an element from the end of an array respectively.</p>
<p><strong>push()</strong> method:</p>
<p>This method takes a single or more parameters or values that need to be added into the array.</p>
<ul>
<li><p>It takes one or more values.</p>
</li>
<li><p>Adds the passed values into the array</p>
</li>
<li><p>return new length of the array after adding the element into the array.</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/1318b301-feeb-4cb2-ac80-efa778049206.png" alt="" style="display:block;margin:0 auto" />

<p><strong>pop()</strong> method:</p>
<p>This method deletes the last element from the array and returns it upon being called on any particular array.</p>
<ul>
<li><p>It does not take any value as input</p>
</li>
<li><p>Removes the last element and returns it</p>
</li>
<li><p>If the array was already empty it returns <code>undefined</code></p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/46b0a1d7-3ca0-4c1d-9cfc-7adaf0ea4581.png" alt="" style="display:block;margin:0 auto" />

<h3><code>shift()</code> and <code>unshift()</code></h3>
<p>These methods remove and add elements from beginning of any array respectively.</p>
<p><strong>shift()</strong> method:</p>
<p>This works on the beginning of the array and removes the first elements, you can also think of it like this method shifts the array elements to the left without preserving the first element.</p>
<ul>
<li><p>Does not take any input</p>
</li>
<li><p>Removes left most or first element and returns it.</p>
</li>
<li><p>If array is empty it returns <code>undefined</code></p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/8941ab8a-2da7-4e19-9603-ccce677d93bb.png" alt="" style="display:block;margin:0 auto" />

<p><strong>unshift()</strong> method:</p>
<p>This method is exact same as <strong>push()</strong> method but instead of in the end it adds elements to the beginning of the array.</p>
<ul>
<li><p>Takes one or more values to be added into the array.</p>
</li>
<li><p>Returns the new length after adding the new items.</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/163c3400-0be5-4214-b56a-905d183b536e.png" alt="" style="display:block;margin:0 auto" />

<h2><code>map()</code> method</h2>
<p>This method takes a method or function as a parameter and changes or updates every element and makes a new array with those updated values, it does not change the original array or any of it's elements.</p>
<ul>
<li><p>Takes a function as an input.</p>
</li>
<li><p>Changes or modifies every value based on the passed function</p>
</li>
<li><p>Returns new array with the new values</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/e7cd2894-824c-4cc0-8ef7-ef29da4e5b66.png" alt="" style="display:block;margin:0 auto" />

<h2><code>filter()</code> method</h2>
<p>This method also returns a new array , this method takes a method and if the element passed in the method results in a truthy ( <code>true</code> ) value, then this method adds the element in the new array or it skips it.</p>
<ul>
<li><p>Takes a function as an input.</p>
</li>
<li><p>Adds it to a new array if given condition is true</p>
</li>
<li><p>returns the newly created array.</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/8afc7dce-ffc9-499e-b1ce-0c27a5959cd3.png" alt="" style="display:block;margin:0 auto" />

<h2><code>reduce()</code> method</h2>
<p>This method takes a function too , it takes two parameters, first one is a function and second one is an optional value called <code>initial value</code>.</p>
<p>The first parameter function, further takes two parameters and.. first one is a value that was returned by previous call of the method, second is current element of the array.</p>
<p><strong>reduce()</strong> method returns the final value of the first parameter passed to the method that was itself passed as first parameter inside reduce().</p>
<p>See and example:</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/db870308-c6a9-4471-ab78-8ab755089ac9.png" alt="" style="display:block;margin:0 auto" />

<h2><code>forEach()</code> method</h2>
<p>This method also takes a function and passes every element of the array in that function one by one.</p>
<p><code>forEach()</code> does not return anything</p>
<h2>Conclusion</h2>
<p>These are the methods that are most commonly used with arrays inside JavaScript and most of the work that you need to do in a typical JavaScript program can be done using these methods or functions.</p>
]]></content:encoded></item><item><title><![CDATA[JavaScript Arrays 101]]></title><description><![CDATA[We learnt already how to declare variables and constants and store values in JavaScript in first blog of our JavaScript Introduction Series, but what if we need to group values together or if we want ]]></description><link>https://blog.shyamhz.dev/javascript-arrays-101</link><guid isPermaLink="true">https://blog.shyamhz.dev/javascript-arrays-101</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[WebDevCohort2026]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[javascript array]]></category><category><![CDATA[javascript arrays]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 15 Mar 2026 13:48:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/c5c76ebb-a340-4e6e-9bf2-b03277daf5e9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We learnt already how to declare variables and constants and store values in JavaScript in <a href="https://blog.shyamhz.dev/understanding-variables-and-data-types-in-javascript">first blog</a> of our <a href="https://blog.shyamhz.dev/series/javascript-primer">JavaScript Introduction Series</a>, but what if we need to group values together or if we want create some sort of list or collection of some sort how do do that?</p>
<p>One answer can be declaring multiple variables of similar names, for example check the code snippet below :</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/1351a58d-6945-4e76-a4cb-10fcc2b2e009.png" alt="" style="display:block;margin:0 auto" />

<p>But there are multiple problems with this method of collection, can you spot them?</p>
<ul>
<li><p>There is a lack of obvious cohesiveness , at one quick glance one might not realize this is a collection.</p>
</li>
<li><p>we need to repeatedly declare a new variable in new line again and again, which becomes repetitive and extra time consuming.</p>
</li>
</ul>
<p>Also think what if it was not just a personal favorite fruit list, what if the requirements was to store thousands of usernames? or other kind of real data? That would be impossible to create variable for every single one of them by hand.</p>
<h2>Arrays</h2>
<p>To solve that exact set of issues or problems, JavaScript provides us with a datatype called <code>Array</code> . This data type enables us to store multiple items that are related together in a same collection under one variable name at the same time.</p>
<p>Let's understand it with an example</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/ad4d6f75-4d33-4ede-876b-9ed54660f57d.png" alt="" style="display:block;margin:0 auto" />

<p>Not only this gives a intuitiveness and a better readability, but also in a single variable you can store multiple values. How nice that is!<br />Not only these arrays can scale to millions or even higher but also you can very easily read, write and update values in the Array.</p>
<h2>Create an Array</h2>
<p>There are more than one ways to create Arrays in JavaScript, but to not overwhelm you with all the ways you can create an <code>Array</code> let's learn the most used and intuitive ones.</p>
<h3>Literal</h3>
<p>The most literal way to declare and array as you saw already above is to use brackets or <code>[</code> sign.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/7b71f9bc-f65d-4f64-80e9-22bfa46b5846.png" alt="" style="display:block;margin:0 auto" />

<h3>Constructor</h3>
<p>Another way to create arrays in JavaScript is to use Array() constructor in JavaScript.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/9a08432b-ad67-4724-b335-5d67d04b6738.png" alt="" style="display:block;margin:0 auto" />

<h2>Access array elements</h2>
<p>The values we store in an <code>Array</code> is also known as <code>elements</code> of the array. These elements can be accessed using index values. Let's see what that means</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/e1ab6d88-b0dd-4def-bdf8-3f9f0cdad3fc.png" alt="" style="display:block;margin:0 auto" />

<p>First you write the name of the <code>Array</code> variable then immediately after that the index of the element you want to use within <code>[</code> brackets <code>]</code>.</p>
<p>The index of the elements inside an array always start from <code>0</code> and it is a convention and the index change in increasing order like the figure shown below.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/64030765-3eef-401f-ba14-dd45999ecfd1.png" alt="" style="display:block;margin:0 auto" />

<h2>Update <code>Array</code> elements</h2>
<p>Using the index you can not only access the element but also update it's value.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/879333d2-f1c3-4713-88b8-1fae0a2e7779.png" alt="" style="display:block;margin:0 auto" />

<p>As you can see in the above example we updated the 4th element's value to be "Brown".</p>
<h2><code>Array length</code> Property</h2>
<p>When you create and <code>Array</code> in JavaScript you get a set of methods and properties attached to it. One of those properties is called <code>length</code> , and as you may have guessed .. this property tells us the <code>length of the Array</code> or simply said the number of elements currently stored inside the array.</p>
<p>You can use it like following</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/03c76450-1f10-4106-89ef-36d948d1d801.png" alt="" style="display:block;margin:0 auto" />

<h2>Iterating the <code>Array</code></h2>
<p>You can go through every element of the array from start to end, using loops. There are multiple ways you can do so, let's see them one by one.</p>
<h3>For loop</h3>
<p>You can use a simple for loop to access all the elements of an array in order from beginning to the end like following:</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/bdba41c8-04d2-4bad-b02f-8ceca0377612.png" alt="" style="display:block;margin:0 auto" />

<h3>ForEach loop</h3>
<p>This is a method that comes with the array itself, when you create an <code>Array</code> in JavaScript you by default get this method attached to it. This method expects a function as a parameter and performs the steps inside that function on every element of the <code>Array</code> one by one.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/5b436007-1642-444f-83ee-d354f2510db4.png" alt="" style="display:block;margin:0 auto" />

<h3>For...of loop</h3>
<p>This loop takes each and every element of an array and performs some operation on them one by one.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/98fc2151-44c5-4a5b-b9ef-fd4bcbaeb371.png" alt="" style="display:block;margin:0 auto" />

<p>These were all the basic ways how we can simply loop over an <code>Array</code> and perform some operation on every item of the <code>Array</code> .</p>
<h2>Conclusion</h2>
<p>So this is all the basics of <code>Array</code> in JavaScript you need to know for know and hopefully now you can confidently create and use Arrays in JavaScript.</p>
]]></content:encoded></item><item><title><![CDATA[JavaScript Operators: The Basics You Need to Know]]></title><description><![CDATA[In previous blog in our JavaScript Introduction Series we learnt about variable declaration and basics of data types in JavaScript. There we learnt that we can store various values of datatypes like S]]></description><link>https://blog.shyamhz.dev/javascript-operators-the-basics-you-need-to-know</link><guid isPermaLink="true">https://blog.shyamhz.dev/javascript-operators-the-basics-you-need-to-know</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[javascript operators]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[WebDevCohort2026]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 15 Mar 2026 12:50:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/61005458-25e0-4b13-a4ee-b20a8d3b8a03.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In previous blog in our <a href="https://blog.shyamhz.dev/series/javascript-primer">JavaScript Introduction Series</a> we learnt about variable declaration and basics of data types in JavaScript. There we learnt that we can store various values of datatypes like <code>String</code> and <code>Number</code> inside a variable.</p>
<p>In this blog we will learn how to perform operations on those values inside JavaScript. To do that JavaScript provides us some common operations that we can do on values directly or while stored inside variables and transform them as we see fit.</p>
<h2>Need of Operators</h2>
<p>Suppose you want to create a program that adds two numbers ... How are you going to do that? How do you normally add two numbers? using <code>+</code> or <code>addition</code> operation correct? Similarly, we can perform additions and other mathematical operation like <code>5 + 10 = 15</code> inside our JavaScript program itself.</p>
<p>In JavaScript not only just mathematical but also other kinds of operations can be done too. Let's learn about them in orderly manner.</p>
<h2>Arithmetic Operators</h2>
<p>Arithmetic or mathematical operation is very common type of operation we can perform on values or variables inside JavaScript.</p>
<p>First we have,</p>
<h3><strong>Addition</strong> operation <code>+</code></h3>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/74f25bc3-fe8d-47a3-bd88-77e9589ee338.png" alt="" style="display:block;margin:0 auto" />

<p>As you can see it is very simple to perform an operation in JavaScript, you need to provide the appropriate <code>operator</code> (the symbol of operation to be performed, here it is <code>+</code> of addition operator) and the <code>operands</code> or the values on which the operation to be performed, here <code>5 and 10</code> are our operands.</p>
<p>console.log() is a function that simply prints the output of the value provided which in this case is output of the <code>+</code> operation.</p>
<h3>Subtraction operation <code>-</code></h3>
<p>For subtraction we use <code>-</code> operator.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/2e7ecef2-2e7c-46dc-a1f2-dc23abd2927e.png" alt="" style="display:block;margin:0 auto" />

<h3>Multiplication operator <code>*</code></h3>
<p>Multiplication operator is denoted using <code>*</code> symbol.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/591741a0-c8b2-43e3-9a52-bd43d9aca281.png" alt="" style="display:block;margin:0 auto" />

<h3>Division operator <code>/</code></h3>
<p>Division operator is denoted as a forward slash symbol.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/4d80010a-9b41-42e7-9926-a8de4413abd7.png" alt="" style="display:block;margin:0 auto" />

<h3>Remainder operator <code>%</code></h3>
<p>To find remainder of a division operator we use this operator</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/06a502c0-d332-425d-990b-27bd0ba6c1e3.png" alt="" style="display:block;margin:0 auto" />

<h2>Comparison operators</h2>
<p>Sometimes you need to compare two values and judge it's output for that we use comparison operators. These operators return either <code>true</code> or <code>false</code> as values. These values are known as <code>boolean</code> datatype.</p>
<h3>Equal operator <code>==</code></h3>
<p>This operator returns true if the both operands are of same value.</p>
<p>Equal operator does not care about the data type of the the operands involved, as long as their magnitude or values are identical.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/cae592e8-c6cd-40fd-9371-2318c9ed6205.png" alt="" style="display:block;margin:0 auto" />

<h3>Not-equal operator</h3>
<p>This operator returns true if both operands are different</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/1cfae884-960c-4555-8d62-de6337dd8dda.png" alt="" style="display:block;margin:0 auto" />

<h3>Strict-equal operator</h3>
<p>This operator uses 3 <code>=</code> like <code>===</code> to equate two values and this operator cares about the datatype of the operands involved, it returns true only and only if both the value and datatype of both operands are same.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/7726fb00-da76-4251-b88a-1c17e1ac0ff5.png" alt="" style="display:block;margin:0 auto" />

<p>same like non strict not-equal strict not-equal operator also exist and it is datatype sensitive like strict equal. It is denoted using <code>!==</code></p>
<h3>Greater than operator <code>&gt;</code></h3>
<p>This operator checks if left operand is bigger than the right operand.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/e99e8b57-bdff-48e4-a5bc-b15ba820268f.png" alt="" style="display:block;margin:0 auto" />

<p>Also if you want you can check if a value is either <strong>same or greater than</strong> a another value using <em><strong>greater than equal operator</strong></em> <code>&gt;=</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/064e82f1-1d3d-4c1a-b205-a2d05a5feb65.png" alt="" style="display:block;margin:0 auto" />

<h3>Less than operator <code>&lt;</code></h3>
<p>This operator checks if left operand is smaller than the right operand.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/a0304c39-ef41-4294-9c68-8710df4ee11a.png" alt="" style="display:block;margin:0 auto" />

<p>also like <strong>greater than equal</strong> operator there is also <em><strong>less than equal</strong></em> operator <code>&lt;=</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/20c3fb48-15c0-45f5-9272-a1d010238a45.png" alt="" style="display:block;margin:0 auto" />

<h2>Logical operators</h2>
<p>Logical operators only work on boolean data types of values (e.g. <code>true</code> or <code>false</code> ) , the operands can be simple true or false value or another expression that results in true or false , like output of comparison operators.</p>
<h3>AND operator <code>&amp;&amp;</code></h3>
<h3>This operator can work on two or more operands at the same time, this operator results in <code>true</code> if and only if all the operands are true</h3>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/623e737a-ffde-4542-8bb2-79766084bf0a.png" alt="" style="display:block;margin:0 auto" />

<h3>Or operator <code>||</code></h3>
<p>Or operator can also take more than two operands and if even a single operand is true the result of the whole expression is true, if and only if all the operands are false the expression results in a false value.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/da0ae749-3f09-4366-b33a-b6898e9cb95a.png" alt="" style="display:block;margin:0 auto" />

<h3>Logical NOT operator <code>!</code></h3>
<p>This operator takes only one operand and flips it to the opposite value (e.g. true becomes false and vice versa)  </p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/80de1522-fbf3-48ae-bae7-84a556bdc772.png" alt="" style="display:block;margin:0 auto" />

<h2>Assignment operators</h2>
<p>Assignment operators work as short-hand for combining assignment operators with arithmetic operators. Most basic assignment operator is <code>=</code> which is called <code>assignment operator</code> .. it is used to assign a value to a variable or value of one variable to another.</p>
<h3>Addition assignment <code>+=</code></h3>
<p>This is same as combining a = a + b;<br />Remember the <em>left operand</em> has to be the same variable where the result of the whole expression will be stored, here in our case it is <code>a</code> variable.  </p>
<h3>Subtraction assignment <code>-=</code></h3>
<p>This is same as addition assignment but for subtraction operation.</p>
<p>In same way the <code>multiplication assignment *=</code> , <code>Division assignment /=</code> and <code>Remainder assignment %=</code> work.</p>
<h2>Conclusion</h2>
<p>These are the most commonly used operation in most cases in JavaScript, if you grasp the working of all the above mentioned operators you should have no issues in your day to day JavaScript programming.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Variables and Data Types in JavaScript]]></title><description><![CDATA[Containers
Programming world as virtual may it seem, more often than not derives it's inspiration from real world. Everything from how we think in programming to how we do the smallest possible action]]></description><link>https://blog.shyamhz.dev/understanding-variables-and-data-types-in-javascript</link><guid isPermaLink="true">https://blog.shyamhz.dev/understanding-variables-and-data-types-in-javascript</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[#javascript datatypes & variables]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[chaiaurcohort]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 15 Mar 2026 11:28:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/96e26643-a7cd-400b-ad77-95f364b4abea.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Containers</h2>
<p>Programming world as virtual may it seem, more often than not derives it's inspiration from real world. Everything from how we think in programming to how we do the smallest possible action mostly all of them are imitations of real-life actions.</p>
<p>For example, organizing things in your home. Be it a desk , bookshelf, Kitchen or simple pen-stands all of them are containers or designated spaces where you store or keep something specific that holder or container is made to hold.</p>
<p>you would not use a pen-stand to keep paper clips, nor would you use your desk drawer to keep your kitchen items like salt, spices or peppers. Because both the holder and the items have their own designated pair.</p>
<p>Similarly in programming you store values or information, they can be in text format or number format or mix of both or in some other special kind of arrangements. These places or holders for those values, just like real life, have their own predesignated "types".</p>
<p>For example you store text based information in on type of places, and number based values in other type of places. Let's see how it is done in real programming environment.  </p>
<h2>Variables</h2>
<p>Variables are places in memory allocated for your program from Random Access Memory (RAM) of your system. You can store texts, numbers or other kinds of customized types of data in raw format in the memory.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/d489d1a2-2525-4ecc-990a-fb395689fb36.png" alt="" style="display:block;margin:0 auto" />

<p>These variables have 'names' also known as identifiers that used to specify which exact memory location (variable) you want to use (read or write data from or into).</p>
<h2>World of JavaScript</h2>
<p>As any other programming language JavaScript provides us programmers multiple ways to declare variables and store whatever we want to store in there.</p>
<h3><code>var</code> variables</h3>
<p>First we will learn about var, var is nothing but a reserved word in JavaScript using which you can declare as below.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/b2b9c17a-8d7c-492e-a281-a8251a3a9a96.png" alt="" style="display:block;margin:0 auto" />

<p>Although once very popular , this method of declaring variables are no longer recommended and in production codebase it is even discouraged to use <code>var</code>. <code>var</code> has some confusing quirks like <code>use before declaration</code> and other issues that makes in not suitable for any serious work.</p>
<h3><code>let</code> variables</h3>
<p>Instead of <code>var</code> nowadays <code>let</code> is the more preferred method of declaring variables in JavaScript. <code>let</code> variables can be only used once they are declared and variables declared using this keyword does not has <code>surprising quirks</code> like variables created with <code>var</code> variables.</p>
<p>The syntax to declare a <code>let</code> variable is same as <code>var</code> , you just need to use <code>let</code> keyword like shown below.</p>
<p>One notable difference between <code>var</code> and <code>let</code> that you may like to know is that <code>var</code> lets you declare same variable again and again, which is invalid syntax in case of <code>let</code> .</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/034fadc0-d177-4d1b-ad39-76eb592e59f0.png" alt="" style="display:block;margin:0 auto" />

<p>But there might be situations where you do not want the value to change after you declare a variable, like imagine declaring Mathematical constants! For example value of PI which is <code>3.1415....</code> . In that case you can use <code>const</code> keyword to declare constants.</p>
<h3><code>const</code> variables</h3>
<p><code>const</code> variables are also known as constants .. once you declare a variable using <code>const</code> keyword that variable will never again be overwritten. If you try to overwrite a <code>const</code> variable it will throw you an error at <code>runtime</code>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/b157cbf5-afe1-46be-9716-b32cf94647d3.png" alt="" style="display:block;margin:0 auto" />

<p>Here is a small summary of all the different types of variable declaring keywords and methods of JavaScript.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/73e1301e-d348-4d11-9de6-9e47b946d8f1.png" alt="" style="display:block;margin:0 auto" />

<h2>Data Types</h2>
<p>Before you go and start creating variable in JavaScript with this newly acquired knowledge, you need to know one more thing. Each variable has it's own type. What that means now?  </p>
<p>It's nothing complicated all that means is each variable has a property that tracks what kind of value can stored in that variable.  </p>
<p>For examples names or texts are stored under <code>string</code> type variables. Numbers and values (<code>Integers and Decimal</code> values) are stored in <code>Number</code> type variables.</p>
<img src="https://cdn.hashnode.com/uploads/covers/695021914b3378c025dc03ce/5473b907-830e-4254-b303-d23d264deddd.png" alt="" style="display:block;margin:0 auto" />

<p><code>Strings</code> or texts are written withing double quotes <code>"</code> , and <code>Number</code> are we written as it is.</p>
<p>There are more types of data you can store in a variable in JavaScript like <code>Array</code> <code>Object</code> etc.. but for now you should just need to understand data has a type and it matters.</p>
<p>Think , a variable named address should store an address right? Not a contact number!! And although JavaScript allows you to change type of a variable that is not at all recommended practice in real world Software Development and is considered as a bug or undesired behavior.</p>
<h2>Conclusion</h2>
<p>This was a basic introduction to Variables and Data types in JavaScript. Hopefully it was simple and intuitive enough for you to grasp what are variables and datatypes and basics of how do we handle them in JavaScript.</p>
]]></content:encoded></item><item><title><![CDATA[Emmet for HTML: A Beginner’s Guide to Writing Faster Markup]]></title><description><![CDATA[You cannot escape HTML but you can escape the tedious repetition of it. Didn’t get what that means? You will, shortly. If you are beginner or do not know what Emmet is you may have faced a very stingily recurring issue while writing HTML is manually ...]]></description><link>https://blog.shyamhz.dev/emmet</link><guid isPermaLink="true">https://blog.shyamhz.dev/emmet</guid><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Emmet]]></category><category><![CDATA[Emmet for HTML: A Beginner’s Guide to Writing Faster Markup]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 01 Feb 2026 18:16:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769963286084/04c086b8-37b0-4d32-9316-ede376aebf6f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You cannot escape HTML but you can escape the tedious repetition of it. Didn’t get what that means? You will, shortly. If you are beginner or do not know what Emmet is you may have faced a very stingily recurring issue while writing HTML is manually writing all the nesting and deep semantic structure of your webpage.</p>
<p>Also if you have overall similar structure with few minor differences then changing them one by one is also a chore.  </p>
<p>Your editor may suggest and write the tag for you or at most change opening closing tag name but if you are tired of the repeating same opening closing tags again and again, Emmet will totally change your life and make writing HTML fun again!</p>
<h2 id="heading-emmet-as-a-shortcut">Emmet as a shortcut</h2>
<p>To be able to visualize effectiveness of Emmet you need at least to items to make. You will understand what that means.</p>
<pre><code class="lang-xml"> h1+p
</code></pre>
<p>This means create two sibling elements. <code>+</code> is used to denote relationship as “siblings”.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<p>There is no limit to how many siblings you can create at the same time but , whole point of Emmet was to eliminate repeatition not write <code>h1+h1+h1</code> 10 or 100 times.</p>
<p>For that we have very interesting shortcut with <code>*</code> symbol.</p>
<pre><code class="lang-xml">h1*5
</code></pre>
<p>This will create 5 <code>h1</code> elements as siblings</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span> 
<span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span> 
<span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span> 
<span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
</code></pre>
<p>This can be any number.</p>
<p>Next thing that takes more time is nesting, you can create nested structure like below.</p>
<pre><code class="lang-xml">ul&gt;li+li
</code></pre>
<p>Here <code>&gt;</code> sign sets the relationship as Parent and child, left element is parent and right one is the child. You can also apply the <code>*</code> shortcut here using <code>(</code> Parenthesis <code>)</code> .</p>
<pre><code class="lang-xml">ul&gt;(li*2)
</code></pre>
<p>This will create nested structure.</p>
<pre><code class="lang-xml"><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">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>
</code></pre>
<p>you can also add id and class, for class you add id with <code>#</code> and class with <code>.</code> .</p>
<pre><code class="lang-xml">nav#navbar
</code></pre>
<p>Above one will create <code>&lt;nav id=”navbar”&gt;&lt;/nav&gt;</code> .</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>You can mix and match on how you create your elements. You can also mix match different Emmet shortcuts. There is a huge amount of possible Emmet shortcuts that cannot be mentioned in a single blog. if you are curious you can visit <a target="_blank" href="https://docs.emmet.io/cheat-sheet/">Emmet Docs Cheatsheet</a> to read more on your own and explore and have fun.</p>
<p>Hopefully after this the joy of Front-end will come back to you.</p>
]]></content:encoded></item><item><title><![CDATA[CSS Selectors 101: Targeting Elements with Precision]]></title><description><![CDATA[If you write CSS you already know what CSS selectors are and use them but have you ever thought why there are so many options? why there are more than one way to do things? Today we will understand that and learn what purpose each selectors serve and...]]></description><link>https://blog.shyamhz.dev/css-selectors-101</link><guid isPermaLink="true">https://blog.shyamhz.dev/css-selectors-101</guid><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[css selectors]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 01 Feb 2026 16:25:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769963042417/910e8a9c-f31c-448f-bae8-db2a78ad0787.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you write CSS you already know what CSS selectors are and use them but have you ever thought why there are so many options? why there are more than one way to do things? Today we will understand that and learn what purpose each selectors serve and what problems they solve.</p>
<h2 id="heading-css-selectors">CSS Selectors</h2>
<h3 id="heading-element-selectors">Element Selectors</h3>
<p>First and most common CSS selector is element selector, as you know this is the name of the tag or name of the element like <code>h1</code> , <code>p</code> , <code>table</code> , <code>body</code> etc.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">h1</span> {
    <span class="hljs-attribute">color</span>: red;
}
</code></pre>
<p>this sets the color of all h1 elements in the page to red.</p>
<h3 id="heading-class-selectors">Class selectors</h3>
<p>Now if you want to select a subset of the elements, simply you do not want to select all the <code>h1</code> tags but only select few then you use class selector.</p>
<p>For that first you need to select all the elements that you want to select by adding a class attribute to them.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/GgqxXBr">https://codepen.io/shyamendrahazracodes/pen/GgqxXBr</a></div>
<p> </p>
<h3 id="heading-id-selectors">ID Selectors</h3>
<p>Now if you want to select only a single particular element you can target them with an unique id. IDs are always unique and used to target a specific element uniquely. This selector is to select one single element.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/OPXvoqx">https://codepen.io/shyamendrahazracodes/pen/OPXvoqx</a></div>
<p> </p>
<h3 id="heading-group-selectors">Group Selectors</h3>
<p>Group selectors are used when you want to give different elements similar properties, for example if you want to style a heading and paragraph similarly then you can group them together.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/qENoJdb">https://codepen.io/shyamendrahazracodes/pen/qENoJdb</a></div>
<p> </p>
<h3 id="heading-descendant-selectors">Descendant Selectors</h3>
<p>Descendant selectors are used when you need to target or specify particular child of a particular type of elements only. For example you can select all the <code>li</code> under unordered list <code>ul</code> only and not all <code>li</code> items</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/azZYRqZ">https://codepen.io/shyamendrahazracodes/pen/azZYRqZ</a></div>
<p> </p>
<h3 id="heading-universal-selector">Universal selector (*)</h3>
<p>Universal Selector is the CSS selector with highest matching and least specificity. It is used to select and target literally every element.</p>
<h2 id="heading-specificity">Specificity</h2>
<p>In CSS the more specific selector you use the highest priority they get, and specificity always override Cascading nature depending on how you use the specificity. If you want to force override a property you can use <code>!important</code> property in any property like below.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> {
<span class="hljs-attribute">color </span>: red <span class="hljs-meta">!important</span>;
}
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Hopefully you now understand how each selectors differ and when to use which one. You should be able to understand how different selectors differ from each other.</p>
]]></content:encoded></item><item><title><![CDATA[How a Browser Works: A Beginner-Friendly Guide to Browser Internals]]></title><description><![CDATA[You are reading this article on a browser right now, either you pasted this linked in the URL bar or you clicked it somewhere this page opened in your browser. Do you ever think that how browser converts a link or URL (Uniform Resource Locator) into ...]]></description><link>https://blog.shyamhz.dev/browser-internals</link><guid isPermaLink="true">https://blog.shyamhz.dev/browser-internals</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Browsers]]></category><category><![CDATA[Browser Internals]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sun, 01 Feb 2026 14:34:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769956270939/cea7f3e4-00ef-4957-95fb-9c11b0663c1f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You are reading this article on a browser right now, either you pasted this linked in the URL bar or you clicked it somewhere this page opened in your browser. Do you ever think that how browser converts a link or URL (Uniform Resource Locator) into a functioning responsive web-page?</p>
<p>let’s understand with a simple story.</p>
<h2 id="heading-url-to-web-page">URL to Web page</h2>
<p>First you need a general idea about the different components of the browser and how they work together.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769955429885/eae439a6-fcc9-452f-8c36-b0effed3c433.png" alt class="image--center mx-auto" /></p>
<p><strong>User Interface::</strong> First comes the UI or the User interface, this UI includes your search bar, bookmark icon maybe , settings menu etc. you basically get the idea.</p>
<p><strong>Browser Engine::</strong> Then comes Browser engine if you have used arrow buttons next to your URL bar you know you can move between pages that you visited one after another back and forth, for example if you clicked on a link from a google search you can use arrows (usually on top left) to go back forth between the pages this is part of browsing, also you can see your browsing history, customize rules and security and other browsing related things all of these are handled by the Browsing engine.</p>
<p><strong>Rendering Engine::</strong> Next comes Rendering Engine, a server does not send a button or a paragraph or a rendered image or the page you see.. the server returns raw HTML, CSS, those HTML CSS files are parsed, then the Parsed content are kept in <strong><em>Content Sink.</em></strong> You can understand parsing as a making meaning of an statement. Like who is the speaker, what is the subject and what is being told about the subject. Same with the HTML and CSS content they are parsed to form a usable representation that can be turned into a web page.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769955469885/aa0fb806-a95f-4e79-a3fc-457013941c26.png" alt class="image--center mx-auto" /></p>
<p>Then the parsed data in the Content Sink is used to form Document Object Model and CSS Object Model. These are nothing but a Top to bottom internal structure representation of how the web page will look like when it is finally rendered on the screen (Inside the Browser). This Object models are then used to construct frame by frame rendering of the web page.</p>
<p><strong>JavaScript Engine::</strong> Some websites or web apps also include JavaScript, this JavaScript parsing is handled by JS engine. One of the popular example of a JS engine is V8 engine. This parsed JS is then binded with the DOM via the Rendering engine because that owns the DOM construction.</p>
<p><strong>UI engine::</strong> User engine is what controls the Browsers interface, it uses underlying hardware render the browser itself in the screen and catch user inputs, when the the web page needs some input it goes through the browser and those inputs are captured by the UI engine. Changes in the browser UI like opening and closing tabs, opening new windows or settings menu etc are handled by UI engine. UI engine interacts with the Rendering Engine to send user inputs to the page and other stuff.</p>
<p><strong>Networking::</strong> This component handles the networking related things like sending and accepting HTTP requests or fetching something from an URL, like actually loading image from a live URL. This part of the browser is actually responsible to fetch the HTML, CSS, JavaScript files and other assets from the server to your browser.</p>
<p><strong>Disk API::</strong> Next comes Disk API, this API enables browser to talk to the actual storage device via the Operating System and store and access all the necessary files and information including downloads and uploads. All the Local storage and other API and components like JS engine, Networking all use Disk API to talk to the actual storage hardware via OS.</p>
<h2 id="heading-browser-engine-vs-rendering-engine">Browser Engine vs Rendering Engine</h2>
<p>If you have understood the part you already know Browser Engine only related to handling the browsing experience for you and the Rendering Engine handles converting raw HTML, CSS, JavaScript into a working functional and responsive web page that you can interact with.<br />Both are different components with different concerns not to be confused with each other.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>So hopefully you understand that browser is not a one singe piece of huge system that does it all, it is a combination of multiple smaller sub-systems that work in co-ordination and sync to prove users a seamless and smooth experience of surfing the internet.</p>
<p>I hope this was simple enough for you to internalize. Thank you for reading.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding HTML Tags and Elements]]></title><description><![CDATA[HTML is the skeleton or core structure of every website on the internet. Without HTML there are not website or web app. HTML or Hyper Text Markup Language is the language of the Internet to transfer useful, structured and semantic information.
Today ...]]></description><link>https://blog.shyamhz.dev/understanding-html-tags-and-elements</link><guid isPermaLink="true">https://blog.shyamhz.dev/understanding-html-tags-and-elements</guid><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[HTML5]]></category><category><![CDATA[HTML]]></category><category><![CDATA[HTML tags ]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Fri, 30 Jan 2026 15:26:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769785881430/e08fed43-0713-4d3e-b475-a5e4611959a3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>HTML is the skeleton or core structure of every website on the internet. Without HTML there are not website or web app. HTML or <strong>Hyper Text Markup Language</strong> is the language of the Internet to transfer useful, structured and semantic information.</p>
<p>Today we will understand what it is and how you can write your own HTML webpage.</p>
<h2 id="heading-html-tags">HTML tags</h2>
<p>Tags are little smaller chunks of an HTML that are written in specific order to make up the whole HTML document. Each and every tag has it’s own individual purpose. Each tag is a wrapper or a box to contain some content or information. Depending how you want to convey or present an information on the screen you chose and appropriate tag for it.</p>
<h2 id="heading-tag-and-element">Tag and Element</h2>
<p>If Tag is a wrapper around the content then the whole content wrapped in a tag with all the information and content as a whole is called an Element. A tag is an available wrapper and an element is a content wrapped in a particular tag.</p>
<h2 id="heading-common-tags">Common Tags</h2>
<p>Below is some of the most commonly used simple tags.</p>
<h3 id="heading-body">body</h3>
<p>A body tag is used group all the content of an HTML document. All the content elements are written inside the <code>&lt;body&gt;</code> tag.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/PwzQdKj">https://codepen.io/shyamendrahazracodes/pen/PwzQdKj</a></div>
<p> </p>
<h3 id="heading-h1-to-h6">h1 to h6</h3>
<p><code>h1</code> tag is used to write a heading. H1 is the most biggest available heading tag by default. And from H1 to H6 you can go largest to smallest heading in order. An example of an <code>h1</code> tag is below.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/yyJvxgq">https://codepen.io/shyamendrahazracodes/pen/yyJvxgq</a></div>
<p> </p>
<h3 id="heading-p-tag">p tag</h3>
<p>P tag is used to create paragraph elements in an HTML documents. it is usually used write large chunk of words in a single block.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/LEZQJLE">https://codepen.io/shyamendrahazracodes/pen/LEZQJLE</a></div>
<p> </p>
<h3 id="heading-a-tag">a tag</h3>
<p>Anchor tag or <code>a</code> is used to hyperlink or simply connect our HTML document to other websites or links. It is used for navigation from one page to another.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/GgqQXxm">https://codepen.io/shyamendrahazracodes/pen/GgqQXxm</a></div>
<p> </p>
<h3 id="heading-div-tag">div tag</h3>
<p>Div tag is used to group multiple element together inside a single structure. This is used to show content in different segments and parts inside you HTML document.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/LEZQJQp">https://codepen.io/shyamendrahazracodes/pen/LEZQJQp</a></div>
<p> </p>
<h3 id="heading-hr-tag">hr tag</h3>
<p><code>hr</code> tag also known as <strong>horizontal rule</strong> tag and used to create a horizontal line across the HTML body,</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/MYeQqPx">https://codepen.io/shyamendrahazracodes/pen/MYeQqPx</a></div>
<p> </p>
<h3 id="heading-br-tag">br tag</h3>
<p><code>br</code> tag is know as <strong>line break</strong> tag this tag is used to put line breaks. This tag can be used to put breaks between different elements or different contents of an element.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/shyamendrahazracodes/pen/qENxMLZ">https://codepen.io/shyamendrahazracodes/pen/qENxMLZ</a></div>
<p> </p>
<h3 id="heading-paired-tags-and-self-closing-tags">Paired tags and self closing tags</h3>
<p>You may have noticed that some tags like body, h1, p, div are paired they have a opening and closing pairs like &lt;h1&gt; and &lt;/h1&gt; , essentially same tag name repeated with a <code>/</code> . But some tags like <code>hr</code> <code>br</code> are self closing , simply they are written once and in the first <code>&lt;</code> and <code>&gt;</code> they are terminated with an <code>/</code> .</p>
<h2 id="heading-block-level-and-inline-elements">Block level and Inline elements</h2>
<p>The element’s like <code>div</code> and <code>p</code> they contain multiple blocks or elements , like paragraph tag can contain multiple chunks or text or div elements can contains multiple other elements including div elements. So elements made of them are known as block level elements and they take all the available space.</p>
<p>And the other elements like <code>a</code> tag elements take only the space needed. These types of elements are knows as Inline elements.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This is not nearly close to all the available tags and elements available in HTML and are just a small subset. You may go ahead and read more about all the tags available, although that is not recommended. You may refer to <a target="_blank" href="https://developer.mozilla.org/en-US/">MDN docs</a> or <a target="_blank" href="https://www.w3schools.com/">w3schools</a> for reference.  </p>
<p>Hopefully now you understand basics of HTML and the tags and elements, difference between them, what are Inline and Block elements.</p>
]]></content:encoded></item><item><title><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></title><description><![CDATA[In previous blog we learnt about TCP and UDP protocols and how they relate to HTTP protocol. Today in this blog we are going to learn in details about TCP and how it ensures all the promises like accuracy, order, integrity are kept.As usual with simp...]]></description><link>https://blog.shyamhz.dev/tcp-working-3-way-handshake</link><guid isPermaLink="true">https://blog.shyamhz.dev/tcp-working-3-way-handshake</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[TCP]]></category><category><![CDATA[TCP Handshake]]></category><category><![CDATA[tcp-3-way-handshake]]></category><category><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Fri, 30 Jan 2026 15:08:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769785079592/df5c809a-8b04-471a-995f-2cbe59490eee.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In <a target="_blank" href="https://blog.shyamhz.dev/tcp-vs-udp">previous blog</a> we learnt about TCP and UDP protocols and how they relate to HTTP protocol. Today in this blog we are going to learn in details about TCP and how it ensures all the promises like accuracy, order, integrity are kept.<br />As usual with simple and beginner friendly language let’s understand how a TCP communication is reliable, accurate and safe.</p>
<h2 id="heading-what-is-tcp-and-its-need">What is TCP and it’s need</h2>
<p>TCP or Transmission Control Protocol is one of the most used Transmission protocol used acrossed the Internet. TCP ensures data sent in chunks or packets in the right order, to the correct destination in a reliable and safe manner.</p>
<p>TCP is needed because it solves some crucial problems, data is never send in a bulk size on the Internet, it is broken into multiple chunks with some extra meta data with it’s ordering info along with other additional data.<br />These packets may get lost or disarranged on the way or there might be some repetition or may get corrupted totally, to ensure data reaches In correct order, exactly once, to the correct place and accurately TCP protocol was created.</p>
<h2 id="heading-three-way-handshake">Three way handshake</h2>
<p>TCP protocol performs three steps to confirm it can reliably send data to the destination while maintaining all the safety , order and accuracy.</p>
<ul>
<li><p>First the sender sends a Synchronization or SYN message to the receiver.</p>
</li>
<li><p>Then if the receiver got the SYN message it sends a Synchronization Acknowledgement or SYN-ACK back to the sender.</p>
</li>
<li><p>And when the sender receives a SYN-ACK it returns a final Acknowledgement signal ACK to the receiver.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769785137720/3c9ae660-f3a5-42aa-8eb5-6a907d1a4aff.png" alt class="image--center mx-auto" /></p>
<p>This is what essentially known as the three-way-handshake because total of three transmission happens between the sender and the receiver before the actual transmission even starts.</p>
<h2 id="heading-actual-data-transfer">Actual data transfer</h2>
<p>Once the handshake is done finally the actual data transfer starts. Each data packet or chunk carries some additional meta data about it’s order and sequence. If receiver misses a packet or a packet it lost on the way receiver just asks the sender to send it again.</p>
<p>For each packet receiver sends acknowledgement to the sender so no repetition happens. And all the data is rearrange in proper order with help of the meta data.</p>
<h2 id="heading-closing-a-tcp-connection">Closing a TCP connection</h2>
<p>When data transfer is done the sender sends a <code>FIN</code> signal to the receiver telling it that “I am done sending data”. Then the receiver replies wit <code>ACK</code> for the senders <code>FIN</code> and sends it own <code>FIN</code> . After receiving sender’s <code>FIN</code> client sends back it’s <code>ACK</code> and that is how a TCP connection is terminated.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>TCP is the most safest and powerful transmission or transport protocol in terms of safety, reliability, integrity. And all of it’s magic lies in it’s <code>three-way-handshake</code> and a graceful termination of the connection.</p>
<p>So hopefully you now understand how TCP works behind the scenes to maintain a reliable and safe and accurate data transmission.</p>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[Today we are going to learn about TCP/IP and UDP protocols, what are their difference and how they relate with HTTP protocol. We will keep the discussion simple, beginner-friendly and to the point.  
TCP/IP and UDP
TCP/IP protocol
TCP/IP or commonly ...]]></description><link>https://blog.shyamhz.dev/tcp-vs-udp</link><guid isPermaLink="true">https://blog.shyamhz.dev/tcp-vs-udp</guid><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[TCP]]></category><category><![CDATA[tcp vs udp]]></category><category><![CDATA[UDP]]></category><category><![CDATA[tcp and http]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Fri, 30 Jan 2026 14:38:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769784096191/2d8090c8-d3f6-4cf3-903e-a3318cf17fe9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today we are going to learn about <code>TCP/IP</code> and <code>UDP</code> protocols, what are their difference and how they relate with HTTP protocol. We will keep the discussion simple, beginner-friendly and to the point.  </p>
<h2 id="heading-tcpip-and-udp">TCP/IP and UDP</h2>
<h3 id="heading-tcpip-protocol">TCP/IP protocol</h3>
<p>TCP/IP or commonly called as TCP protocol stands for Transmission Control Protocol. It is commonly know as a reliable and safe protocol among the two. When you want your data to reach safely, securely, without data loss and fully reliable way you choose TCP as the protocol.</p>
<p><strong>Key advantages:</strong></p>
<ul>
<li><p><strong>Reliability:</strong> TCP give you a guarantee that what you send is what will reach the destination, no matter what it will make sure the data is transferred with complete accuracy and integrity.</p>
</li>
<li><p><strong>Connectivity:</strong> TCP sets up a strong connection before it sends data to make sure the data can be transferred safely, accurately and completely.</p>
</li>
</ul>
<h3 id="heading-udp-protocol">UDP protocol</h3>
<p>UDP stands for User Datagram Protocol. UDP usually does not care about data loss, integrity or security of the data. UDP just send the data to the destination as fast as possible even at expense of loss of security and potential data loss. This protocol is used when you only care about speed of the communication and not about integrity.</p>
<p><strong>Key Advantages:</strong></p>
<ul>
<li><p><strong>Fast:</strong> The most notable point of UDP is it’s speed, once it know where the destination is it just sends data there no confirmation or order maintaining like TCP.</p>
</li>
<li><p><strong>Low latency</strong> : UDP being the faster one between the two protocol it is often preferred in low latency system where every millisecond matters e.g. specific parts of Fast trading systems or any live streaming systems.</p>
</li>
</ul>
<h2 id="heading-relationship-between-tcp-and-http">Relationship between TCP and HTTP</h2>
<p>You may think TCP and HTTP are both used to communicate between two receiving and sending end but they sit on different layers of the whole process.  </p>
<p>According to the OSI (open systems interconnection) model of Network communication.. HTTP is a protocol used at top most or Seventh layer also known as Application layer. HTTP request is part of application logic.</p>
<p><img src="https://cf-assets.www.cloudflare.com/slt3lc6tev37/6ZH2Etm3LlFHTgmkjLmkxp/59ff240fb3ebdc7794ffaa6e1d69b7c2/osi_model_7_layers.png" alt="OSI Model 7 layers - physical, data link, network, transport, session, presentation, application" /></p>
<p>Whereas TCP and UDP both sit at fourth layer or Transport layer that are much lower level and are concerned with transport of the data in packets or chunks from source to destination.</p>
<p>HTTP protocol defines how two systems “talk” or communicate at application layer, TCP and UDP define how those same systems communicate at Transport layer. Both handle communication at separate level and at separate concerns. Usually a developer is only concerned with application layer of the whole communication.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Both TCP and UDP have their unique use cases, neither is better than the other. Both are widely used depending on what is the need of the communication that you want to do. If you want integrity,accuracy and safety at expense of speed choose TCP or if speed matters above all choose UDP.  </p>
<p>Hopefully you understood what these two protocols do and how they relate and differ with each other and HTTP.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding cURL: A Guide to Its Uses and Functions]]></title><description><![CDATA[You have browsed many websites and web-apps trough your Web browser and maybe if you are a developer you have created your own web-apps and APIs too. As a developer you have tested your API on browser too probably.
But browser is a tool made for cons...]]></description><link>https://blog.shyamhz.dev/curl</link><guid isPermaLink="true">https://blog.shyamhz.dev/curl</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[curl]]></category><category><![CDATA[cURL for beginner]]></category><category><![CDATA[http requests]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:53:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769781450114/9a38e7bf-a225-428f-9c1e-2875046f3b63.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You have browsed many websites and web-apps trough your Web browser and maybe if you are a developer you have created your own web-apps and APIs too. As a developer you have tested your API on browser too probably.</p>
<p>But browser is a tool made for consumers in mind , yes browser provides one of it’s kind developer tools and development ecosystem but a developers much time goes in debugging and running commands in terminal.</p>
<p>But there exists a much simple and straight forward tool that not only works in terminal but also provides a much simpler request response format workflow that makes testing your APIs much more simpler and easier and quicker. The tool is called cURL.</p>
<h2 id="heading-what-is-curl">What is cURL?</h2>
<p>cURL is a tool that allows you to send request to APIs and Inspect their response from the terminal itself. When you use cURL directly from terminal instead of the full-fledged browser you not only strip away all the additional complexity that comes with the browser but also you can customize the request and response according to your needs much easily.</p>
<h2 id="heading-using-curl">Using cURL</h2>
<h3 id="heading-first-request-and-response-on-curl">First request and response on cURL</h3>
<p>Let’s send our first request from curl</p>
<pre><code class="lang-bash">curl https://www.example.com/
</code></pre>
<p>This is a basic and common example of how you can send and HTTP request using cURL. You can also send <code>http</code>, <code>ftp</code> and <code>dict</code> requests too using cURL.</p>
<h3 id="heading-understanding-request-and-response">Understanding request and response</h3>
<p>You can also customize you HTTP request according to your need. For example if you want to see detailed response from the server or API you are trying to talk to you can use</p>
<pre><code class="lang-bash"> curl  --dump-header - https://example.com
</code></pre>
<p>command. This command dumps the header information from the response of the Server that will help you get additional information show below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769779761002/9aa9f1c4-0ab1-4745-90ed-9cdc4976ed2e.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-get-request">GET request</h3>
<p>Here in the above image if you see you will see a line <code>HTTP/2 200</code> . Here HTTP/2 means the server is using version 2 of HTTP protocol and it returned 200 as response status that means OK.<br />It also contains additional information like date, allowed request methods, server name and most importantly the type of content as <code>content-type: text/html</code> that tells that the text returned in the body of the response is an HTML document content.</p>
<h3 id="heading-post-request">POST request</h3>
<p>Now as we can see from the GET request that the destination do not allow POST request because it is not present in the allowed request methods list. So let’s try to see what happens if we forcefully send a POST request with a dummy data.</p>
<pre><code class="lang-bash">curl -X POST -d <span class="hljs-string">'key=value'</span> --dump-header - https://example.com
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769780382259/157dcc48-b961-4fe9-9064-ac9757870241.png" alt class="image--center mx-auto" /></p>
<p>Here you can see that in the response header this time it has given a tiny bit different of response header. As you can see this time the HTTP code is 405 which literally means <code>Method Not Allowed</code> . So the server is directly telling us that the used method is not available for this Server. But is still returned the HTTP content regardless.  </p>
<p>HTTP codes and returned response header and response body depends on internal logic of the Server.</p>
<h2 id="heading-beginner-mistakes">Beginner Mistakes</h2>
<p>Now that we know basic know how of how to make HTTP request using cURL and how to read the responses let’ understand what not to do.</p>
<ul>
<li><p>Always make sure your command is correct and respects request method format, many beginners mismatch the request type and passed flags in the command. That may result in misinterpretation from the server and cause confusion on user’s end. e.g. sending <code>-d ‘key=value’</code> in a GET request</p>
</li>
<li><p>Always read and send proper Content-Type to avoid confusion and misinterpretation.</p>
</li>
<li><p>Many beginner fail to distinguish difference between the header and the actual response body, you should be able to avoid them.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This was simple and beginner friendly introduction to cURL and it’s use cases. As you practice more commands and options you will learn more about it and get better at using it. But do avoid going too deep in the available options , always prefer to learn as you go. cURL is not at all a small tool, it is a industry standard tool to make HTTP and other requests and many other tool use cURL under the hood e.g. <code>Postman</code> .<br />Hopefully it was simple and easy to understand and now you will be able to start using cURL in your daily development workflow.</p>
]]></content:encoded></item><item><title><![CDATA[A Complete Guide to Different DNS Record Types]]></title><description><![CDATA[As we learnt in the previous blog DNS is the phonebook of the Internet. Without DNS it would not be possible to find the actual address of the websites and servers. If you want to know more about what DNS is and how they are resolved read the last bl...]]></description><link>https://blog.shyamhz.dev/dns-record-types</link><guid isPermaLink="true">https://blog.shyamhz.dev/dns-record-types</guid><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns-records]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Fri, 30 Jan 2026 12:56:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769777710850/b6dbf5bd-9daa-416d-8521-7f96aff8d100.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As we learnt in the <a target="_blank" href="https://blog.shyamhz.dev/understanding-dns-how-domain-name-system-resolution-works">previous blog</a> DNS is the phonebook of the Internet. Without DNS it would not be possible to find the actual address of the websites and servers. If you want to know more about what DNS is and how they are resolved read the <a target="_blank" href="https://blog.shyamhz.dev/understanding-dns-how-domain-name-system-resolution-works">last blog</a>, in this blog you will learn about different types of DNS records and why they exist. So without a due let’s jump into it.</p>
<h2 id="heading-what-are-dns-records">What are DNS records</h2>
<p>DNS records are a list of entries that associate a Hostname to an address. Now this address can be a different hostname, an actual IPv4 or IPv6 address depending on what type of record it is. When you spin up a server somewhere you get it’s IP address you need to manually connect it to your custom Domain name via a DNS record at your Domain manager’s site (e.g. Cloudflare, Namecheap, Hostinger etc. are few of many available options).</p>
<h3 id="heading-a-record">A record</h3>
<p>This is the final public IP address that is resolved at the end of DNS queries usually. An <code>A record</code> is always a <strong>IPv4 address</strong> record. For example A record for <code>google.com</code> contains `<code>142.250.183.142</code>`.</p>
<h3 id="heading-aaaa-record">AAAA record</h3>
<p>This record also contains the actual IP address associated with the domain or the target destination server. Only difference between an <code>A record</code> and <code>AAAA record</code> is AAAA record contains IPv6 address instead of IPv4. An example of IPv6 record could be <code>2001:0db8:85a3:0000:0000:8a2e:0370:7334</code> .</p>
<h3 id="heading-cname-record">CNAME record</h3>
<p>A CNAME records contains another domain name instead of a IP address , basically it associates one domain or subdomain with another domain or subdomain. To get the A or AAAA record for that second domain it needs to be resolved via an Authoritative NS.</p>
<p>If someone has their blog subdomain mapped to a blogging site like <code>hasnode.com</code> then the CNAME record for that will look like</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Type</td><td>Name</td><td>Content</td><td>TTL</td></tr>
</thead>
<tbody>
<tr>
<td>CNAME</td><td>blog</td><td>hashnode.network</td><td>Auto</td></tr>
</tbody>
</table>
</div><p>here blog is the subdomain for the actual domain that is being associated with the CNAME <code>blog.example.com → hashnode.network</code> .</p>
<h3 id="heading-mx-record">MX record</h3>
<p>MX records stands for mail exchange record. These records are responsible for routing mails to correct destination mail server according to the SMTP server. There can be multiple MX records for same mail server.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Type</td><td>Name</td><td>Priority</td><td>Content</td><td>TTL</td></tr>
</thead>
<tbody>
<tr>
<td>MX</td><td>mail</td><td>20</td><td><a target="_blank" href="http://mailhost2.example.com">mailhost1.example.com</a></td><td>Auto</td></tr>
<tr>
<td>MX</td><td>mail</td><td>10</td><td><a target="_blank" href="http://mailhost2.example.com">mailhost2.example.com</a></td><td>Auto</td></tr>
</tbody>
</table>
</div><h3 id="heading-txt-record">TXT record</h3>
<p>DNS TXT records were originally introduced to add text information to DNS. These let DNS administrators put additional information for their domains, one domain can have many TXT records. Nowadays these text record help domain owners put additional info in their domain’s DNS so it is more harder for malicious practitioners to spoof or fake sender’s domain in e-mails.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Type</td><td>Content</td><td>TTL</td></tr>
</thead>
<tbody>
<tr>
<td>TXT</td><td>“domain=authentic”</td><td>Auto</td></tr>
</tbody>
</table>
</div><h3 id="heading-ns-record">NS record</h3>
<p>NS records are used to specify a different authoritative NS for a domain different from the registrar of that domain. For example if you bought your domain from Namecheap but want to manage your Domain and it’s records on Cloudflare you can do that by putting a NS record in Namecheap that contains Nameservers of Cloudflare.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Type</td><td>Name</td><td>Content</td><td>TTL</td></tr>
</thead>
<tbody>
<tr>
<td>CNAME</td><td>sub-domain or @ for root</td><td>Actual Name Servers</td><td>Auto</td></tr>
</tbody>
</table>
</div><h2 id="heading-summary">Summary</h2>
<p>The DNS records are bones and muscles of the who DNS. They tell DNS resolvers where to look for the domains and how to get to them. Each and every record type play a particular role in DNS resolution as mentioned above.</p>
<p>Hopefully now you understand what each DNS record exist and why they are needed and how they are used.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding DNS: How Domain Name System Resolution Works]]></title><description><![CDATA[All of us are familiar with many domains like google.com, netflix.com, wikipedia.org, facebook.com etc. But none of them are real address of those sites, they are just names or if you want to say it formally then “domain names”. Each individual websi...]]></description><link>https://blog.shyamhz.dev/domain-name-system-resolution</link><guid isPermaLink="true">https://blog.shyamhz.dev/domain-name-system-resolution</guid><category><![CDATA[dns resolver]]></category><category><![CDATA[#DNS Resolution]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Fri, 30 Jan 2026 09:52:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769766558374/a26c70a6-e006-4cc7-b323-e6c1c6d3e189.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>All of us are familiar with many domains like google.com, netflix.com, wikipedia.org, facebook.com etc. But none of them are real address of those sites, they are just names or if you want to say it formally then “domain names”. Each individual website that you visit are located in a server somewhere that has It’s own unique public IP address. And <strong>Domain Name System (DNS) servers</strong> store and resolve which domain name belongs to which IP address, simply the address of the host server. You can think DNS as the phone-book of the Internet. In this blog you are going to learn about different kind of DNS servers and how DNS queries are resolved.</p>
<p>DNS exists because a fundamental difference between us and the Computers , Computers are good at numbers and we are good with word or rather names. It is hard for us to remember every single IP address for all the sites we want to visit but Computers need actual address to take us to that exact server’s contents. That is why DNS resolution process takes the domain name or hostname and finally returns the server’s true IP address.</p>
<h2 id="heading-inspecting-dns-resolution">Inspecting DNS resolution</h2>
<p>DNS resolution is not as simple or straightforward as it sounds at start, it happens in multiple servers, multiple server to server hops are involved for each resolution request. But luckily for us we have a tool available for us that can be used to diagnose the resolution process. The tool is a command-line utility called <code>dig</code>.</p>
<p>With this command we can understand the DNS resolution flow easily. For that we need to understand how dig command works first.</p>
<h3 id="heading-starting-from-the-root">Starting from the Root</h3>
<p>Every DNS resolution starts from the Root Servers that are the Root entries or top most level servers in the whole Domain Name System. Every domain contains a TLD (e.g. .com, .org, .us, .ai, .in etc) we need those TLD server’s address first and to get them we need to know how to reach Root server first.</p>
<p><code>dig . NS</code> gives list of all the Root servers. <code>.</code> here represents “Root” and fetches all the Root servers.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769759159515/9e0b58f8-2cad-4048-add4-bf9183e4ab5d.png" alt class="image--center mx-auto" /></p>
<p>These Root servers are starting point of every domain name lookup or DNS resolution process.</p>
<h3 id="heading-the-tld-servers">The TLD servers</h3>
<p>TLD servers are responsible for knowing further information related to domain with a specific TLD like .com , .org etc. These TLD Name Servers are responsible for knowing Authoritative NS (Name Server) for the domain that is being looked up for and has a specific TLD like <code>.com</code> in <code>google.com</code> . We can ask the Root servers, that which TLD servers can resolve a particular TLD e.g. <code>.com</code> .</p>
<p>To know the TLD NS use <code>dig com NS</code> command. This command will list the TLD servers list. This list is fetched from the Root servers that we got in previous step and store only Authoritative NS for <code>com</code> TLD domains only.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769759597901/34fdec2b-f5d5-45e2-99c2-a8aa6cc83512.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-authoritative-server">Authoritative Server</h3>
<p>Our next stop in DNS resolution query is Authoritative NS. Only an Authoritative Name server can tell the actual IP address for the domain for which the whole resolution is happening, from Root NS to TLD NS to Authoritative NS all this tour was to finally reach the actual IP address of the Server.</p>
<p>Continuing with our <code>dig</code> example from Root name servers we got TLD NS for <code>.com</code> TLD then from those TLD servers we will go to authoritative NS for google.com.</p>
<p>we can use <code>dig google.com NS</code> command to finally do that.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769760218511/80671634-21f3-4fa5-b490-b0b554b13660.png" alt class="image--center mx-auto" /></p>
<p>As you can see the <code>ns1.google.com</code> and other are the authoritative server for <code>google.com</code> domain that dig command fetched from us from TLD servers of <code>com</code> TLD.</p>
<h3 id="heading-the-final-destination">The final destination</h3>
<p>Now that we have multiple Authoritative NS for <code>google.com</code> we can finally ask them for the actual IP address for <code>google.com</code> .</p>
<p>for that we do <code>dig @</code><a target="_blank" href="http://ns1.google.com"><code>ns1.google.com</code></a> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>A</code> . This command returns the true IP address of <code>google.com</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769760880431/a6c65da2-5123-4902-8806-d22541e67a26.png" alt class="image--center mx-auto" /></p>
<p>As you can see in the answer section the IP address for <code>google.com</code> . You can directly enter that IP <code>142.250.183.142</code> in you favorite browser’s URL bar and it will surely take you to <a target="_blank" href="https://google.com">google.com</a>.</p>
<h2 id="heading-summary">Summary</h2>
<p>So you saw how we recursively resolved DNS query for <code>google.com</code> using the dig command. But browsers do not use <code>dig</code> command instead Browser uses something called Recursive DNS resolver.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769762087322/c492b0a8-a1df-48a9-9e09-3b7a29c8f4c8.png" alt class="image--center mx-auto" /></p>
<p>A recursive resolver takes the target hostname and resolves the IP address of it for the browser. As you can see in the diagram each query originates and ends at the recursive resolver and the resolver itself queries each and every server in the step and finally returns the IP address. From Root NS to the final Authoritative NS it pinpoints the IP address for exact domain name it is resolving for just like we find for files in directories and sub-directories recursively.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Hopefully it is clear to you now how step by step DNS is resolved behind the scenes and how Browsers fetch the actual IP address for any domain name and fetches the content of those servers.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices]]></title><description><![CDATA[We use the Internet everyday without any thought to how it is all working behind the scene, you may have even heard about the networking devices that make it even possible for you to read this article right now but never gave them much thought, maybe...]]></description><link>https://blog.shyamhz.dev/understanding-network-devices</link><guid isPermaLink="true">https://blog.shyamhz.dev/understanding-network-devices</guid><category><![CDATA[network]]></category><category><![CDATA[internet]]></category><category><![CDATA[#NetworkDevices]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Wed, 28 Jan 2026 10:09:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769591135228/2d6840a1-fd49-4829-9d85-7f3241f4a191.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We use the Internet everyday without any thought to how it is all working behind the scene, you may have even heard about the networking devices that make it even possible for you to read this article right now but never gave them much thought, maybe you even have a WiFi Router at home too.. But do you really understand that how this article or literally anything else on the Internet is delivered to you when you just click on links? What happens between all the networking devices or how they communicate to serve the Internet to you?<br />Today you are going to get a brief overview and some basic understanding of how the Internet works and reaches your home!</p>
<h2 id="heading-what-is-the-internet-and-how-it-reaches-you">What is the Internet and how it reaches you</h2>
<p>To understand how Internet works behind the scene and how you get connected to it, we first need to understand what the Internet actually is. Let’s start from you and we will gradually build up to the whole Internet, simple enough right? Alright.</p>
<p>Yes it starts with you . How? When you are accessing the internet first and foremost you are part of a Local Area Network or LAN. What is this LAN now? If you have taken a proper WiFi connection from an ISP with a Router, it can be all the people at your home who use the same WiFi network including your own device.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769440109236/90be6b27-15a3-4653-be70-557183ec53c2.png" alt class="image--center mx-auto" /></p>
<p>It boils down to how many devices are using the same local network to connect to your ISP at the same time, all of them are part of the same LAN. Each modem is a gateway between the ISP and the associated LAN. Now an ISP usually serves countless other LANs each connected to the ISP via their own Modems, think of your neighbors or whole neighborhood. And they all might not be using the same ISP. All the different ISPs are all connected in a Bigger Network and Those Networks are connect to form National and then International Networks and they together form what Internet essentially is.</p>
<p><img src="https://www.ufinet.com/wp-content/uploads/2019/07/world-submarine-cable-map.png" alt /></p>
<p>Any device be it you home computer, or devices at office, or some server somewhere all of them are connected in some kind of LAN configuration and via their ISP they are connected to the Internet.</p>
<p>Hopefully now you understand that a Modem acts as a entry point between your home network (or LANs in general) and the Internet (via ISPs). Now let’s understand what a Modem or Router and other devices actually do behind the scene to make the entire thing work.</p>
<h2 id="heading-networking-devices">Networking Devices</h2>
<p><strong>Modem ::</strong> Modems (also known as) Modulator-Demodulator and as suggested in the name they modulate and demodulate a signal or in simple words they convert digital signals into analogue signals and analogue signal back to it's digital counterpart. Usually in home networks it's the modem that connects your router with your Internet Service Provider (ISP). Modems are usually connected to the ISP via cables or wireless receivers.</p>
<p><strong>Router ::</strong> Router is what sits between you LAN devices and Modem , although some modern Routers come with Modem’s capabilities, traditionally Routers main job is to create a Local Area Network with all the connected devices and manage traffic. Router assigns private IPs to each individual connected devices. Routers route or direct data packets (raw data travelling through wires and other mediums) to their intended destination like air traffic control guides aircrafts on their intended destination. Router not only host and manage a LAN but also connects it with a larger network via Modem</p>
<p><strong>Hub ::</strong> Hubs are similar to Router but do not care about destination of the data packets and send them to all the connected devices that can receive data packets. They are not commonly used nowadays because of this limitation and instead Routers are used instead.</p>
<p><strong>Switch ::</strong> Unlike Routers, switch do not connect a LAN to a bigger network , they use device MAC address to transfer data packets within a Network (usually a LAN). So unlike Router , Switch isn’t responsible for connecting a Local Network to the broader network. Switch is like a traffic police that direct the data traffic within a Network so devices like printers , computers and other devices communicate to each other that are connected in a same network.</p>
<p><strong>Firewall ::</strong> Firewalls are used for security purposes they decide which data packets can travel between two networks. You can think of a Firewall as a security guard standing between two networks allowing and rejecting data packets to keep unwanted or malicious traffic coming in or stop any sensitive secret data leaking from a network. Firewalls can be both a hardware device or an installed software program.</p>
<p><strong>Load Balancer ::</strong> Imagine waiting in a single long line for a movie ticket counter where the other counters are empty and someone comes and diverts people away to those other free counters so the unnecessary waiting time can be reduced. That is exactly what what a load balancer does but with network traffic instead of people. it is usually used in case of diverting traffic to multiple servers delivering same service so more requests can be handled simultaneously.</p>
<h2 id="heading-behind-the-scenes">Behind the Scenes</h2>
<p>Now from above section you got a basic idea of how different devices work individually or what are their purposes and what are the difference between them, now in this section we will see how in a real world scenario they work together. With a simple example it will become really clear how all the devices work together</p>
<h3 id="heading-the-request-and-response">The request and response</h3>
<p>Suppose you are home watching your favorite live stream from any streaming platform, first you will go and use the streaming platform (e.g. Netflix, YouTube) and and click the stream you want to watch. That will send the request from your device (e.g desktop or phone) to Router then via Modem to the ISP.. then ISP will tell your device where to send request for the content with a same reverse sequence (ISP &gt; Modem &gt; Router &gt; Your Device). If your ISP does not resolves the address it may send the resolution to other DNS servers that can and then return you their response.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769532058804/f88cfee9-a251-4e4f-b799-5b0567d77060.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-destination">The destination</h3>
<p>Then after that your device directly send the request to you the destination server that is currently streaming the video stream you want to watch. And there might be many many users currently trying to watch the same stream at the same moment! Think of a Cricket or Football match being streamed. On the servers side one server may get overwhelmed by too many request at the same time where you are just another one of the requesting viewer.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769587906058/081c5d3d-6011-4667-b0e5-e13fc96d9b3f.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-from-the-servers-to-you">From the Servers to You</h3>
<p>For that the streaming services use Load Balancers on their servers and equally distribute the traffic or all the requests to multiple servers that are serving the same stream, so the servers only get the amount of requests they can handle at once.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769589119455/92ad7bcf-a45e-4483-9a6b-df3fdc947cc5.png" alt class="image--center mx-auto" /></p>
<p>And from one of those servers you get your stream back to you local Network first via you Modem then your Router and then in the device where you are watching the stream.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769589700934/82a6a955-2137-4fae-9b67-b326a2ff385b.png" alt class="image--center mx-auto" /></p>
<p>And last but not the least Firewalls protect the servers or any other traffic or request coming from any foreign or forbidden network.</p>
<h2 id="heading-summary">Summary</h2>
<p>So now you have a basic idea of what all the individual networking devices do and how they work together to make a functional Internet possible and enables you to surf the Internet without having to think about all the internal details.<br />Hopefully this was simple and clear enough to understand how Internet reaches you at home at some basic level and now you can explain it further to someone else too.</p>
]]></content:encoded></item><item><title><![CDATA[Inside Git and how it works!]]></title><description><![CDATA[Introduction
In last two blogs we talked about Version Control in general and got introduction to Git and learned what is importance of version controlling and why we choose Git specifically to handle source control or source tracking of our projects...]]></description><link>https://blog.shyamhz.dev/inside-git-and-how-it-works</link><guid isPermaLink="true">https://blog.shyamhz.dev/inside-git-and-how-it-works</guid><category><![CDATA[Git]]></category><category><![CDATA[Git-Internals]]></category><category><![CDATA[How Git Works Internally]]></category><category><![CDATA[Git Objects: Blob, Tree, Commit]]></category><category><![CDATA[git objects]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[#ChaiaurCode #HiteshChoudhary #PiyushGarg #GenAICohort #GenAI #LLM #PersonaPrompting #GeminiAI #ReactJS #NextJS #Python #AIChatbot #Hashnode #PromptEngineering #Vercel #HindiEnglishBlog #DevJourney]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[WebDevCohort2026]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Sat, 17 Jan 2026 15:08:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768662385230/c8885d9d-6735-45b5-bfac-a822f44703ae.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>In last two blogs we talked about <a target="_blank" href="https://blog.shyamhz.dev/version-control-system">Version Control</a> in general and got <a target="_blank" href="https://blog.shyamhz.dev/git-basics-and-terminologies-for-beginners">introduction to Git</a> and learned what is importance of version controlling and why we choose Git specifically to handle source control or source tracking of our projects. In Git introduction blog we learned about basic Git terminologies and basic Git commands. The first term we got introduced to was “repository” where we learned Git repository is the project directory that is being maintained by Git which is not entirely correct.</p>
<p>Actually, the repository is just the .git folder inside our project directory. There is a clear distinction between working directory where we store our actual files and work on them with the actual repository or the “.git“ folder where Git maintains all the tracking information, commit history and much more. Today we will dive inside the .git folder and discover how Git stores all the information and how it works internally.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768659116908/4dba6313-81ca-4479-b3c9-bb4f61b3f7fa.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-behind-the-simple-commands">Behind the simple commands</h2>
<p>Starting with some basic concepts that you should have clear is Git is not a VCS system at core, yes you read that correct. At core Git is a content-addressable filesystem. That means Git underneath the VCS interface is just a Key-Value storing system that stores all of the information as blobs or objects and provides keys to access them. These keys are SHA-1 hash keys.</p>
<p>Git always did not provide these simple VCS interface over this key-object management workflow.. It was a more complex and tedious process. To really understand we need to see what goes on when we enter our simple looking Git commands.</p>
<p>Git provides two different set of commands that work at two different layers of Git.. one is called <strong>Porcelain</strong> the ones that we are used to using on day to day basis and another set that exists at a deeper level are called <strong>Plumbing.</strong> You can compare it to using water sink that is usually made of <strong>Porcelain</strong> and straightforward to use where the actual water management is done by <strong>Plumbing</strong> mechanism hidden behind. (Yes Linus Torvalds is a genius!).</p>
<p>Let’s look at few step by step simple plumbing command to understand how Git really works underneath the simple VCS interface.</p>
<h2 id="heading-git-objects-and-usage">Git Objects and usage</h2>
<p>Everything related to tracking information that Git stores in .git folder is an object inside .git/objects folder. Let’s see how to manually store a file in Git Objects database.</p>
<pre><code class="lang-bash">git hash-object -w README.md
</code></pre>
<p>In this command Git reads the contents of the file <code>README.md</code> and creates a blob object for that file from the content along with it’s metadata. It also calculates the hash from the blob file content and returns it as a key. The <code>-w</code> flag tells Git to also store the blob object in the database.</p>
<p>This command stores the blob object under the .object folder under subfolder for e.g. if the hash is something like <code>67bf245a3cd…</code> then it will be stored as <code>.git/object/67/bf245a3cd….</code>.</p>
<p>Next thing we need to do is update the index file that lives inside <code>.git</code> folder in path <code>.git/index</code>. The blobs are not much useful by themselves , we need to store exact what file the blob is associated to along with few more metadata to actually make it useful and ready for commit.</p>
<pre><code class="lang-bash">git update-index --add README.md
</code></pre>
<p>With this command we add the blob file’s information in the index file. This commands updates the index file and writes the blob hash <code>67bf245a3cd…</code>, associated file path <code>README.md</code> and filemode or permissions.</p>
<p>Did you realise what we did? We essentially added README.md file to staging area that is usually done simply by <code>git add README.md</code> command. Yes when we say adding files to staging area we mean adding these details to the <code>.git/index</code> file.</p>
<p>This is where we understand importance of Index file or staging area. Index is meant to be as a stage for tree objects to be formed upon so that the current filesystem snapshot (the blobs hash , filenames and directory hierarchy) can be stored as a hierarchical structure in the version history.</p>
<p>Tree objects are another type of object that consume information from index file and stores the blob info and their metadata along with sub-trees in case there are sub-directories under the root project directories and in those sub-trees blobs associated with those sub-directory files are stored.</p>
<p>These tree objects are created with</p>
<pre><code class="lang-bash">git write-tree
</code></pre>
<p>command. This command also returns a hash calculated from the tree object it forms and returns as key for the newly created tree object.</p>
<p>Now this tree is a exact snapshot of your staged filesystem present in Index file.</p>
<p>To commit this tree permanently to you repository’s tracking history you use</p>
<pre><code class="lang-bash">git commit-tree &lt;tree_hash&gt; -m <span class="hljs-string">"Add README"</span>
</code></pre>
<p>command. This creates a new commit and returns a hash for this commit that you just made. If your repository has existing commit to maintain a proper commit history that you usually see from a <code>git log</code> you need to use <code>-p</code> flag and pass previous commit hash.</p>
<pre><code class="lang-bash">git commit-tree &lt;tree_hash&gt; -m <span class="hljs-string">"Add README"</span> -p &lt;previous commit <span class="hljs-built_in">hash</span>&gt;
</code></pre>
<p>And with that you have essentially done <code>git commit -m “Add README“</code>. Each commit object contains</p>
<p>1. Hash of the tree object</p>
<p>2. Parent Commit hash</p>
<p>3. Author</p>
<p>4. Comitter</p>
<p>and the Commit message that you provided.</p>
<p>For each object be it <strong>blob</strong>, <strong>tree</strong> or <strong>commit</strong> object there exists a Hash that is actually calculated from exact contents of those objects and acts as a key to them.</p>
<h2 id="heading-summary">Summary</h2>
<p>Yes, All of this happen under the hood <strong>every single time</strong> you complete a <code>git add</code> and <code>git commit -m “msg“</code> loop using the VCS frontend commands or the <strong>Porcelain</strong> commands. Now not only you know actual low level Git commands do when you run the higher level simpler commands but also what exactly goes on inside the repository and how they are saved inside your .git folder and sub-folders.</p>
]]></content:encoded></item><item><title><![CDATA[Git basics and terminologies for beginners.]]></title><description><![CDATA[What is Git?
If you are new to Git or version control in general it may seem daunting at first but trust me once you really understand the basics of Git, then Version Controlling using Git will become your second nature. Let’s keep it simple and focu...]]></description><link>https://blog.shyamhz.dev/git-basics-and-terminologies-for-beginners</link><guid isPermaLink="true">https://blog.shyamhz.dev/git-basics-and-terminologies-for-beginners</guid><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><category><![CDATA[version control systems]]></category><category><![CDATA[Gitcommands]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[WebDevCohort2026]]></category><category><![CDATA[webdevcohort]]></category><category><![CDATA[#ChaiaurCode #HiteshChoudhary #PiyushGarg #GenAICohort #GenAI #LLM #PersonaPrompting #GeminiAI #ReactJS #NextJS #Python #AIChatbot #Hashnode #PromptEngineering #Vercel #HindiEnglishBlog #DevJourney]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Thu, 15 Jan 2026 08:17:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768464861918/122290db-eb28-4202-8a08-dc8a9fe70120.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-git">What is Git?</h2>
<p>If you are new to Git or version control in general it may seem daunting at first but trust me once you really understand the basics of Git, then Version Controlling using Git will become your second nature. Let’s keep it simple and focus on one step at a time.</p>
<p>Git is a free and open source Version Control System, that’s it. Now what is a Version Control System you may ask? It is a tool that helps you to track changes of your work across the whole working process. Simply Git allows you to store multiple snapshot of the changes you make to your work. Each newer snapshot contains some newer changes that were made after previous snapshot and link to it’s previous older snapshot of changes. So that you can easily undo redo or edit those changes.</p>
<p>Git enables multiple developers to work on the same project in their own machines simultaneously while contributing and sharing the latest changes with each other seamlessly. Each contributor work on and make changes to their version of the project and share the newer snapshots or commits with the rest, who then add that newer snapshot or commit (Sometimes multiple commits) into their local copy of the project and continue working with the newer version. Git also allows us to detect and resolve conflicts between two different commits made by different people.</p>
<p>That is all a Version Control System essentially does. If you want to understand VCS (Version Control Systems) in more depth then <a target="_blank" href="https://blog.shyamhz.dev/version-control-system">read this article</a> that goes in detailed explanation of what a VCS is and why it is required in modern development. But you don’t have to worry about it too much to understand essentials of Git and from this article you can easily understand the basics of it.</p>
<p>Before we go all in with what is Git and how it works and all , let’s first understand why should we even concern ourselves with something like Git at all. What features Git offers that you should consider investing your time and energy to learn a new tool and it’s terminologies? Why should you even consider using Git in your projects at all?</p>
<p>Actually there are multiple crucial and unavoidable reasons to do so.</p>
<h2 id="heading-why-use-git-at-all">Why use Git at all?</h2>
<ol>
<li><p><strong>Where, What and When :</strong> When tracking changes with Git the first and foremost benefit you get is every snapshot that you ever make in your project is visible forever and can be identified later on no matter how big your project grows. Each and every change that you commit will be marked in full details as in Which files were changed, what changes were made exactly and when the changes were added permanently (committed) in essence the exact date and time the changes were committed.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768400464792/19e34706-f79c-4b2c-a954-d5b50c0bf2e6.png" alt class="image--center mx-auto" /></p>
<p> Git solves that.</p>
</li>
<li><p><strong>By Whom :</strong> Each commit also stores who authored it or created it. This might seem like a small addition but in real world development processes this can be a life saver, In bigger corporations teams of multiple people work on the same project and sometimes each team working on a specific part of the projects consists of multiple developers or experts. And in that scenario this detail makes co-operation, collaboration and teamwork a lot better. Especially it helps pinpointing source of the problems easily.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768405241018/e2db578c-c264-455f-8e41-d31f86ccfb5d.png" alt class="image--center mx-auto" /></p>
<p> Git solves that too.</p>
</li>
<li><p><strong>Branching:</strong> Git allows you to keep more than one parallel version of the project. This feature is actively utilized to test new features without tampering the main working files, fix bugs, roll out updates and provides other convenient and quality of life experiences for the developers.</p>
<p> You can create a branch from any snapshot or commit of your project and you can merge branches to your main branch to integrate changes created in that secondary branch to your main branch and this is a popular technique that is actually used to develop and test new features without breaking the whole product or features at the consumer’s end.</p>
</li>
<li><p><strong>Rollback and Revert :</strong> Git allows you to revert changes by switching to an older commit as working state or current state of the project and create a branch or make changes on that branch directly. This feature gives us a superpower to go back in the timeline of our project and fix mistakes or even diverge in a different branch from that exact point with a totally different timeline or simply undo any errors.</p>
</li>
<li><p><strong>Real world Collaboration:</strong> Git is distributed Version Controlling System or simply said a distributed tracking tool. It not only allows a group of people working together on the same project, individually and locally, track and control their work but also it can act as a centralized hosted service that tracks changes made by everyone involved and working on the project in one place. Github, Gitea and Gitlab are just few examples that host the projects that are using Git on their remote server using this feature of Git.</p>
</li>
</ol>
<h2 id="heading-brief-history">Brief History</h2>
<p>Git was created in 2005 by Linus Torvalds, a Finnish programmer who is most popular as the creator of Linux kernel since 1991. After facing problems from proprietary Version Control Systems he created his own Version Control System to maintain the source code of Linux and named it Git.</p>
<p><strong><em>“Since its birth in 2005, Git has evolved and matured to be easy to use and yet retain these initial qualities. It’s amazingly fast, it’s very efficient with large projects, and it has an incredible branching system for non-linear development“ -</em></strong> <a target="_blank" href="https://git-scm.com/book/en/v2/Getting-Started-A-Short-History-of-Git#:~:text=Since%20its%20birth%20in%202005%2C%20Git%20has%20evolved%20and%20matured%20to%20be%20easy%20to%20use%20and%20yet%20retain%20these%20initial%20qualities.%20It%E2%80%99s%20amazingly%20fast%2C%20it%E2%80%99s%20very%20efficient%20with%20large%20projects%2C%20and%20it%20has%20an%20incredible%20branching%20system%20for%20non%2Dlinear%20development">Official Git Docs</a><strong><em>.</em></strong></p>
<h2 id="heading-basic-git-terminologies">Basic Git Terminologies</h2>
<p>Before we go ahead and jump into all the fancy commands of Git, let’s first understand few key terms and words used in context of Git and version controlling in general. So that when we finally start learning Git, it would be a lot easier for us to do so without being confused in all the fancy jargon.</p>
<p><strong>Git Repository:</strong> A Git repository is basically the workspace or the Project root directory or folder that is actively being tracked by Git for new changes. In the next section we will see how to setup our project as a Git repository or repo in short. This repo contains your project files and the .git folder where Git stores all of the internal files and folders used to maintain the Git repository.</p>
<p><strong>Tracked files:</strong> As you can probably tell already that this refers to all the files that Git is actively tracking for changes and if any of these files are changed Git will tell you that they were modified. Yes if you create new files in your Git repo Git will not track them by default but report that they are untracked and need your attention. To actually track untracked files and changes in those files you must first tell Git to track it manually.</p>
<p>You can also create a “<strong>.gitignore</strong>” file, the file and directory names written inside this file are ignored and not tracked by Git.</p>
<p><strong>Staging area:</strong> After you tell Git to track a new file in your Git repository manually or you tell Git to add the changes made to the files that are already being tracked, Git adds them to staging area to commit them, this is the place where all the recently added files and changes live. Git cannot preserve new changes directly. You need to add changes to staging area for Git to be able to preserve them.The staging area is basically Git’s way to know what exact changes will be committed in next commit and Git commits only the changes present in staging area.</p>
<p><strong>Commit:</strong> Commit is an action that you tell Git to perform when you want to preserve all the changes added to the staging area. This new snapshot or changes permanently added to the repository is called a commit. Each commit has it’s own id or hash that Git uses to reference them individually. Each commit contains some additional metadata like author, creation date , link to previous commit.</p>
<p><strong>Branch:</strong> Your Git repository can have multiple parallel versions that do not affect each other. These versions are called branches each with their individual commit history and different version of the project. Each repository has at least one branch called main. Git keeps the files in your working directory just as same as latest commit in the currently active branch. If you wish to incorporate changes committed in one branch into another you can merge them together.</p>
<p><strong>HEAD:</strong> HEAD is nothing but a pointer that points to the currently active branch of your repository and that branch points to the latest commit made in that branch.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768410074095/724a1e6e-ef7a-42d2-a141-d21583f444e5.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-basic-git-commands">Basic Git commands</h2>
<ol>
<li><p><strong>Initialize a Git repository :</strong> To use Git in our project we first need to initialize our project as a Git repository, so that Git can track the changes we make. To do that we use</p>
<pre><code class="lang-bash"> git init
</code></pre>
<p> command.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767698427744/551afa9a-7308-4cde-86af-3ca5e87f0ff8.png" alt class="image--center mx-auto" /></p>
<p> It creates a .git repository inside your project folder and initializes you project as a Git repository and looks for any changes made inside the repository. Whether the repository is empty or already have some files when initializing it, this command does not delete anything and only creates the .git folder.</p>
</li>
<li><p><strong>Check repository status :</strong> This next command is one that you will use very often. This command is used to check the status of tracking in our Git repository. All the changes that are made will be listed by this</p>
<pre><code class="lang-bash"> git status
</code></pre>
<p> command. All the untracked files, tracked changes that are not staged yet and all the staged changes yet to be committed are shown by this command. This command is frequently used to track the state of our repository.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767698462079/80a6b5c3-b3e2-451a-8d21-58adec8c8c39.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Add latest changes :</strong> To add the changes that you made in your repository to the staging area you need to use the</p>
<pre><code class="lang-bash"> git add &lt;filenames&gt; ...
</code></pre>
<p> command. This command adds only those files that were given in it’s arguments to the staging area. Once the files are in staging area they can be committed. Also if there are too many files that you want to add to the staging area or do not want to manually add the file names to the command you can use</p>
<pre><code class="lang-bash"> git add .
</code></pre>
<p> command too. This ‘.’ at the end of the command means all the files including all the untracked files (if any).</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767698498259/8ef4a0ca-5262-4da8-9794-2ff9292cb772.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Finally committing the changes :</strong> After all the modified files or new files that you want to commit are staged in the staging area they can be committed with</p>
<pre><code class="lang-bash"> git commit -m <span class="hljs-string">"&lt;commit message&gt;"</span>
</code></pre>
<p> command. Be mindful that the commit message is mandatory and you must provide a commit message to every commit you make or it will fail to commit the changes. After being committed the changes will permanently be listed as a commit in the commit history. Next we will see how to see that commit history.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767698566243/90057368-44e4-48aa-8920-bbcf425e151c.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>See the Commit history :</strong> You can list all the commits that you made till now with</p>
<pre><code class="lang-bash"> git <span class="hljs-built_in">log</span>
</code></pre>
<p> command. This command lists all the commits in a stack view .i.e newest to oldest fashion and the top most commit is the last one you made. For each and every commit, in addition to the commit id or hash the Author (the one who made the commit) and the date time timezone (when the commit was made) followed by the commit message are listed also.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767698592122/92ca244b-bb79-41ff-97d2-ccefe4c3bb91.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>See the differences :</strong> If you want to see the difference between two commits in your repository to check exactly what changes were made between them you can use</p>
<pre><code class="lang-bash"> git diff &lt;commit1 <span class="hljs-built_in">hash</span>&gt; &lt;commit2 <span class="hljs-built_in">hash</span>&gt;
</code></pre>
<p> command. This command displays the additions and deletions to the files across the commits.The commit that has the commit1 hash is treated as base and the second commit2 hash is treated as the newer commit so you need to put older commit hash first and newer commit hash later if you want to see the changes in the correct order.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767699398505/8edfe5d6-6f25-4c8d-b980-9dc8ff8cbc47.png" alt class="image--center mx-auto" /></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767699443863/c51a5d03-ade7-4dd6-95c8-bdfea5d3cd82.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Reset commit history :</strong> Sometimes it may happen that you want to undo one or more commits or simply put those changes back to staging area or working directory, for that we use</p>
<pre><code class="lang-bash"> git reset &lt;commit&gt;
</code></pre>
<p> command. This command moves the branch to point to that commit.</p>
<p> Depending on what flags you used, it may permanently delete the changes made after that commit or put them in the staging area or un-stage them completely but not delete them. Let’s understand these flags.</p>
<ol>
<li><p><strong>Default or --mixed reset:</strong></p>
<pre><code class="lang-bash"> git reset --mixed &lt;commit&gt;
</code></pre>
<p> or simply</p>
<pre><code class="lang-bash"> git reset &lt;commit&gt;
</code></pre>
<p> this command (or the --mixed flag) just moves the current branch to that specified commit and removes all the commits made after that commit, but also preserves the changes that were stored in those removed commits. Those changes are not marked for next commit or not kept in the staging area but in the working directory (inside the actual files) itself ready to be staged again.</p>
</li>
<li><p>Soft Reset</p>
<pre><code class="lang-bash"> git reset --soft &lt;commit&gt;
</code></pre>
<p> This flag also removes the commits made after the specified commit while preserving the changes made in them. -- soft flag keeps those changes in the staging area or in the index file simply marked for next commit.</p>
</li>
<li><p><strong>Hard reset :</strong></p>
<pre><code class="lang-bash"> git reset --hard &lt;commit&gt;
</code></pre>
<p> You need to use this flag with caution and only when you are sure you want to <strong>permanently delete</strong> all the changes made after the specified commit. This flag not only removes the commits made after the specified commit but also overwrites you project directory to be exactly same as it was in the specified commit removing all the newer changes.</p>
</li>
</ol>
</li>
</ol>
<h2 id="heading-summary">Summary</h2>
<p>Above commands are few of the most commonly used Git commands and just enough for you to get started with Git in your projects. Although there are many more functionalities and tools Git offers but if you just use the above mentioned ones you can easily get started with it and then learn as you go.</p>
<p>Git has become a very popular and very successful version control system because of it’s easy-to-use, fast, efficient and very intuitive commands. Due to wide adaption of Git many Git repository hosting services like Github, Gitlab , Gitea, Bitbucket are built around the Git as an ecosystem. Git is an essential addition to your toolbox that will save you from a lot of trouble and will prove more useful as more time you spend in you development journey!</p>
<p>Hopefully you learnt importance and basics of Git from this blog and now will easily be able to start using <strong>Git</strong>. <strong>Thank you</strong> for reading.</p>
]]></content:encoded></item><item><title><![CDATA[Do you really understand Version Control?]]></title><description><![CDATA[If you are a programmer you may already have heard about version controlling and thought "OK, so that is something I just need to learn because every experienced developers use it" and also all the tech instructors too not just teach it but also high...]]></description><link>https://blog.shyamhz.dev/version-control-system</link><guid isPermaLink="true">https://blog.shyamhz.dev/version-control-system</guid><category><![CDATA[version control]]></category><category><![CDATA[version control systems]]></category><category><![CDATA[source control]]></category><category><![CDATA[Source code management ]]></category><category><![CDATA[Git]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[chai-code ]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[WebDevCohort2026]]></category><category><![CDATA[#ChaiaurCode #HiteshChoudhary #PiyushGarg #GenAICohort #GenAI #LLM #PersonaPrompting #GeminiAI #ReactJS #NextJS #Python #AIChatbot #Hashnode #PromptEngineering #Vercel #HindiEnglishBlog #DevJourney]]></category><dc:creator><![CDATA[shyamendrahazracodes]]></dc:creator><pubDate>Tue, 30 Dec 2025 13:27:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767101045265/86342dd9-33a3-4ad6-a945-9f27dd2e23bb.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you are a programmer you may already have heard about version controlling and thought "OK, so that is something I just need to learn because every experienced developers use it" and also all the tech instructors too not just teach it but also highly recommend controlling project source code through tracking and versioning.</p>
<p>But have you ever stopped and thought why? Why do we even use <strong>Version Control System</strong> (<strong>VCS</strong>) and <strong>why it was created in the first place</strong>? Exactly <strong>how</strong> version controlling helps us or why from a small side project to big corporate products <strong>all use some kind of version controlling tools</strong>? Yes Git is just one of many Version Controlling tools.</p>
<p>Before jumping into how VCS work we need to understand what problems programmers faced when version controlling was not a thing yet. We must be able to relate to the programmers who had to invent an entire new concept and what pain points they were trying to eliminate to really grasp why it’s really need.</p>
<h1 id="heading-why-version-control">Why Version Control?</h1>
<p>Imagine you are creating a personal side project , where you have all the features planned out and you know what you are building and you are adding one nice feature after another as you please. After few weeks your project has grown decently big and significantly more complex.</p>
<p>Then suddenly you find that somewhere in the whole development process till now you have introduced <strong>a major bug</strong> in the codebase at some point and all the recently added features <strong>depend on it</strong>. Now you need to fix the bug without any idea <strong>when and where</strong> the bug was introduced and how to pinpoint it’s source.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767090624300/8285f48e-1493-4ae8-884f-2a0c945b4db4.png" alt class="image--center mx-auto" /></p>
<p>Now you wish only if you could get to that exact point where the bug was made <strong>before</strong> so many dependent features were added. But it is now impossible to get back to that exact point and it is too hard to pinpoint the problem without losing significant time and sanity. Feel the frustration?</p>
<p>Exactly this was one of the <strong>major reasons</strong> developers needed a solid way to track different version of their code from the very beginning to completing the project, so they could revert back and forth to any tracked version as they wished. To focus on building the product rather than bug hunting for hours or days or sometime even weeks.</p>
<p>The diagrams below visualizes exactly how a VCS solves that problem and helps programmer make changes that get tracked and can be reversed as needed creating a smooth software development experience without frustration and regret.</p>
<ol>
<li><h2 id="heading-start-tracking-version-from-the-beginning">Start tracking version from the beginning</h2>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767082887797/1ceb823f-7d37-4dcf-b678-38cf6442ac97.png" alt="Diagram 1" class="image--center mx-auto" /></p>
<ol start="2">
<li><h3 id="heading-revert-changes-and-fix-the-bug">Revert Changes and fix the bug</h3>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767091043837/80e70826-a726-4aa0-93aa-d8f66fffefb7.png" alt class="image--center mx-auto" /></p>
<ol start="3">
<li><h3 id="heading-continue-with-the-corrected-code">Continue with the corrected code</h3>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767091156224/936a6231-6feb-4934-a32e-675f065de991.png" alt class="image--center mx-auto" /></p>
<p>VCS helps us revert or rollback changes and get to the exact point where the bug was introduced and fix it and continue development with the corrected version of the code.</p>
<p>But version controlling is just one of the problems that pushed the development of Version Control Systems.</p>
<h1 id="heading-the-collaboration-hell">The collaboration hell</h1>
<p>Now imagine you are working in a group project with your friends.. how you would share your whole project to your friends and how will they share their work with you? A simple and straightforward way can be using using zip file in a pendrive or over the internet. To keep the example simple we will go with the pendrive option.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767084479767/c8f67b23-e0a5-4132-8fe3-8a799e068819.png" alt class="image--center mx-auto" /></p>
<p>So your friends take the project from pendrive, make changes, add new commits and give you the pendrive back with latest changes inside the drive and there you have your new feature, sounds simple enough or is it?</p>
<p>Think what if the pendrive goes around between your friends before returning to you and your friends make changes to the project and you add some features to your local version of the project too at the same time. Then this will create a conflict.. whose changes are to be taken as the final one and which one to reject? or what if someone overwrote someone else’s changes while working?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767091787685/a84a7889-31ae-4da9-96a0-3b875e2cc41e.png" alt class="image--center mx-auto" /></p>
<p>We solved the tracking and versioning problem to make bug fixing or rollbacks seamless but now we have collaboration and code merging conflicts and in the real world software development flow of collaboration can make or break the whole development process.</p>
<h1 id="heading-single-source-of-truth">Single source of Truth</h1>
<p>Now think if there was one singe source of truth, one dedicated maintained version of the project that would be the only version that is taken as reference or simply as the latest and only correct version of the codebase and where all new changes are merged.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767089194510/8028415f-4584-4dcb-99cf-86cc060e83d3.png" alt class="image--center mx-auto" /></p>
<p>As you can see in the above diagram before making any changes to the local codebase the latest remote version is always fetched and the local version is replaced with the remote latest version. This way everyone <strong>always</strong> has <strong><em>all the latest changes</em></strong> and have <strong><em>identical</em></strong> codebases. And remote tracking is essential part of a complete Version Control System.</p>
<p>Typically a remote VCS server is used as a centralized tracking system that tracks new changes just like the local tracking. The local VCS and the remote VCS always use the same version controlling tool to make it possible to sync local and remote tracking in a compatible and uniform manner.</p>
<p>For example <a target="_blank" href="https://github.com/">Github</a>, <a target="_blank" href="https://about.gitlab.com/">Gitlab</a>, <a target="_blank" href="https://about.gitea.com/">Gitea</a> all use <a target="_blank" href="https://git-scm.com/">Git</a> internally. They support, and are built around hosting, projects that specifically use only Git as version controlling tool.</p>
<h1 id="heading-summary">Summary</h1>
<p>So let’s summarize exactly what problems Version Controlling Systems solve.</p>
<ol>
<li><p><strong>Unavoidable complexity:</strong> The very primary issue VCS solve is losing changes and intermediate states of our work by storing snapshots of older versions of our projects and enabling us to roll back or reverse our mistake or fix them. Without this tracking, pinpointing a bug in large codebase with over hundreds or thousands of files would be like searching for a needle in a haystack. Think about Linux kernel development as an example.</p>
</li>
<li><p><strong>Lost information:</strong> As we learnt in the <strong>collaboration hell</strong> section that having no single point of reference is like being lost in the sea without any sense of direction, remote VCS servers act as a lighthouse and always point to the latest valid snapshot of the project we are building.</p>
</li>
<li><p><strong>Collaboration history :</strong> Before VCS or Version Control System was a thing deciding who is responsible for a particular piece of code written in a codebase was almost impossible. Without proper identification maintaining that code or asking the right contributor to make modification to that code was not possible.</p>
</li>
<li><p><strong>Merge Conflicts</strong>: Not only having a single remotely tracked version of our codebase helps preserving intended changes into the codebase but also it serves as a rollback point where we can get back and resolve all conflicts between changes made by different contributors.</p>
</li>
</ol>
<h1 id="heading-conclusion">Conclusion</h1>
<p>From this you may have gained a basic understanding of why we actually need version controlling in our projects and why it was necessary to invent version controlling at all in the first place. Today no serious projects or real world products are developed without using some kind of source tracking or version controlling.</p>
<p>There is no one single universal tool that is used to maintain source code but the most popular one is Git. And that is why there are more than one remote VCS servers built around Git specifically.</p>
<p>Hopefully now you understand why Version Control System is an extremely crucial part of modern software development and will be able to explain to others simply as well.</p>
]]></content:encoded></item></channel></rss>