<?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 Thesha Aravinthan on Medium]]></title>
        <description><![CDATA[Stories by Thesha Aravinthan on Medium]]></description>
        <link>https://medium.com/@aravinthanthesha?source=rss-96950c3a4745------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*G-IfjHn1f4JcoZJ2</url>
            <title>Stories by Thesha Aravinthan on Medium</title>
            <link>https://medium.com/@aravinthanthesha?source=rss-96950c3a4745------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 15:33:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aravinthanthesha/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[Purpose of “use client” in Next.JS]]></title>
            <link>https://medium.com/@aravinthanthesha/purpose-of-use-client-in-next-js-d243ddadaf7d?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/d243ddadaf7d</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 15:10:27 GMT</pubDate>
            <atom:updated>2026-03-10T15:10:27.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DfiqRXGESqx-oWor3BtXbA.png" /></figure><p>In Next.js, the “use client” directive is used to specify that a component should run on the client side rather than on the server. In the newer Next.js App Router architecture, components are treated as server components by default. Server components are rendered on the server and sent to the browser as static HTML, which improves performance and reduces the amount of JavaScript sent to the client. However, some components require interaction with the user or need access to browser features, and this is where the “use client” directive becomes important.</p><p>The “use client” directive tells Next.js that a component should be executed in the browser. This allows the component to use client-side features such as state management, event handlers, and browser APIs. For example, if a component uses functions like useState, useEffect, or handles button clicks and form inputs, it needs to run on the client side. Without declaring “use client”, these features would not work properly because server components do not support interactive behavior.</p><p>Another important purpose of “use client” is enabling dynamic user interactions. Many modern web applications include interactive elements such as dropdown menus, modals, search bars, and real-time updates. These features require the browser to handle events and update the interface instantly. By marking a component with “use client”, developers allow the browser to control these interactions, making the user experience smoother and more responsive.</p><p>The directive also helps developers control how their application is structured. In Next.js, server components can handle tasks such as data fetching, database communication, and rendering static content. Client components focus more on user interface interactions and state changes. This separation improves performance because only the necessary parts of the application are sent to the browser as JavaScript, while the rest can remain on the server.</p><p>Using “use client” properly also helps optimize application performance. Since server components reduce the amount of JavaScript that needs to be downloaded by the user’s browser, the website loads faster. Developers can choose to make only certain components client components while keeping the rest as server components. This balance ensures that the application remains efficient while still providing interactive functionality.</p><p>Overall, the purpose of “use client” in Next.js is to allow developers to create interactive components that run in the browser while still benefiting from the performance advantages of server components. By clearly defining which components should run on the client side, Next.js applications can be built in a way that is both efficient and responsive, providing a better experience for users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d243ddadaf7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How SEO Helps to People Find Your Website on Google]]></title>
            <link>https://medium.com/@aravinthanthesha/how-seo-helps-to-people-find-your-website-on-google-b92352e4985a?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/b92352e4985a</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 04:48:55 GMT</pubDate>
            <atom:updated>2026-03-10T04:48:55.613Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGbYLDuJkSh5MuUoGSMySw.png" /></figure><p>Search Engine Optimization, commonly known as SEO, is the process of improving a website so that it appears higher in search engine results like Google. Every day, billions of people use Google to search for information, products, services, and answers to their questions. When someone types a search query into Google, the search engine scans millions of websites and decides which pages are the most relevant to display. SEO helps websites become more visible in these search results so that people can easily discover them.</p><p>One of the most important aspects of SEO is understanding how search engines work. Google uses complex algorithms to analyze websites and determine which pages provide the most useful and relevant information for a user’s search. These algorithms consider many factors such as keywords, content quality, website structure, page speed, and user experience. By optimizing these factors, websites can improve their chances of ranking higher on search result pages.</p><p>Keywords play a major role in helping search engines understand what a webpage is about. Keywords are the words or phrases that people type into Google when they are searching for something. For example, if someone searches for “best travel apps” or “how to plan a vacation,” websites that include these phrases in their content have a higher chance of appearing in the results. However, modern SEO focuses on natural and meaningful content rather than simply repeating keywords. Search engines prioritize content that genuinely answers users’ questions and provides useful information.</p><p>Content quality is another important element of SEO. Websites that publish clear, helpful, and informative content are more likely to rank higher on Google. Blog articles, guides, tutorials, and reviews are common ways websites provide value to users. When a website consistently publishes high-quality content, search engines begin to recognize it as a reliable source of information. This increases the chances of the website appearing in search results when users look for related topics.</p><p>Technical aspects of a website also influence SEO performance. Search engines prefer websites that load quickly, are mobile-friendly, and have a well-organized structure. Since many users access websites through smartphones, Google prioritizes sites that work smoothly on mobile devices. Secure websites that use HTTPS and have clear navigation structures also perform better in search rankings. These improvements not only help search engines understand the website better but also provide a better experience for visitors.</p><p>Backlinks are another important factor that helps improve SEO. A backlink is a link from another website that points to your website. When reputable websites link to your content, search engines see this as a sign that your website is trustworthy and valuable. The more high-quality backlinks a site receives, the stronger its authority becomes in search results. This helps increase visibility and attract more visitors from Google.</p><p>User behavior also influences SEO results. Search engines observe how users interact with websites after clicking on them. If visitors stay on a website longer, read the content, and explore other pages, it signals that the website is useful and relevant. On the other hand, if users leave the page quickly, search engines may assume the content is not helpful. Therefore, creating engaging and valuable content is essential for maintaining strong SEO performance.</p><p>Overall, SEO helps connect people who are searching for information with websites that provide the answers they need. By improving keywords, content quality, technical performance, and website credibility, businesses and creators can increase their chances of appearing in Google search results. As a result, more people can discover the website, leading to higher traffic, better visibility, and greater opportunities for growth.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b92352e4985a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrate backend with frontend using Axios]]></title>
            <link>https://medium.com/@aravinthanthesha/integrate-backend-with-frontend-using-axios-eb63054a9282?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb63054a9282</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Mon, 09 Mar 2026 06:57:06 GMT</pubDate>
            <atom:updated>2026-03-09T06:57:06.721Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZzFRFzX1BSGgYe86hjLpA.png" /></figure><p>Integrating the backend with the frontend is an important step in web development because it allows the user interface to communicate with the server and exchange data. A frontend application is responsible for what users see and interact with, while the backend manages data, business logic, authentication, and communication with the database. To connect these two parts smoothly, developers often use Axios, which is a popular JavaScript library for making HTTP requests.</p><p>Axios helps the frontend send requests to backend APIs in a simple and organized way. For example, when a user logs in, registers, views profile details, or submits a form, the frontend needs to send data to the backend and receive a response. Axios makes this process easier by allowing developers to send requests such as GET, POST, PUT, PATCH, and DELETE with clean syntax. It also supports handling JSON data, request headers, error responses, and authentication tokens, which makes it very useful for full stack applications.</p><p>When integrating the backend with the frontend using Axios, the first step is usually to make sure the backend API is properly running and accessible. The backend should expose routes or endpoints that the frontend can call. For example, there may be endpoints for user registration, login, fetching trip details, updating a profile, or deleting data. Once those APIs are ready, Axios can be installed in the frontend project and used to send requests to those backend routes.</p><p>In a typical application, Axios is imported into frontend files where API communication is needed. Developers can either write requests directly inside components or create a separate API service file to keep the code cleaner and more reusable. For example, a login form can use Axios to send the entered username and password to the backend. If the backend validates the credentials successfully, it can return a success response along with a token or user data. The frontend can then store that token and use it for future authorized requests.</p><p>One of the major advantages of Axios is that it supports promise-based asynchronous programming. This means the frontend can send a request and wait for the response without freezing the user interface. Using async and await with Axios makes the code easier to read and maintain. It also allows proper error handling, which is important because requests can fail due to incorrect input, network issues, server errors, or unauthorized access. With Axios, developers can catch these errors and show meaningful messages to users.</p><p>Another useful feature of Axios is the ability to set a base URL and default headers. This is especially helpful when many requests are being sent to the same backend server. Instead of repeating the full backend URL in every request, developers can create an Axios instance and define the server address once. This improves code quality and makes updates easier if the backend URL changes later. It also helps when adding authorization tokens in request headers for protected routes.</p><p>Axios is also commonly used together with React, Vue, or other frontend frameworks to fetch data when a page loads or when a user performs an action. For example, in a travel planning platform, Axios can be used to fetch destinations, submit booking details, retrieve recommended itineraries, or send chat messages to an AI assistant. This creates dynamic and interactive applications where the frontend and backend work together in real time.</p><p>To complete backend and frontend integration successfully, developers must ensure that both sides handle data consistently. The request body sent from the frontend should match what the backend expects, and the backend response should be structured clearly so the frontend can process it easily. It is also important to handle CORS properly, because the frontend and backend may run on different ports during development. Without CORS configuration, the browser may block the requests.</p><p>In conclusion, integrating the backend with the frontend using Axios is a practical and essential process in modern web development. Axios simplifies API communication and helps developers send, receive, and manage data between the client side and server side efficiently. By using Axios properly, developers can build applications that are responsive, interactive, and capable of handling real world user actions smoothly.</p><p><strong>Completion Requirements</strong></p><p>The backend server should be running properly with working API endpoints. The frontend project should have Axios installed and configured correctly. The frontend must be able to send requests to the backend and receive responses without errors. Forms such as login, register, or data submission should connect successfully to backend routes. Error handling should be implemented for failed requests. If authentication is used, tokens should be stored and sent correctly in request headers. CORS settings should allow communication between frontend and backend. Finally, the integrated feature should be tested to confirm that data flows correctly in both directions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb63054a9282" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Netflix Decides What Movies to Recommend You]]></title>
            <link>https://medium.com/@aravinthanthesha/how-netflix-decides-what-movies-to-recommend-you-f4afa9ce36f3?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4afa9ce36f3</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Mon, 09 Mar 2026 04:36:00 GMT</pubDate>
            <atom:updated>2026-03-09T04:36:00.135Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bc9ULmzZF8gMeFiz_9_s-g.png" /></figure><p>When you open Netflix, the movies and TV shows that appear on your screen are not random. Netflix uses advanced technology and powerful recommendation algorithms to decide what content should be shown to each user. The main goal of the platform is to help viewers quickly find something they will enjoy watching without spending too much time searching. With millions of titles available and millions of users watching every day, Netflix relies heavily on data and artificial intelligence to personalize the viewing experience for each individual.</p><p>One of the most important factors Netflix uses is <strong>user behavior</strong>. Every action you perform on the platform provides useful information to the system. For example, Netflix tracks what shows or movies you watch, how long you watch them, what you search for, and what you skip or stop watching. If a user regularly watches crime dramas, thrillers, or romantic movies, Netflix starts recognizing these patterns. Over time, the system builds a unique viewing profile for that user. This profile helps the platform understand the user’s preferences and show more content that matches those interests.</p><p>Netflix also uses <strong>machine learning algorithms</strong> to improve its recommendations. Machine learning allows the system to analyze huge amounts of data collected from millions of viewers around the world. The algorithm looks for patterns in user behavior and compares them with other users who have similar watching habits. For example, if two users frequently watch the same types of shows, the system may recommend a movie to one user that the other user enjoyed. This method is known as collaborative filtering, and it plays a major role in helping Netflix predict what viewers might want to watch next.</p><p>Another important element in Netflix’s recommendation system is <strong>content analysis</strong>. Netflix does not simply categorize movies into basic genres such as comedy, action, or drama. Instead, it uses thousands of detailed tags and micro-genres to describe the content more accurately. These tags can include things like “dark comedy,” “emotional drama,” “strong female lead,” or “fast-paced action thriller.” By analyzing these small details, Netflix can match movies and shows more precisely with a user’s interests. This allows the platform to recommend very specific content that a viewer might not have discovered otherwise.</p><p>User interaction also plays a significant role in shaping recommendations. When users like a movie, rate it, or add it to their watchlist, they are giving direct feedback to the system. Even smaller actions, such as hovering over a title, watching a trailer, or clicking on certain categories, provide signals about what the user might enjoy. Netflix constantly learns from these interactions and adjusts the recommendations accordingly. The more a user watches and interacts with the platform, the more accurate and personalized the recommendations become.</p><p>Netflix even personalizes the <strong>visual presentation of content</strong>. Different users may see different thumbnails or preview images for the same movie or show. For example, if a user frequently watches romantic films, Netflix might display a thumbnail showing a romantic scene from the movie. On the other hand, a user who prefers action movies might see an action scene from the same film. This strategy increases the likelihood that a user will click on the title because the image appears more relevant to their interests.</p><p>In addition to individual viewing behavior, Netflix also considers other factors such as <strong>time of day, trending content, and regional popularity</strong>. For example, light and entertaining shows might be recommended during the evening, while trending series or newly released movies may be highlighted to attract attention. Netflix also adapts recommendations based on different countries and cultures so that users see content that is popular or relevant in their region.</p><p>Overall, Netflix’s recommendation system is a complex combination of data analysis, artificial intelligence, and user interaction. By continuously learning from millions of users and analyzing viewing patterns, Netflix is able to provide highly personalized suggestions that help viewers discover new content. This intelligent recommendation system is one of the key reasons why Netflix remains one of the most successful streaming platforms in the world, making it easier for users to find movies and shows that match their tastes and interests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4afa9ce36f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why react now recommends function components instead of class components]]></title>
            <link>https://medium.com/@aravinthanthesha/why-react-now-recommends-function-components-instead-of-class-components-f94d86528a05?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/f94d86528a05</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 09:04:32 GMT</pubDate>
            <atom:updated>2025-12-31T09:04:32.111Z</atom:updated>
            <content:encoded><![CDATA[<p>React today strongly recommends function components over class components because they provide a simpler, more modern, and more powerful way to build user interfaces. When React was first introduced, class components were necessary to handle state and lifecycle methods, while function components were mostly used for simple, stateless UI. Over time, this distinction became a limitation, as class components introduced complexity such as the need to understand this binding, verbose syntax, and scattered logic across multiple lifecycle methods. These factors made components harder to read, maintain, and reuse, especially as applications grew larger.</p><p>The introduction of Hooks completely changed how developers write React components and is the main reason function components are now preferred. Hooks allow function components to manage state, handle side effects, and tap into lifecycle-like behavior without relying on classes. This leads to cleaner and more predictable code because related logic can be grouped together instead of being split across different lifecycle methods. As a result, developers can focus more on what the component does rather than how it fits into the class-based lifecycle model.</p><p>Function components also improve code readability and reusability. Custom Hooks make it easy to extract and share logic across components without using complex patterns like higher-order components or render props, which were common in the class-based era. This promotes better separation of concerns and makes the codebase easier to test and reason about. Since function components are just JavaScript functions, they align naturally with modern JavaScript features and functional programming concepts, making them more intuitive for many developers.</p><p>From a performance and future-proofing perspective, function components fit better with React’s long-term vision. They work seamlessly with newer features such as Concurrent Rendering and Server Components, which are designed with function components and Hooks in mind. While class components are still supported for backward compatibility, they are no longer the focus of new React development. By encouraging function components, React provides a more consistent, flexible, and scalable approach to building applications, helping developers write code that is easier to maintain and better suited for the evolving React ecosystem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f94d86528a05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential things to consider when converting Html template to React]]></title>
            <link>https://medium.com/@aravinthanthesha/essential-things-to-consider-when-converting-html-template-to-react-06ece753583f?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/06ece753583f</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 08:06:02 GMT</pubDate>
            <atom:updated>2025-12-31T08:06:02.565Z</atom:updated>
            <content:encoded><![CDATA[<p>Converting a static HTML template into a React application is a common task in modern front-end development. While HTML templates focus mainly on structure and design, React applications are built around components, state, and dynamic rendering. Understanding the key considerations during this conversion process helps developers avoid common mistakes and build clean, maintainable React applications.</p><p>One of the first things to consider is breaking the HTML template into reusable React components. In plain HTML, all elements are often written in a single file, but React encourages a component-based architecture. Sections such as headers, footers, navigation bars, cards, and forms should be separated into individual components. This improves readability, reusability, and makes the application easier to manage as it grows.</p><p>Another important consideration is replacing HTML attributes with JSX syntax. React uses JSX, which is similar to HTML but follows JavaScript rules. Attributes like class must be changed to className, and inline styles must be written as JavaScript objects. Self-closing tags must also be properly closed. Ignoring these syntax changes can lead to errors during rendering.</p><p>Handling dynamic content is another key aspect of the conversion process. In HTML templates, content is usually static, but React applications often rely on dynamic data. Text, images, and lists should be rendered using JavaScript expressions inside JSX. Repeated elements should be generated using array methods like map, rather than copying and pasting HTML code. This approach makes the UI data-driven and easier to update.</p><p>Managing state and user interactions is also essential when moving to React. In HTML templates, interactivity is often handled with direct DOM manipulation or inline JavaScript. In React, state is used to manage data that changes over time, and event handling is done using React’s synthetic events. Instead of manually updating the DOM, developers update the state and let React handle the UI changes automatically.</p><p>Another important factor is handling external libraries and assets correctly. CSS files, images, and JavaScript libraries included in an HTML template need to be properly imported into the React project. Some JavaScript plugins that rely on direct DOM manipulation may not work well with React and may need React-friendly alternatives or custom implementations.</p><p>Performance and optimization should also be considered during the conversion. React efficiently updates the UI using the Virtual DOM, but unnecessary re-renders can still affect performance. Structuring components properly and avoiding excessive state updates helps keep the application fast and responsive.</p><p>In conclusion, converting an HTML template to React is not just about copying markup into JSX. It requires rethinking the structure in terms of components, adapting syntax to JSX, managing state instead of direct DOM manipulation, and ensuring assets and interactivity are handled the React way. By carefully considering these aspects, developers can successfully transform static HTML templates into dynamic, scalable React applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06ece753583f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why JS Uses Asynchronous]]></title>
            <link>https://medium.com/@aravinthanthesha/why-js-uses-asynchronous-b7835cbfd7ce?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7835cbfd7ce</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 04:24:42 GMT</pubDate>
            <atom:updated>2025-12-30T04:24:42.159Z</atom:updated>
            <content:encoded><![CDATA[<p>JavaScript is one of the most widely used programming languages for building modern web applications. It is responsible for handling user interactions, updating the user interface, and communicating with servers. One of the key design choices in JavaScript is the use of asynchronous programming. This approach allows JavaScript to perform time-consuming tasks efficiently without stopping the entire application.</p><p>JavaScript is a single-threaded language, which means it can execute only one operation at a time. If JavaScript followed only synchronous execution, any long-running task such as fetching data from a server or reading a large file would block the main thread. During this time, the web page would become unresponsive, buttons would not work, and animations would freeze. This would result in a poor user experience, especially in interactive applications.</p><p>Asynchronous programming allows JavaScript to start a task and continue executing other code without waiting for that task to finish. When the task is completed, JavaScript processes the result later. This behavior is especially useful for operations that take time, such as API calls, timers, and event handling. By not waiting for these tasks to complete immediately, JavaScript ensures that the application remains responsive.</p><p>Behind the scenes, JavaScript relies on an event-driven architecture. When an asynchronous operation begins, it is handled by the browser or runtime environment while JavaScript continues running other code. Once the operation finishes, its callback is placed in a queue. The event loop continuously checks whether the call stack is empty and then executes the queued callback. This mechanism enables JavaScript to manage multiple tasks efficiently without true parallel execution.</p><p>If JavaScript were purely synchronous, modern web applications would struggle to function smoothly. Pages would take longer to load, user interactions would feel slow, and applications would not be able to handle multiple tasks at the same time. Asynchronous programming solves these issues by allowing JavaScript to perform background operations while keeping the user interface active.</p><p>Asynchronous behavior also improves performance and scalability. In environments like Node.js, it allows a single server to handle many client requests efficiently without blocking. Developers can write cleaner and more maintainable code using modern asynchronous features such as promises and async-await, which make asynchronous logic easier to understand and manage.</p><p>In conclusion, JavaScript uses asynchronous programming because it is single-threaded and needs a way to handle long-running tasks without blocking the user interface. Asynchronous execution ensures better performance, smoother user experience, and the ability to build fast and scalable applications. This design choice plays a crucial role in making JavaScript suitable for modern, real-time web development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7835cbfd7ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why React uses Virtual DOM instead of direct DOM manipulation]]></title>
            <link>https://medium.com/@aravinthanthesha/why-react-uses-virtual-dom-instead-of-direct-dom-manipulation-b23814c4fa51?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/b23814c4fa51</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 04:22:14 GMT</pubDate>
            <atom:updated>2025-12-30T04:22:14.758Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern web applications are becoming more complex and interactive. Users expect fast updates, smooth animations, and instant responses. To achieve this performance, React uses a powerful concept called the <strong>Virtual DOM</strong> instead of directly manipulating the <strong>Real DOM</strong>. Understanding why React follows this approach helps developers write better and more efficient applications.</p><h3>Understanding the Real DOM</h3><p>The <strong>DOM (Document Object Model)</strong> is a tree-like structure that represents all the elements on a web page. When JavaScript directly changes the DOM — such as updating text, styles, or layout the browser must recalculate styles, reflow the layout, and repaint the screen. These operations are expensive and slow, especially when they happen frequently.</p><p>In traditional JavaScript applications, every small change directly affects the DOM. When many updates occur at once, performance drops and the application feels sluggish.</p><h3>What Is the Virtual DOM?</h3><p>The <strong>Virtual DOM</strong> is a lightweight JavaScript object that acts as a copy of the real DOM. React keeps this virtual representation in memory. When the state of a component changes, React updates the Virtual DOM first instead of immediately touching the real DOM.</p><p>This allows React to calculate changes efficiently without affecting the actual page instantly.</p><h3>How React Uses the Virtual DOM</h3><p>When data changes in a React application, the following steps occur:</p><p>First, React creates a new Virtual DOM with the updated state. Then, it compares this new Virtual DOM with the previous version using a process called <strong>diffing</strong>. After finding only the changed elements, React updates just those parts in the real DOM. This process is known as <strong>reconciliation</strong>.</p><p>By updating only what is necessary, React avoids unnecessary DOM operations and improves performance.</p><h3>Why Direct DOM Manipulation Is Not Efficient</h3><p>Direct DOM manipulation forces the browser to recalculate and repaint the UI every time a change happens. When multiple updates occur, this can significantly slow down the application. Managing these updates manually also increases code complexity and makes applications harder to maintain.</p><p>In contrast, React automates this process and optimizes updates behind the scenes.</p><h3>Benefits of Using the Virtual DOM</h3><p>One major advantage is <strong>better performance</strong>. Since React minimizes direct DOM access, applications run faster and smoother. Another benefit is <strong>predictability</strong> — the UI becomes a function of the state, making bugs easier to track. The Virtual DOM also improves <strong>developer productivity</strong> by allowing developers to focus on logic instead of manual DOM updates.</p><p>Additionally, React’s approach makes it easier to build large-scale applications that are maintainable and scalable.</p><p>React uses the Virtual DOM because direct DOM manipulation is slow, inefficient, and difficult to manage in complex applications. By maintaining a Virtual DOM, React efficiently calculates changes and updates only what is needed in the real DOM. This results in faster performance, cleaner code, and a better user experience.</p><p>The Virtual DOM is one of the key reasons why React has become one of the most popular front-end libraries in modern web development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b23814c4fa51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential DOM Methods in JavaScript]]></title>
            <link>https://medium.com/@aravinthanthesha/essential-dom-methods-in-javascript-fdc23ac1a17f?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdc23ac1a17f</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Tue, 09 Dec 2025 07:03:31 GMT</pubDate>
            <atom:updated>2025-12-09T07:03:31.193Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pguoOQ20KJ3XeUwKZvcBWA.png" /></figure><p>When building interactive web pages, the Document Object Model (DOM) plays a vital role in how JavaScript communicates with HTML elements. The DOM acts like a bridge between your code and the browser, giving you the power to select, create, modify, or remove elements dynamically. Understanding the essential DOM methods is the first step toward creating modern, responsive, and user-friendly web experiences. These methods help you change content, update styles, react to user actions, and build fully interactive interfaces.</p><p>One of the most commonly used DOM methods is <strong>document.getElementById</strong>, which allows developers to select a single HTML element using its unique ID. It is fast, direct, and ideal for accessing key components like forms, buttons, or sections. Along with this, methods such as <strong>document.querySelector()</strong> and <strong>document.querySelectorAll()</strong> offer more flexibility. They allow you to select elements using CSS selectors, making it easy to target classes, tags, or even more complex nested structures. These modern selection methods help keep code cleaner and easier to maintain.</p><p>Another essential part of DOM manipulation is <strong>creating and modifying elements</strong>. Methods like <strong>document.createElement()</strong> let you generate new HTML elements on the fly, while <strong>appendchild()</strong>, <strong>prepend() </strong>and <strong>insertBefore()</strong> help place them at the right location in the page. This is extremely useful when adding dynamic lists, messages, or UI components based on user actions or data from APIs. In addition, properties like <strong>innerHTML</strong>, <strong>textContent </strong>and <strong>setAttribute()</strong> let you update the content, structure, or attributes of elements instantly.</p><p>Event handling is another core aspect of DOM programming. With <strong>addEventListener()</strong>, you can listen to user interactions such as clicks, keypresses, mouse movements, or form submissions. This method ensures your elements can respond to real-time actions without refreshing the page. Whether you&#39;re validating a form, triggering animations, or showing a popup message, event listeners are the foundation of interactive web behavior. They can be attached, modified, or removed cleanly, making them essential for building dynamic applications.</p><p>Finally, JavaScript also provides powerful ways to <strong>remove</strong> or <strong>replace</strong> elements when needed. Methods like<strong> removeChild()</strong>, <strong>replaceChild() </strong>and <strong>element.remove() </strong>help you maintain a clean and updated UI. These become important when hiding notifications, deleting items from a list, or updating parts of the page after an action. Together, all these DOM methods form the building blocks of frontend development, allowing developers to create pages that feel alive and responsive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdc23ac1a17f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Behind the Magic: How Google Translate Works Behind the Scenes]]></title>
            <link>https://medium.com/@aravinthanthesha/behind-the-magic-how-google-translate-works-behind-the-scenes-a07b7479a703?source=rss-96950c3a4745------2</link>
            <guid isPermaLink="false">https://medium.com/p/a07b7479a703</guid>
            <dc:creator><![CDATA[Thesha Aravinthan]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 09:41:35 GMT</pubDate>
            <atom:updated>2025-12-03T09:41:35.718Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pTdjb_zjgvDF8QOJYuJxJA.png" /></figure><p>Google Translate looks simple, but behind it works a powerful AI system called <strong>Neural Machine Translation (NMT)</strong>. When you type a sentence, Translate doesn’t immediately jump to the meaning — first it breaks your sentence into smaller units using <strong>tokenization</strong>. Tokens can be words, parts of words, or even characters. This helps the AI understand the structure and grammar of your sentence. After tokenization, each token is converted into numbers through a process called <strong>vectorization</strong>, which turns language into mathematical patterns the AI can understand.</p><p>Once your sentence becomes vectors, a special AI model called a <strong>Transformer</strong> analyzes the meaning. This model looks at the entire sentence, understands the relationships between words, checks context, tone, grammar, and the intention behind the sentence. Instead of translating word-by-word, it focuses on meaning. The model then generates new vectors that represent the translated sentence and converts those vectors back into words in the target language. This is why the translation often sounds natural rather than robotic.</p><p>Google Translate becomes smart through training. It learns from billions of real sentences taken from books, websites, articles, and human translations. This huge amount of data teaches the AI how people naturally speak and write in different languages. As a result, it can understand idioms, cultural expressions, slang, and even complex grammar without mixing up meanings.</p><p>To make everything even more powerful, Google also uses additional AI systems for voice and camera translation. It uses speech recognition to convert audio into text and OCR (Optical Character Recognition) to read text from images. The system keeps improving automatically as more data is added and users correct translations. So even though Google Translate appears simple on the outside, behind the scenes it is a huge combination of tokenization, vectorization, deep learning, and neural networks working together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a07b7479a703" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>