<?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 Asry on Medium]]></title>
        <description><![CDATA[Stories by Asry on Medium]]></description>
        <link>https://medium.com/@asryamaz000?source=rss-e35cba75e6c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bGkQ3bPo3Gnj4eFTYIn_5g.png</url>
            <title>Stories by Asry on Medium</title>
            <link>https://medium.com/@asryamaz000?source=rss-e35cba75e6c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 15:54:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asryamaz000/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[Risk and Risk Pooling in Health Care]]></title>
            <link>https://medium.com/@asryamaz000/risk-and-risk-pooling-in-health-care-489fb735fc26?source=rss-e35cba75e6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/489fb735fc26</guid>
            <category><![CDATA[risk-in-health-care]]></category>
            <dc:creator><![CDATA[Asry]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 06:27:36 GMT</pubDate>
            <atom:updated>2026-10-18T06:27:36.711Z</atom:updated>
            <content:encoded><![CDATA[<p>Health care can’t work like an ordinary purchase because its costs are unpredictable and can be ruinous, so societies pool the risk through insurers and government programs.</p><h3>The problem of risk</h3><p>At its core, health care is an exchange between two parties. <strong>Patients</strong> include the sick and injured, but also healthy people seeking prevention or information. <strong>Providers</strong> are the doctors, nurses, pharmacists and institutions who deliver care, and they must be paid to keep doing so.</p><p>As care became more sophisticated, people wanted more of it and it cost more. The result was <strong>unplanned expenses</strong>: patients faced hardship and avoided care, and providers went unpaid.</p><p><strong>Risk</strong> is the possibility of a financial loss from using health care. A treatment can be life-changing yet priced far beyond what one person can afford, which breaks the simple pay-as-you-go transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UBFIHh7X2sLKU_SkHdmZpA.png" /></figure><h3>Risk pooling and intermediaries</h3><p><strong>Risk pooling</strong> means sharing risk across a large group, so no individual carries the full financial danger of getting sick. <strong>Intermediaries</strong> run the pool: they collect funds, pay for the care of covered people, and manage how care is used and what it costs.</p><ul><li><strong>Private insurers:</strong> members pay a fixed, known premium and receive a policy that covers medical bills, sometimes under conditions.</li><li><strong>Government payers:</strong> a public program covers a defined group and funds itself through taxes or premium-like charges.</li></ul><p>The US Medicare program, which covers people over 65, and the UK’s National Health Service are examples of public intermediaries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*1N4zBKuJ3lmGIT4iJ_wWLQ.png" /></figure><p>The population funds the intermediaries, who pay providers; a smaller share of payments still goes straight from patients to providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7PQwUlbnKovfdL7sf8p8ng.png" /><figcaption>Example of a Pooling scenario</figcaption></figure><h3>Providers and levels of care</h3><p>roviders include medical professionals (physicians, nurses, pharmacists, therapists and others) and organizations (physician practices, hospitals, and independent facilities such as labs, imaging centers and pharmacies). Care is usually described in four levels, from everyday care to the most specialized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*01vS45bz4xeV8kGml-ppFw.png" /></figure><p>Patients usually enter at primary care and are referred onward to more specialized levels as their needs require.</p><h3>Three challenges for every system</h3><p>Pooling risk doesn’t settle the debate about how systems should change. Three challenges keep it going.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEwqsGfF5Xp8jUtRUbbVwQ.png" /></figure><h3>Why this matters for AI and data</h3><p>Each player wants different tools. Intermediaries want to spot health issues emerging in their population, providers want help turning patient information into diagnoses and treatment plans, and patients want ways to stay healthy and judge whether they need care. The data behind such tools comes from different parties for different reasons, so ask who gathered it and why before building a model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B4spLvREGpUlVEFQp57MbA.png" /></figure><h3>Source</h3><p>Stanford University, <em>Intro to Healthcare Study Guide, Module 1: Overview of Health Care Systems and Key Challenges They Face.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=489fb735fc26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Core Concepts Behind Large Language Models]]></title>
            <link>https://medium.com/@asryamaz000/the-core-concepts-behind-large-language-models-2848847f1922?source=rss-e35cba75e6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2848847f1922</guid>
            <dc:creator><![CDATA[Asry]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 01:58:16 GMT</pubDate>
            <atom:updated>2026-03-11T01:59:35.983Z</atom:updated>
            <content:encoded><![CDATA[<p>Large Language Models (LLMs) are powerful AI systems that can understand and generate human like text. While they appear intelligent, their behavior is governed by several core technical concepts that determine how they process information and interact with users. Understanding these foundations helps explain both the capabilities and limitations of modern LLMs.</p><ol><li><strong>No memory</strong></li></ol><p><strong>2. Pricing based on usage</strong></p><p><strong>3. Tokenization</strong></p><p><strong>4. Context window</strong></p><p><strong>5. Context compaction</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*-uXfZydxtpNOwuJd9GG3JQ.png" /></figure><h3>1. LLM’s has no memory</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtrrbgsD-Oo3ooLhVhTUxw.png" /></figure><h3>2. Consumption of LLM (pricing)</h3><pre>no.of input token - related to data inputed to LLM<br><br>no.of output token - related to data outputted by LLM</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nLW7fq_05lHXjfRg5ocBNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rH9Fmzp0HJax5M-E5_fZRQ.png" /><figcaption><a href="https://gptforwork.com/tools/openai-chatgpt-api-pricing-calculator">https://gptforwork.com/tools/openai-chatgpt-api-pricing-calculator</a></figcaption></figure><p>pricing for input tokens is low=&gt; Cause it, token is imput token is increasing with context.</p><h3>3. Tokenization</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wD6lC1ebGA20oZlJjfX4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dkLIbhqnvNxZ2HwszQ6NEQ.png" /><figcaption>Both models having different techninqes for tokenisation</figcaption></figure><p>2 different model having 2 differnt tokenixation techniques. tokenization algos:<br> bytepair encoding<br> wordp<br> unigram</p><h3>4. Context window</h3><p>Maximum amount of information that an LLM can look @ one time.size of context window calculated by no.of tokens.</p><p>eg: gpt 5.1 model =&gt; 400 000 tokens</p><h3>5. Context compaction</h3><p>Technique to manage context.</p><p>Reducing the size of the conversation or input while keeping the important information.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2848847f1922" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding WebSockets]]></title>
            <link>https://medium.com/@asryamaz000/understanding-websockets-b0b06420608b?source=rss-e35cba75e6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0b06420608b</guid>
            <dc:creator><![CDATA[Asry]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 17:01:25 GMT</pubDate>
            <atom:updated>2025-08-26T17:01:58.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*t3yFVX7EcxE3Wa4p2nU__w.png" /></figure><p>This article provides a comprehensive overview of the WebSocket protocol, addressing common misconceptions and clarifying its role in modern web applications. It explores the protocol’s features, its advantages over traditional HTTP polling, and its implementation considerations, including server requirements and connection establishment. The document also delves into the internal workings of WebSockets , highlighting its benefits and practical applications.</p><h3>1. Introduction</h3><p>The traditional web communication model, built upon HTTP’s request-response paradigm, proves inadequate for real-time applications demanding immediate server-to-client updates. Examples include chat systems, multiplayer games, stock tickers, and collaborative editors. To address these limitations, the WebSocket protocol emerged, enabling persistent, full-duplex communication between clients and servers, thereby eliminating the overhead associated with repeated HTTP requests or polling mechanisms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*uLrphmtfdQe8xD0M3k3gog.png" /></figure><h3>2. What is WebSocket?</h3><p>WebSocket is a standardized protocol (RFC 6455) that establishes a bidirectional communication channel over a single TCP connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*w1yONGDu6r8B2t0YPv43xw.png" /></figure><h3>3. Does WebSocket Require a Separate Server?</h3><p>A common misconception is that WebSocket inherently necessitates a separate server. However, WebSocket is a protocol that can be implemented:</p><ul><li><strong>On the same server as your REST API:</strong> This is a common approach for small and medium-scale projects.</li><li><strong>On a dedicated server or cluster:</strong> For large-scale, real-time applications, distributing the load across dedicated servers or clusters is often preferred.</li></ul><h3>Example Scenarios</h3><ul><li><strong>Same Server:</strong> A Node.js backend serving both REST endpoints and WebSocket connections.</li><li><strong>Dedicated WebSocket Server:</strong> A high-frequency trading platform running WebSockets on a separate service to handle millions of concurrent users.</li></ul><p>Therefore, a “WebSocket server” is not a standalone product by default; it is simply any server that implements the WebSocket protocol.</p><h3>4. How Does a WebSocket Connection Start?</h3><p>The WebSocket connection is initiated through an HTTP upgrade request.</p><h3>Handshake (HTTP)</h3><p>The client sends a request containing an Upgrade: websocket header.</p><p><strong>Example:</strong></p><pre>GET /updates HTTP/1.1<br>Host: example.com<br>Upgrade: websocket<br>Connection: Upgrade</pre><h3>Server Acknowledgment</h3><p>If the server supports WebSockets, it responds with:</p><pre>HTTP/1.1 101 Switching Protocols<br>Upgrade: websocket<br>Connection: Upgrade</pre><h3>Protocol Upgrade</h3><p>Following this exchange, the communication switches from HTTP to WebSocket over the same TCP connection.</p><h3>Persistent Communication</h3><p>Both the client and the server can now send and receive messages at any time until one side closes the connection.</p><h3>5. What Problem Does WebSocket Solve?</h3><p>Before WebSockets, developers relied on polling techniques to simulate real-time communication.</p><h3>5.1 Short Polling</h3><p>The client sends frequent HTTP requests (e.g., every few seconds) to check for updates.</p><p><strong>Disadvantages:</strong> High bandwidth usage, unnecessary server load, and delays between updates.</p><h3>5.2 Long Polling</h3><p>The client sends a request that the server holds open until new data is available, then immediately sends another request.</p><p><strong>Disadvantages:</strong> Reduces overhead slightly but remains inefficient and resource-heavy.</p><h3>WebSocket Advantage</h3><ul><li>Eliminates repeated requests.</li><li>Enables server-initiated communication (push).</li><li>Reduces latency and bandwidth consumption.</li></ul><h3>6. Is WebSocket a Server or a Protocol?</h3><p>WebSocket is a protocol, not a standalone server.</p><p>A WebSocket server is any server (Node.js, Java, Python, etc.) that:</p><ul><li>Listens for WebSocket handshake requests.</li><li>Manages active connections.</li><li>Sends and receives messages through those connections.</li></ul><p>In Node.js, you can implement a WebSocket server using libraries such as:</p><ul><li>ws: A minimal WebSocket implementation.</li><li>Socket.IO: Adds extra features like rooms, namespaces, and fallback for unsupported clients.</li></ul><h3>7. Does WebSocket Require a Separate Domain or Port?</h3><p>Not necessarily. WebSockets can run on the same domain and port as your REST API (e.g., wss://yourdomain.com on port 443).</p><p>For high-performance systems, it is common to:</p><ul><li>Run WebSockets on a separate port (e.g., 8080 for WebSockets, 443 for REST).</li><li>Use load balancers or dedicated services for real-time traffic.</li></ul><h3>8. How WebSocket Works Under the Hood</h3><ul><li><strong>TCP Connection Established:</strong> WebSocket builds on an existing TCP connection.</li><li><strong>Protocol Switch:</strong> Starts as HTTP, then switches to WebSocket via handshake.</li><li><strong>Message Framing:</strong> Data is sent in frames (text, binary, ping/pong, close frames).</li><li><strong>Full-duplex Communication:</strong> Both sides can push messages at any time.</li></ul><h3>9. Benefits of WebSocket</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*USRGD0IJgqGaXNjh76D-xQ.png" /></figure><h3>10. Practical Applications</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuSmkKBDKx825PgEGqB1gQ.png" /></figure><h3>11. Summary</h3><p>WebSocket is not a separate server; it is a protocol that can be implemented on the same or separate infrastructure as your REST API. It starts as an HTTP handshake and upgrades to a persistent, full-duplex connection. It was introduced to replace inefficient polling methods and enable true real-time communication.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0b06420608b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to React.js and the Virtual DOM]]></title>
            <link>https://medium.com/@asryamaz000/introduction-to-react-js-and-the-virtual-dom-7657b7f6e656?source=rss-e35cba75e6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7657b7f6e656</guid>
            <category><![CDATA[intro-to-react]]></category>
            <dc:creator><![CDATA[Asry]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 21:21:05 GMT</pubDate>
            <atom:updated>2025-01-22T09:15:37.500Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<p>This article serves as an introduction to React.js, a widely-used <strong>JavaScript library</strong> for building user interfaces, particularly in single-page applications (SPAs). It explores the advantages of using React, its component-based architecture, and the efficiency brought by the Virtual DOM. By understanding how React works and how to set it up in a project, developers can leverage its capabilities to create dynamic and interactive web applications more efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*3UASnV_gMYmvBHhK0KvCRg.png" /><figcaption>ReactJs (Famous Js Library)</figcaption></figure><h3>What is React.js?</h3><p>React.js is a popular <strong>JavaScript library </strong>used for building user interfaces, particularly for single-page applications (SPAs). It allows developers to create dynamic and interactive web applications in a more efficient and declarative manner.</p><h3>Why Choose React?</h3><p>When building websites with traditional HTML, CSS, and JavaScript, developers often face performance issues due to the time-consuming nature of updating the DOM (Document Object Model). React reduces development time by providing a more efficient way to manage and update the DOM.</p><p>Component based architecture.</p><p>In summary, React speeds up development by abstracting away much of the manual work required in plain HTML, CSS, and JavaScript. Its <strong>component-based architecture, efficient state management, optimized updates with the Virtual DOM, and the availability of useful libraries and tools</strong> significantly reduce the time and effort needed to build and maintain a project. For complex or dynamic web applications, React provides a more efficient, maintainable, and scalable approach compared to traditional methods.</p><h3>How React Works</h3><p>While browsers can only understand HTML, CSS, and JavaScript, React uses a format called JSX, which is a syntax extension that allows HTML-like code to be written in JavaScript. JSX is then converted (transpiled) into regular JavaScript, which browsers can understand.</p><p>In a traditional setup, when you make changes to a website, you directly manipulate the DOM. The browser processes these changes, and the relevant part of the page is updated. However, this can be inefficient if large or frequent updates are made because the entire DOM is recalculated.</p><p>In React, instead of directly manipulating the real DOM, the Virtual DOM (VDOM) is used. This offers several performance optimizations by reducing unnecessary DOM manipulations.</p><h3>The Virtual DOM and Its Efficiency</h3><p>React’s Virtual DOM acts as an abstraction layer between your application and the real DOM, ensuring only the necessary updates are made, leading to better performance.</p><h4>How the Virtual DOM Works:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*PhOLySKlIpMnLl_r5ug0tg.png" /><figcaption>VDOM</figcaption></figure><ol><li><strong>Initial Update</strong>: When you change something in React, like updating state, the virtual DOM is first updated.</li><li><strong>Reconciliation</strong>: React compares the updated virtual DOM with the previous version using a process called reconciliation.</li><li><strong>Diffing Algorithm</strong>: React uses a diffing algorithm to identify the differences between the two virtual DOMs.</li><li><strong>Patching</strong>: Only the elements that have changed are updated in the real DOM, making the process much faster and more efficient.</li></ol><h4>Key Differences in Efficiency</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*trbNVZCn2uvEYj4GvUbSIg.png" /></figure><p><strong>Direct DOM Manipulation (Traditional Approach)</strong>:</p><ul><li>Directly manipulates the real DOM.</li><li>Any change to the DOM may trigger recalculations of layout and paint, which can be expensive if there are many changes or complex elements.</li><li>There is no optimization in place for minimizing the number of changes to the real DOM.</li></ul><p><strong>React’s Virtual DOM</strong>:</p><ul><li>Acts as a buffer between your application and the real DOM.</li><li>React minimizes the number of direct changes to the real DOM by batching updates.</li><li>The diffing algorithm ensures that only the parts of the DOM that have changed are re-rendered, reducing the need for expensive operations like layout recalculations.</li></ul><h3>Setting Up React in Your Project</h3><p>To start using React in your project, there are two main ways to set up React:</p><ol><li><strong>Using a Toolchain (Recommended)</strong>: This method involves using modern development tools such as:<br>//templates</li></ol><ul><li>Vite (build tool — <strong>Vite</strong>, transpiler —<strong> esbuild</strong>) — npm create vite@latest my-app --template react</li><li>Create React App (CRA) (build tool — <strong>Webpack</strong>, transpiler — <strong>Babel)</strong> — npm create-react-app my-app</li><li>Next.js</li></ul><p>These tools streamline the process of setting up and managing React projects, providing features like hot-reloading, optimization, and more.</p><p><strong>2. Without a Toolchain</strong>: You can also set up React by including React and ReactDOM directly in an HTML file. This is useful for smaller projects or learning purposes, but it’s generally not recommended for large-scale projects due to limited optimizations and configuration options.</p><p>The End!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7657b7f6e656" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Summary of Web Development and NPM]]></title>
            <link>https://medium.com/@asryamaz000/summary-of-web-development-and-npm-312f9e4eeb1e?source=rss-e35cba75e6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/312f9e4eeb1e</guid>
            <dc:creator><![CDATA[Asry]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 17:15:15 GMT</pubDate>
            <atom:updated>2025-01-08T12:21:18.965Z</atom:updated>
            <content:encoded><![CDATA[<p>This article provides a comprehensive overview of web development fundamentals, focusing on HTML, CSS, and JavaScript, as well as the role of package managers like NPM in simplifying the management of libraries and dependencies. It also discusses the importance of bundlers and transpilers in modern web development, highlighting tools such as Webpack and Babel, and their significance in creating efficient and compatible web applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*GSkEU45HhwQgtXEkshAzpw.png" /><figcaption>How npm supports the web dev by doing integrations easily</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*XZ3WhVlCSIp2YYIydqEo9A.png" /><figcaption>With the dev dependencies (webpack ,Babel)</figcaption></figure><h3>1. Web Development (HTML, CSS, JS)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*vk_-M8KTauPkEa6U3Q_Yeg.png" /><figcaption>Basic web page</figcaption></figure><h3>2. Using Libraries Without a Manager</h3><p>Before the introduction of package managers like NPM, libraries were included by directly linking external resources in the HTML file using &lt;script&gt; tags.</p><pre>&lt;!-- Example of linking to a CDN --&gt;<br>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js&quot;&gt;&lt;/script&gt;</pre><p>While this method works, it has its limitations. When updating to a new version of that module, if you want to share your project, you must share it with external modules too.</p><p>So we need package managers (npm, yarn, bower).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*GcToSxhwh7NeV3flMNreRg.png" /></figure><h3>3. Usage of NPM and How It Makes Life Easier</h3><p><strong>NPM (Node Package Manager)</strong> simplifies package management for JavaScript applications. It provides several benefits, such as automatic package installation, version control, and dependency management (so that you don’t need to share the node modules).</p><p><strong>Install Packages</strong>: Install third-party libraries or frameworks easily with one command.</p><pre>npm install &lt;package-name&gt;   # Installs a package<br>npm install --save &lt;package-name&gt;  # Adds the package to dependencies<br>npm install --save-dev &lt;package-name&gt;  # Adds the package to devDependencies</pre><p><strong>Updating Modules</strong>: Automatically updates all installed modules to their latest versions.</p><pre>npm update   # Updates all dependencies</pre><p><strong>package.json</strong>: A configuration file that holds information about your project and its dependencies.(dependencies and dev dependencies).</p><pre>{<br>  &quot;name&quot;: &quot;your-project-name&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;dependencies&quot;: {<br>    &quot;express&quot;: &quot;^4.17.1&quot;<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;webpack&quot;: &quot;^5.0.0&quot;<br>  }<br>}</pre><h3>4. Global Variable Concept in JS (Node.js Syntax)</h3><p>In <strong>Node.js</strong>, the require syntax is used to include libraries or files globally across modules. If we do not use require in a JS file that uses modules, we have to mention the relevant file path in the HTML before calling the JS file, which makes life harder. However, this is not recognized by browsers, which is why bundlers are needed to handle dependencies properly for the browser environment.</p><pre>// math.js<br>module.exports.add = function(a, b) {<br>  return a + b;<br>};<br><br>// app.js<br>const math = require(&#39;./math&#39;);<br>console.log(math.add(5, 3));  // Output: 8</pre><p>Since browsers do not recognize require, bundlers are used to package code for browser compatibility.</p><h3>5. Bundlers: What They Do</h3><p><strong>Bundlers</strong> like <strong>Webpack</strong> and <strong>Parcel</strong> allow you to bundle multiple JavaScript, CSS, and HTML files into one file, making your web app more efficient to load. Before the bundling, translation will take place (JSX to plain HTML, CSS, JS).</p><p>Install Webpack and Webpack CLI:</p><pre>npm install --save-dev webpack webpack-cli</pre><p>Create a webpack.config.js file for bundling:</p><pre>module.exports = {<br>  entry: &#39;./src/index.js&#39;,<br>  output: {<br>    filename: &#39;bundle.js&#39;,<br>    publicPath:&#39;/dist&#39;<br>  }<br>};</pre><p>Run Webpack to bundle your files:</p><pre>npx webpack --config webpack.config.js</pre><h3>6. Transpilers (e.g., Babel)</h3><p><strong>Transpilers</strong> like <strong>Babel</strong> allow you to write modern JavaScript (ES6+) and convert it into a backward-compatible version (ES5) that is supported by older browsers.</p><p><a href="https://www.youtube.com/watch?v=P3aKRdUyr0s">What is NPM, and why do we need it? | Tutorial for beginners</a></p><p>In React, we use templates for the whole process:</p><ol><li>Create React app (Webpack, Babel) — npm create-react-app my-app</li><li>Vite@latest app (Vite, esbuild) — npm create vite@latest my-app --template react</li></ol><p>The End!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=312f9e4eeb1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object Oriented Programming Concepts Explained]]></title>
            <link>https://medium.com/@asryamaz000/object-oriented-programming-concepts-explained-639a7866c442?source=rss-e35cba75e6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/639a7866c442</guid>
            <dc:creator><![CDATA[Asry]]></dc:creator>
            <pubDate>Wed, 08 Apr 2020 00:00:43 GMT</pubDate>
            <atom:updated>2024-11-27T05:09:17.414Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Object Oriented Programming</h3><p>Put simply, object oriented programming is the use of objects that contain both data and methods that interact with each other. For a language to be considered object oriented, it must have certain features like:</p><ul><li>Encapsulation</li><li>Inheritance</li><li>Abstraction</li><li>Polymorphism</li></ul><p>These features, along with a language having Objects and Classes, make up what we know as object oriented programming.</p><h3>What is Encapsulation</h3><p>Encapsulation is achieved when an object keeps its state private, so other objects don’t have direct access to this state. Instead they must call a list of public methods to manipulate the state.</p><p>Take the photo below for example. The Cat has 3 different fields that are all private, plus a private meow() method. No other object that calls the Cat can change these values.</p><p>However, the Cat also has a list of public methods(Sleep, Play, and Feed). These public methods when called, will change the Cat’s state as well as invoke the meow() method for Play and Feed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dzx7cVgTMbPD4xD3.png" /></figure><h3>What is Inheritance</h3><p>Inheritance is the creation of a hierarchy within your classes. You start off with a parent class, and then extend onto child classes which will reuse all of the fields and methods from the parent class plus any unique methods it implements.</p><p>Like the example below, the Teacher and the Student are both Person’s, but one has a subject while the other has a school. Person is the parent class and Teacher &amp; Student are the child classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oy1xCwmttSZPHnUC.png" /></figure><h3>What is Abstraction</h3><p>Abstraction is the process in which an object only exposes itself at a high-level, and hides its internal implementation details. Other objects that are calling this don’t care how things are being implemented, they just need the information to be processed.</p><p>Think of this as a small set of public methods that any other class can call wihout knowing how they are actually being implemented behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KQYUkVu_jdPdSrpK.png" /></figure><p>Take the cell phone from the picture above for example. We don’t know how the buttons on the phone are doing what they are doing, we just know what they do.</p><h3>What is Polymorphism</h3><p>Polymorphism means somthing occuring in multiple different forms. It allows objects of different types to be accessed through the same interface with each type implementing its own independent version of this interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T7TZm_M09Zk2L7wI.png" /></figure><p>The star, circle, and rectangle are all Figure’s, they are just different types of figures. They all have a calculateSurface() and calculatePerimeter() method. The difference is how they are actually doing this calculation.</p><h3>Now Thats All Folks</h3><p>Thanks for taking the time to read this post! If you found it useful, or think others would enjoy it, share it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=639a7866c442" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>