<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harshita Roonwal on Medium]]></title>
        <description><![CDATA[Stories by Harshita Roonwal on Medium]]></description>
        <link>https://medium.com/@harshita9104?source=rss-4e4142475881------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dnJ7z44Vwq_aIS4Kk7i7zw.png</url>
            <title>Stories by Harshita Roonwal on Medium</title>
            <link>https://medium.com/@harshita9104?source=rss-4e4142475881------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:00:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harshita9104/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Built my own Redis]]></title>
            <link>https://harshita9104.medium.com/built-my-own-redis-cbbba57c0111?source=rss-4e4142475881------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbbba57c0111</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[redis-server]]></category>
            <dc:creator><![CDATA[Harshita Roonwal]]></dc:creator>
            <pubDate>Sun, 16 Mar 2025 15:42:11 GMT</pubDate>
            <atom:updated>2025-03-16T15:42:11.801Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever been intrigued by the blazing speed of Redis, the in-memory data store that powers countless applications? Let’s peel back the layers and build a simplified version from scratch, demystifying the core concepts of databases, network communication, and data persistence. This project will guide you through the process of creating a functional, albeit basic, Redis-like system using Go.</p><p>Our Goal: A Simplified Redis Clone</p><p>We’ll focus on implementing essential features:</p><ul><li>String and Hash Data Types: Handling basic data storage and retrieval.</li><li>RESP Protocol: Understanding and implementing the Redis communication protocol.</li><li>Concurrency: Handling multiple client connections efficiently using Go routines.</li><li>AOF Persistence: Ensuring data durability through disk storage.</li></ul><p>We’ve chosen Go for its simplicity, performance, and suitability for network programming.</p><p>Setting Up the Foundation: The Server</p><p>Our journey begins by establishing a TCP listener to accept client connections. This forms the bedrock of our server, enabling clients to connect and send commands.</p><p>Understanding RESP: The Language of Redis</p><p>Redis clients and servers communicate using the Redis Serialization Protocol (RESP). It’s a simple, text-based protocol that structures data into various types:</p><ul><li>Strings: Represented by $ followed by the length and value.</li><li>Arrays: Represented by * followed by the length and elements.</li></ul><p>For instance, the command SET name harshita translates to the RESP string *3$3set$4name$7harshita.</p><p>Parsing RESP: Decoding Client Commands</p><p>We’ll build a parser to interpret incoming RESP commands. This involves:</p><ol><li>Identifying the data type: Reading the first byte ($, *, +, etc.).</li><li>Extracting the length: Reading the subsequent digits.</li><li>Reading the data: Retrieving the actual command and arguments.</li><li>Handling CRLF: dealing with the \r\n line endings.</li><li>Recursivly parsing nested types: handling arrays of arrays for example.</li></ol><p>We’ll leverage Go’s bufio package for efficient IO handling. The Resp struct will encapsulate a bufio.Reader and provide methods to parse RESP data.</p><p>Structuring Data: The Value Struct</p><p>To represent parsed RESP data, we’ll define a Value struct, accommodating different types like strings, integers, and arrays. This struct will act as a unified representation of RESP data within our Go application.</p><p>Responding to Clients: The RESP Writer</p><p>We’ll create a writer to serialize server responses into RESP format. This involves:</p><ol><li>Marshalling Value objects: Converting data into RESP byte sequences using a Marshal method.</li><li>Writing bytes to the client: Sending the response using a Writer struct that encapsulates an io.Writer.</li><li>Type Specific marshalling: handling string, array, and error values differently.</li></ol><p>Implementing Redis Commands: Bringing the Database to Life</p><p>We’ll create command handlers for basic Redis commands like PING, SET, GET, HSET, and HGET. These handlers will:</p><ol><li>Receive parsed commands: Extracting arguments from the Value struct.</li><li>Perform operations: Accessing and modifying in-memory data structures (maps).</li><li>Return responses: Constructing Value objects representing the results.</li><li>Handle Errors: Returning error messages when commands are used incorrectly.</li></ol><p>We’ll use Go maps to store data, ensuring thread safety with sync.RWMutex. A Handlers map will associate command names with their corresponding handler functions.</p><p>Ensuring Data Durability: AOF Persistence</p><p>To prevent data loss, we’ll implement Append Only File (AOF) persistence. This involves:</p><ol><li>Logging commands: Appending every write command (SET, HSET) to an AOF file.</li><li>Replaying commands: Reading and executing commands from the AOF file on server startup.</li><li>Synchronization: Syncing the AOF file to disk periodically, ensuring data durability.</li><li>Aof Structure: creating an Aof struct to manage the file, and read/write operations.</li></ol><p>The Aof struct will manage the AOF file, providing methods for writing and reading commands.</p><p>Putting It All Together: The Main Server Loop</p><p>Our main.go file orchestrates the entire process:</p><ol><li>Server Setup: Creating a TCP listener to accept client connections.</li><li>Connection Handling: Accepting incoming connections and spawning goroutines to handle them concurrently.</li><li>RESP Processing: Using the RESP parser and writer to communicate with clients.</li><li>Command Dispatch: Dispatching incoming commands to their respective handlers.</li><li>AOF Integration: Integrating AOF logging and replay into the server loop.</li></ol><p>Key Concepts and Considerations</p><ul><li>Concurrency: Go routines enable efficient handling of multiple client connections.</li><li>Error Handling: Robust error handling is crucial for a stable database.</li><li>Data Structures: Choosing appropriate data structures (maps) is essential for performance.</li><li>IO Operations: Optimizing IO operations is critical for speed.</li><li>RESP Protocol: Understanding the Redis serialization protocol is essential for compatibility.</li><li>Persistence: AOF is a simple and effective persistence mechanism.</li></ul><p>By building this simplified Redis , you’ll gain valuable insights into database design, network communication, and data persistence. This project provides a hands-on approach to understanding the inner workings of in-memory databases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbbba57c0111" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Fiber]]></title>
            <link>https://harshita9104.medium.com/react-fiber-dd24d5271410?source=rss-4e4142475881------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd24d5271410</guid>
            <category><![CDATA[react-fiber]]></category>
            <dc:creator><![CDATA[Harshita Roonwal]]></dc:creator>
            <pubDate>Mon, 09 Dec 2024 13:43:37 GMT</pubDate>
            <atom:updated>2024-12-09T13:43:37.383Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>React Fiber</strong>: A complete rework of React’s core algorithm, aimed to improve performance in animations, layout, and gestures by breaking rendering work into smaller chunks and spreading it across multiple frames.</blockquote><h3>Key Goals of React Fiber</h3><ol><li><strong>Incremental Rendering</strong>: Ability to split rendering work into chunks and spread it out over multiple frames to avoid blocking the main thread.</li><li><strong>Pause, Abort, Reuse Work</strong>: Can pause work, abort it if it’s no longer needed, or reuse previously completed work.</li><li><strong>Prioritize Updates</strong>: Assigns different priority levels to various updates, ensuring more important updates (like user interactions) happen first.</li><li><strong>Concurrency Primitives</strong>: New tools to handle tasks concurrently, improving efficiency.</li></ol><h3>Important Concepts</h3><ul><li><strong>Reconciliation</strong>: The process React uses to update the UI efficiently. It compares the new and old UI trees and only updates the parts that have changed.</li><li><strong>Scheduler</strong>: Determines when and what work should be done, ensuring smooth animations and user interactions by prioritizing important tasks.</li></ul><h3>Understanding Fiber</h3><ul><li><strong>Fiber</strong>: Represents a unit of work. Think of it as a virtual stack frame (a structure that keeps track of function calls).</li><li><strong>Call Stack</strong>: Normally, when a function is called, it’s added to a stack (list of functions to be executed). Fibers allow React to control this process more flexibly.</li></ul><h3>Structure of a Fiber</h3><ul><li><strong>Type and Key</strong>: Identifies the component and helps in efficiently updating lists of items.</li><li><strong>Child and Sibling</strong>: Points to other fibers, forming a tree structure. Child fibers are the result of a component’s render method, and sibling fibers represent multiple children.</li><li><strong>Return</strong>: The fiber to return to after completing the current one, similar to a return address in the call stack.</li><li><strong>PendingProps and MemoizedProps</strong>: Incoming (new) and previous (cached) properties of a component. If they match, it can skip re-rendering.</li><li><strong>PendingWorkPriority</strong>: Indicates the priority of the work represented by the fiber. Higher priority work is done first.</li><li><strong>Alternate</strong>: Represents the current and work-in-progress fibers for a component, allowing efficient updates by reusing fibers.</li></ul><h3>Benefits of React Fiber</h3><ol><li><strong>Smooth User Experience</strong>: By spreading work across frames, it avoids blocking the main thread, ensuring smooth animations and interactions.</li><li><strong>Efficient Updates</strong>: Prioritizes more important updates, like user interactions, over less critical background tasks.</li><li><strong>Flexibility in Handling Work</strong>: Can pause, abort, or reuse work, leading to more efficient performance.</li></ol><h3>Summary</h3><p>React Fiber is designed to make React more suitable for complex and dynamic user interfaces by improving how updates are handled, prioritizing tasks, and allowing more flexibility in managing work. This leads to a smoother user experience and more efficient performance, especially for animations, layouts, and gestures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd24d5271410" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Programming: A Deep Dive into the Target Sum Problem]]></title>
            <link>https://harshita9104.medium.com/dynamic-programming-a-deep-dive-into-the-target-sum-problem-697656e42863?source=rss-4e4142475881------2</link>
            <guid isPermaLink="false">https://medium.com/p/697656e42863</guid>
            <category><![CDATA[dynamic-programming]]></category>
            <category><![CDATA[target-sum]]></category>
            <dc:creator><![CDATA[Harshita Roonwal]]></dc:creator>
            <pubDate>Fri, 06 Dec 2024 10:54:55 GMT</pubDate>
            <atom:updated>2024-12-06T10:54:55.979Z</atom:updated>
            <content:encoded><![CDATA[<p>Dynamic Programming (DP) is a powerful algorithmic technique that can be used to solve a wide range of optimization problems. By breaking down complex problems into simpler subproblems and storing their solutions, DP can significantly improve the efficiency of algorithms.</p><p><strong>Understanding the Core Concepts</strong></p><ol><li><strong>Recursive Substructure:</strong> A problem can be broken down into smaller, self-similar subproblems.</li><li><strong>Overlapping Subproblems:</strong> The same subproblems are solved multiple times.</li></ol><p><strong>How Dynamic Programming Works</strong></p><ol><li><strong>Identify the Base Case(s):</strong> Determine the simplest possible input(s) and their corresponding solutions.</li><li><strong>Formulate the Recurrence Relation:</strong> Express the solution to a problem in terms of solutions to smaller subproblems.</li><li><strong>Implement the Solution:</strong></li></ol><ul><li><strong>Top-Down Approach (Memoization):</strong></li><li>Recursively solve the problem, storing solutions to subproblems in a memoization table to avoid redundant calculations.</li><li><strong>Bottom-Up Approach (Tabulation):</strong></li><li>Iteratively solve subproblems in a bottom-up manner, filling a table with solutions from the base cases to the final solution.</li></ul><p><strong>A Practical Example: The Target Sum Problem</strong></p><p>Given an array of integers nums and a target sum target, find the number of ways to choose a subset of numbers from nums such that their sum equals target.<br><strong>Recursive Solution (Inefficient):</strong></p><p>function targetSum(nums, target) {<br> if (target === 0) return 1;<br> if (nums.length === 0) return 0;</p><p>const currentNum = nums[0];<br> const remainingNums = nums.slice(1);</p><p>// Include the current number<br> const include = targetSum(remainingNums, target — currentNum);</p><p>// Exclude the current number<br> const exclude = targetSum(remainingNums, target);</p><p>return include + exclude;<br>}</p><p>This recursive solution is inefficient due to redundant calculations.</p><p><strong>Memoization (Top-Down):</strong></p><p>function targetSum(nums, target, memo = {}) {<br> const key = `${target}-${nums.length}`;<br> if (key in memo) return memo[key];</p><p>if (target === 0) return 1;<br> if (nums.length === 0) return 0;</p><p>const currentNum = nums[0];<br> const remainingNums = nums.slice(1);</p><p>const include = targetSum(remainingNums, target — currentNum, memo);<br> const exclude = targetSum(remainingNums, target, memo);</p><p>memo[key] = include + exclude;<br> return memo[key];<br>}</p><p><strong>Tabulation (Bottom-Up):</strong></p><p>function targetSum(nums, target) {<br> const dp = new Array(nums.length + 1).fill(0).map(() =&gt; new Array(target + 1).fill(0));</p><p>// Base case: If target is 0, there’s one way to achieve it (empty subset)<br> for (let i = 0; i &lt;= nums.length; i++) {<br> dp[i][0] = 1;<br> }</p><p>for (let i = 1; i &lt;= nums.length; i++) {<br> for (let j = 1; j &lt;= target; j++) {<br> const currentNum = nums[i — 1];<br> if (currentNum &lt;= j) {<br> dp[i][j] = dp[i — 1][j — currentNum] + dp[i — 1][j];<br> } else {<br> dp[i][j] = dp[i — 1][j];<br> }<br> }<br> }</p><p>return dp[nums.length][target];<br>}</p><p><strong>Key Strategies for Tackling Dynamic Programming Problems</strong></p><ol><li><strong>Identify the Subproblems:</strong> Break down the problem into smaller, self-similar subproblems.</li><li><strong>Define the Recurrence Relation:</strong> Express the solution to a problem in terms of solutions to smaller subproblems.</li><li><strong>Choose the Appropriate Approach:</strong> Decide whether a top-down or bottom-up approach is more suitable.</li><li><strong>Optimize the Solution:</strong> Consider space and time complexity optimizations, such as memoization or tabulation.</li></ol><p>By mastering these techniques, you can tackle a wide range of dynamic programming problems with confidence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=697656e42863" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Asynchronous JavaScript: A Deep Dive into Non-Blocking Programming]]></title>
            <link>https://harshita9104.medium.com/mastering-asynchronous-javascript-a-deep-dive-into-non-blocking-programming-7f7813048f87?source=rss-4e4142475881------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f7813048f87</guid>
            <category><![CDATA[callbacks-vs-promises]]></category>
            <category><![CDATA[async-await-javascript]]></category>
            <category><![CDATA[asynchronous-javascript]]></category>
            <dc:creator><![CDATA[Harshita Roonwal]]></dc:creator>
            <pubDate>Fri, 06 Dec 2024 08:05:59 GMT</pubDate>
            <atom:updated>2024-12-06T08:05:59.839Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Understanding Asynchronous Programming</strong></p><p>In the realm of JavaScript, asynchronous programming is a fundamental concept that allows you to write non-blocking code, ensuring your applications remain responsive and efficient. By breaking down complex tasks into smaller, independent units, asynchronous programming enables your code to execute multiple operations concurrently.</p><p><strong>The Synchronous Dilemma</strong></p><p>In synchronous programming, tasks are executed sequentially, one after another. If one task takes a long time, subsequent tasks must wait, leading to potential performance bottlenecks and unresponsive applications.</p><p><strong>The Asynchronous Advantage</strong></p><p>Asynchronous programming, on the other hand, allows tasks to be executed independently, without blocking the main thread. This means that other tasks can continue while one task is waiting for a response or performing a lengthy operation.</p><p><strong>Key Asynchronous Techniques in JavaScript</strong></p><ol><li><strong>Callbacks:</strong> Callbacks are functions passed as arguments to other functions. They are invoked when a particular task completes, allowing for asynchronous execution. However, nesting multiple callbacks can lead to “callback hell,” making code harder to read and maintain.</li><li><strong>Promises:</strong> Promises represent the eventual completion (or failure) of an asynchronous operation. They provide a more structured approach to handling asynchronous code, allowing you to chain operations and handle errors gracefully.</li><li><strong>Async/Await:</strong> Async/await is a syntactic sugar built on top of Promises. It allows you to write asynchronous code in a more synchronous-like style, making it easier to read and write.</li></ol><p><strong>A Practical Example: Building an Ice Cream Shop</strong></p><p>Let’s imagine we’re building a virtual ice cream shop. We have several tasks:</p><ol><li><strong>Taking an Order:</strong> This involves selecting a flavor and placing an order.</li><li><strong>Preparing the Ice Cream:</strong> This includes chopping fruit, adding water and ice, and starting the machine.</li><li><strong>Adding Toppings:</strong> The final step is to add toppings like chocolate or sprinkles.</li></ol><p><strong>Synchronous Approach (Inefficient):</strong></p><p>function takeOrder(flavor) {<br> console.log(`Customer ordered ${flavor} ice cream.`);<br>}</p><p>function prepareIceCream(flavor) {<br> console.log(`Preparing ${flavor} ice cream.`);<br> // Simulate a long process<br> setTimeout(() =&gt; {<br> console.log(`${flavor} ice cream is ready.`);<br> }, 2000);<br>}</p><p>function addToppings(topping) {<br> console.log(`Adding ${topping} topping.`);<br>}</p><p>takeOrder(“Chocolate”);<br>prepareIceCream(“Chocolate”);<br>addToppings(“Chocolate Sprinkles”);</p><p>In this synchronous approach, each step must complete before the next one can start. This can lead to a significant delay.</p><p><strong>Asynchronous Approach (Efficient):</strong></p><p><strong>Using Callbacks:</strong></p><p>function takeOrder(flavor, callback) {<br> console.log(`Customer ordered ${flavor} ice cream.`);<br> callback();<br>}</p><p>function prepareIceCream(callback) {<br> setTimeout(() =&gt; {<br> console.log(“Ice cream is ready.”);<br> callback();<br> }, 2000);<br>}</p><p>function addToppings(callback) {<br> setTimeout(() =&gt; {<br> console.log(“Toppings added.”);<br> callback();<br> }, 1000);<br>}</p><p>takeOrder(“Chocolate”, () =&gt; {<br> prepareIceCream(() =&gt; {<br> addToppings(() =&gt; {<br> console.log(“Ice cream served!”);<br> });<br> });<br>});</p><p>While callbacks allow for asynchronous execution, nested callbacks can make code difficult to read and maintain.</p><p><strong>Using Promises:</strong></p><p>function takeOrder(flavor) {<br> return new Promise((resolve, reject) =&gt; {<br> console.log(`Customer ordered ${flavor} ice cream.`);<br> resolve();<br> });<br>}</p><p>function prepareIceCream() {<br> return new Promise((resolve, reject) =&gt; {<br> setTimeout(() =&gt; {<br> console.log(“Ice cream is ready.”);<br> resolve();<br> }, 2000);<br> });<br>}</p><p>function addToppings() {<br> return new Promise((resolve, reject) =&gt; {<br> setTimeout(() =&gt; {<br> console.log(“Toppings added.”);<br> resolve();<br> }, 1000);<br> });<br>}</p><p>takeOrder(“Chocolate”)<br> .then(prepareIceCream)<br> .then(addToppings)<br> .then(() =&gt; console.log(“Ice cream served!”))<br> .catch(error =&gt; console.error(error));</p><p>Promises provide a cleaner and more readable way to handle asynchronous operations.</p><p><strong>Using Async/Await:</strong></p><p>async function makeIceCream() {<br> await takeOrder(“Chocolate”);<br> await prepareIceCream();<br> await addToppings();<br> console.log(“Ice cream served!”);<br>}</p><p>makeIceCream();</p><p>Async/await syntax further simplifies asynchronous code, making it look more like synchronous code.</p><p>By understanding and effectively utilizing asynchronous programming techniques, you can build more responsive, efficient, and user-friendly web applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f7813048f87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of Browser APIs]]></title>
            <link>https://harshita9104.medium.com/unleashing-the-power-of-browser-apis-cd7f8406fb5e?source=rss-4e4142475881------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd7f8406fb5e</guid>
            <category><![CDATA[browser-api]]></category>
            <category><![CDATA[html-dom]]></category>
            <category><![CDATA[promises]]></category>
            <category><![CDATA[fetch-api]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Harshita Roonwal]]></dc:creator>
            <pubDate>Fri, 06 Dec 2024 07:48:55 GMT</pubDate>
            <atom:updated>2024-12-06T07:48:55.333Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Understanding Browser APIs</strong></p><p>Browser APIs are a set of functionalities built into web browsers that allow developers to interact with the browser’s environment and underlying hardware. These APIs expand the capabilities of JavaScript, enabling the creation of dynamic and interactive web applications.</p><p><strong>Key Browser APIs and Their Applications</strong></p><p><strong>Fetch API:</strong></p><ul><li>Simplifies making network requests to fetch data from servers.</li><li>Leverages Promises for asynchronous operations, ensuring smooth and non-blocking execution.</li><li>Enables efficient data retrieval and manipulation, crucial for building modern web applications.</li></ul><p><strong>DOM (Document Object Model) API:</strong></p><ul><li>Provides programmatic access to the HTML and CSS structure of a web page.</li><li>Allows for dynamic manipulation of elements, styles, and content.</li><li>Enables the creation of interactive user interfaces that respond to user input and events.</li><li>The HTML DOM API is a subset of the DOM API specifically designed for HTML documents. It provides access to HTML elements and their properties, allowing developers to modify the document’s structure and content.</li></ul><p><strong>Request and Response Objects:</strong></p><ul><li>Represent the communication between a client and a server.</li><li>Request objects encapsulate details like the URL, method, headers, and body of a request.</li><li>Response objects contain the status code, headers, and body of a server’s response.</li></ul><p><strong>Promises:</strong></p><ul><li>Handle asynchronous operations in a more elegant and readable way.</li><li>Provide a structured approach to managing asynchronous code, avoiding callback hell.</li><li>Ensure that operations are executed in the correct order, even when they are asynchronous.</li></ul><p><strong>Leveraging Browser APIs: A Practical Example</strong></p><p>Let’s explore how we can use the Fetch API and Promises to fetch data from a REST API and display it on a web page:</p><p>fetch(“https://api.example.com/data&quot;)</p><p>.then((response) =&gt; response.json())</p><p>.then((data) =&gt; {</p><p>// Update the DOM using the HTML DOM API</p><p>const container = document.getElementById(“data-container”);</p><p>container.innerHTML = `</p><p>&lt;h2&gt;Fetched Data&lt;/h2&gt;</p><p>&lt;p&gt;${data.message}&lt;/p&gt;</p><p>`;</p><p>})</p><p>.catch((error) =&gt; {</p><p>console.error(“Error fetching data:”, error); // Handle errors gracefully, e.g., display an error message to the user</p><p>});</p><p>In this example:</p><ol><li>We use fetch() to send a GET request to the specified URL.</li><li>The response is parsed as JSON using response.json().</li><li>The parsed data is then used to update the DOM, displaying the fetched message. We access and modify the DOM elements using the HTML DOM API.</li><li>Error handling is implemented using a catch block to handle potential issues during the fetch process.</li></ol><p><strong>Why Browser APIs Matter</strong></p><p>Browser APIs empower developers to create:</p><ul><li><strong>Dynamic Web Applications:</strong> Build web apps that can update content without full page reloads, enhancing user experience.</li><li><strong>Interactive User Interfaces:</strong> Create engaging interfaces with responsive elements that react to user input.</li><li><strong>Offline Functionality:</strong> Develop web apps that can work offline, storing data locally and syncing when the device is online.</li><li><strong>Cross-Platform Compatibility:</strong> Write code that can run on different browsers and devices, ensuring a consistent user experience.</li><li><strong>Real-Time Applications:</strong> Build real-time applications like chat apps and collaborative tools using WebSockets and other APIs.</li></ul><p>By understanding and effectively utilizing Browser APIs, you can unlock the full potential of web development and create innovative and engaging digital experiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd7f8406fb5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Changing Morals]]></title>
            <link>https://medium.com/the-iiitm-narrative/changing-morals-d1b392596e15?source=rss-4e4142475881------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1b392596e15</guid>
            <category><![CDATA[morality]]></category>
            <dc:creator><![CDATA[Harshita Roonwal]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 06:32:34 GMT</pubDate>
            <atom:updated>2023-02-08T06:32:34.692Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*381kJvtSoS8IlBpv7zsdQQ.jpeg" /></figure><p><strong>The concept of Morality has always eluded me. Is it a lesson that I have learned or is it a set of standard guiding principles?</strong></p><p><strong>For instance, when I see a person in extreme pain and suffering, I approach the man to help him and end up getting mugged. So what’s the lesson learnt? Never help a person in pain.</strong></p><p><strong>However, I had adhered to the standard guiding principle of helping someone. Was I wrong? Certainly not! There are several examples where a good man gets beaten by bad luck. Should my morals be abandoned then?</strong></p><p><strong>That’s where your sense of wise judgment kicks in. You chose your morality based on the person and situation.</strong></p><p><strong>Being right or wrong is an outcome, while making your choices you only consider what’s best for you and the people around you. One cannot control the outcome but only choices based on selective morality.</strong></p><p><strong>Then how do we define morality?</strong></p><p><strong>Morality differs from ethics. Morality is innate. Sometimes it needs to be learned, and other times we feel it within us.</strong></p><p><strong>However the definition of morality rests in how we perceive others, and their importance (or unimportance) to ourselves. Morality is relational and derives from our beliefs about ourselves, and others.</strong></p><p><strong>As outlined in the book ‘Whose Keeper?’ by Alan Wolfe that every moral theory is, after all, a theory of the self , when human agents are viewed as self-interested utility maximizers, we can be fairly certain that the theory’s initial assumptions about the self will lead to certain moral positions — such as a belief in freedom of choice.</strong></p><p><strong>On the other hand , sometimes there are moral responsibilities that an individual needs to fulfill.</strong></p><p><strong>These two views of human agency have tended to dominate discussions of moral accountability, emphasizing either obligations to the self at the expense of others or obligations to others at the expense of the self.</strong></p><p><strong>I may sound rude here but the fact is that people are neither inherently moral or immoral: they are merely torn between the desire to act selfishly to get what they want and the recognition that only society can prevent them from doing so. We are not social because we are moral; we are moral because we live together with others and therefore need periodically to account for who we are.</strong></p><p><strong>Moral understanding is not the only thing that changes as people mature. People’s values tend to change over time as well. Values that suited you as a child change as you become a young adult, form relationships and make your way to the world.</strong></p><p><strong>Psychologists also propose that people have an innate sense of values and personal preferences that tends to get buried under layers of social demands and expectations.</strong></p><p><strong>Though the very structure of human existence dictates that we must make choices and ethics helps us use our freedom responsibly and understand who we are. Ethics gives direction in our struggle to answer the fundamental questions that ask how we should live our lives and how we can make right choices.</strong></p><p><strong>In the end , morality matters because we have reputations to protect, cooperative tasks to carry out, legacies to leave, others to love, and careers to follow and I think people today vary in their moral thinking as cultures evolve and societies develop, people’s ways of thinking about good and evil also transform and we need to accept it.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1b392596e15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-iiitm-narrative/changing-morals-d1b392596e15">Changing Morals</a> was originally published in <a href="https://medium.com/the-iiitm-narrative">The IIITM Narrative</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>