<?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 avg_programmer on Medium]]></title>
        <description><![CDATA[Stories by avg_programmer on Medium]]></description>
        <link>https://medium.com/@yash_sharma0409?source=rss-46f9cca1b7ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*N3CZFwQgtpVXVuzATps-vw.png</url>
            <title>Stories by avg_programmer on Medium</title>
            <link>https://medium.com/@yash_sharma0409?source=rss-46f9cca1b7ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:26:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yash_sharma0409/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[Mastering React 18: Advanced Principles for Building Scalable and Performant Applications]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@yash_sharma0409/mastering-react-18-advanced-principles-for-building-scalable-and-performant-applications-3e92afe92d19?source=rss-46f9cca1b7ec------2"><img src="https://cdn-images-1.medium.com/max/2600/1*xYscqStHCc4T77gxAakliQ.jpeg" width="4288"></a></p><p class="medium-feed-snippet">The release of React 18 has ushered in a new era of web development, introducing a wealth of powerful features and principles that can&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@yash_sharma0409/mastering-react-18-advanced-principles-for-building-scalable-and-performant-applications-3e92afe92d19?source=rss-46f9cca1b7ec------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@yash_sharma0409/mastering-react-18-advanced-principles-for-building-scalable-and-performant-applications-3e92afe92d19?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e92afe92d19</guid>
            <category><![CDATA[react18]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 23:52:36 GMT</pubDate>
            <atom:updated>2024-10-07T23:52:36.130Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Polyfill for Promise.allSettled]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@yash_sharma0409/polyfill-for-promise-allsettled-9cae0fba5b73?source=rss-46f9cca1b7ec------2"><img src="https://cdn-images-1.medium.com/max/2600/1*xYscqStHCc4T77gxAakliQ.jpeg" width="4288"></a></p><p class="medium-feed-snippet">The Promise.allSettled() method returns a promise that resolves after all of the given promises have either resolved or rejected, with an&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@yash_sharma0409/polyfill-for-promise-allsettled-9cae0fba5b73?source=rss-46f9cca1b7ec------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@yash_sharma0409/polyfill-for-promise-allsettled-9cae0fba5b73?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cae0fba5b73</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 23:46:26 GMT</pubDate>
            <atom:updated>2024-10-07T23:46:26.572Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Mastering React’s Compound Components: Unlock Powerful UI Composition]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@yash_sharma0409/mastering-reacts-compound-components-unlock-powerful-ui-composition-dba42a6659e3?source=rss-46f9cca1b7ec------2"><img src="https://cdn-images-1.medium.com/max/2600/1*xYscqStHCc4T77gxAakliQ.jpeg" width="4288"></a></p><p class="medium-feed-snippet">As the complexity of modern web applications continues to grow, developers face the challenge of creating reusable, flexible, and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@yash_sharma0409/mastering-reacts-compound-components-unlock-powerful-ui-composition-dba42a6659e3?source=rss-46f9cca1b7ec------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@yash_sharma0409/mastering-reacts-compound-components-unlock-powerful-ui-composition-dba42a6659e3?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/dba42a6659e3</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 23:43:28 GMT</pubDate>
            <atom:updated>2024-10-07T23:43:28.530Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Simplifying Your React List Views with the Compound Pattern]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@yash_sharma0409/simplifying-your-react-list-views-with-the-compound-pattern-d5a12c989cb6?source=rss-46f9cca1b7ec------2"><img src="https://cdn-images-1.medium.com/max/2600/1*NRkN8PO5hNK2awWh53vlnA.jpeg" width="4000"></a></p><p class="medium-feed-snippet">If you&#x2019;ve been building React apps for a while, you&#x2019;ve probably come across a situation where you needed to render a list view layout &#x2014;&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@yash_sharma0409/simplifying-your-react-list-views-with-the-compound-pattern-d5a12c989cb6?source=rss-46f9cca1b7ec------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@yash_sharma0409/simplifying-your-react-list-views-with-the-compound-pattern-d5a12c989cb6?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5a12c989cb6</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 14:27:02 GMT</pubDate>
            <atom:updated>2024-08-30T14:27:02.949Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Job Market in 2024: What’s Going On?]]></title>
            <link>https://medium.com/@yash_sharma0409/the-job-market-in-2024-whats-going-on-f7fd79091d5b?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7fd79091d5b</guid>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[amazon]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 00:26:09 GMT</pubDate>
            <atom:updated>2024-07-15T00:26:09.032Z</atom:updated>
            <content:encoded><![CDATA[<p>The job market right now is like a rollercoaster — there are ups and downs, and it’s a bit unpredictable! Here’s a quick snapshot of what’s happening:</p><ol><li><strong>Jobs Are Still Being Added</strong>: In June 2024, the U.S. added 206,000 new jobs. This is good news, but it’s a bit slower compared to previous months​ (<a href="https://www.usbank.com/investing/financial-perspectives/market-news/effect-of-job-market-on-the-economy.html">Personal banking from U.S. Bank</a>)​.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iA6WmeTeZL1gabJ9HJDMnQ.jpeg" /></figure><ol><li><strong>Unemployment Rate Rising</strong>: The unemployment rate has increased to 4.1%, which is the highest it has been since November 2021​ (<a href="https://www.usbank.com/investing/financial-perspectives/market-news/effect-of-job-market-on-the-economy.html">Personal banking from U.S. Bank</a>)​. While this isn’t alarmingly high, it’s something to watch.</li><li><strong>More Job Openings Than Job Seekers</strong>: There are still more job openings than people looking for work. At the end of May 2024, there were 8.1 million job openings compared to 5.2 million unemployed people​ (<a href="https://www.usbank.com/investing/financial-perspectives/market-news/effect-of-job-market-on-the-economy.html">Personal banking from U.S. Bank</a>)​.</li><li><strong>Which Sectors Are Growing?</strong>: Jobs in government, healthcare, social assistance, and construction are on the rise​ (<a href="https://www.bls.gov/news.release/empsit.nr0.htm">BLS.gov</a>)​. But sectors like retail trade and professional services haven’t changed much​ (<a href="https://www.dahlconsulting.com/2024/01/23/the-state-of-the-labor-market-in-2024-what-employers-need-to-know/">Dahl Consulting</a>)​.</li><li><strong>Flexibility Is Key</strong>: Many companies are moving towards hybrid work models — combining office and remote work. This helps balance company needs with employee preferences​ (<a href="https://www.dahlconsulting.com/2024/01/23/the-state-of-the-labor-market-in-2024-what-employers-need-to-know/">Dahl Consulting</a>)​.</li><li><strong>Tough Competition for Jobs</strong>: The job market is competitive, meaning job seekers might find it harder to switch jobs compared to the past couple of years​ (<a href="https://www.dahlconsulting.com/2024/01/23/the-state-of-the-labor-market-in-2024-what-employers-need-to-know/">Dahl Consulting</a>)​. Employers are focusing on keeping their current employees happy with good pay and benefits​ (<a href="https://www.imercer.com/articleinsights/labor-market-trends">IMercer</a>)​.</li></ol><h3>What Does This Mean for You?</h3><ul><li><strong>Job Seekers</strong>: Be prepared for more competition. Tailor your resume, highlight your skills, and be ready to show why you’re the best fit for the job.</li><li><strong>Employers</strong>: Focus on employee satisfaction to retain talent. Offering competitive salaries, benefits, and flexible work arrangements can help.</li><li><strong>Everyone</strong>: Keep an eye on the job market trends. Stay informed about which industries are growing and which ones are slowing down.</li></ul><p>By understanding these trends, you can better navigate the job market in 2024. Stay positive, adapt to changes, and keep pushing forward!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7fd79091d5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React 18 Features]]></title>
            <link>https://medium.com/@yash_sharma0409/react-18-features-ffb504ee8e56?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffb504ee8e56</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react-18-new-features]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react18]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 01:04:06 GMT</pubDate>
            <atom:updated>2024-07-11T01:04:06.369Z</atom:updated>
            <content:encoded><![CDATA[<p>React is continuously evolving, with regular updates that introduce new features and improvements to enhance development experience and performance. Here are some of the notable new features and enhancements introduced in recent versions of React:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYscqStHCc4T77gxAakliQ.jpeg" /></figure><ol><li><strong>Automatic Batching: </strong>In previous versions, React batched state updates inside event handlers but not in other contexts such as promises, setTimeouts, or native event handlers. React 18 introduces automatic batching for all updates, reducing unnecessary renders and improving performance.</li></ol><pre>function handleClick() {<br>  setCount(c =&gt; c + 1);<br>  setFlag(f =&gt; !f);<br>  // Both state updates are batched together<br>}</pre><p><strong>2. Concurrent Rendering: </strong>React 18 introduces concurrent rendering, which allows React to prepare multiple versions of the UI at the same time. This feature improves the responsiveness of applications by allowing React to interrupt long-running renders and make the UI more responsive.</p><pre>const root = ReactDOM.createRoot(document.getElementById(&#39;root&#39;));<br>root.render(&lt;App /&gt;);</pre><p><strong>3. startTransition API: </strong>The startTransition API lets developers mark updates as non-urgent. React can then wait until more urgent updates are rendered before rendering these non-urgent updates.</p><pre>import { startTransition } from &#39;react&#39;;<br><br>startTransition(() =&gt; {<br>  setState(newState);<br>});</pre><p><strong>4. Suspense for Data Fetching: </strong>Suspense has been extended to support data fetching, making it easier to handle asynchronous operations in React components. This feature allows components to wait for asynchronous data before rendering.</p><pre>const resource = fetchData();<br><br>function App() {<br>  return (<br>    &lt;Suspense fallback={&lt;Loading /&gt;}&gt;<br>      &lt;DataDisplay resource={resource} /&gt;<br>    &lt;/Suspense&gt;<br>  );<br>}</pre><p><strong>5. useDeferredValue Hook: </strong>The useDeferredValue hook lets you defer re-rendering of a value until higher priority updates have been processed, improving the performance of complex UIs.</p><pre>const deferredValue = useDeferredValue(value);</pre><p><strong>6. useTransition Hook: </strong>The useTransition hook provides a way to mark state updates as transitions, allowing for smoother UI updates.</p><pre>const [isPending, startTransition] = useTransition();<br><br>startTransition(() =&gt; {<br>  setState(newState);<br>});</pre><p><strong>7. useId Hook: </strong>The useId hook generates unique IDs for components, which is useful for accessibility and ensuring unique keys.</p><pre>const id = useId();</pre><p><strong>8. Improved Server-Side Rendering (SSR): </strong>React 18 introduces an improved server-side rendering architecture that includes streaming HTML and selective hydration, making SSR more efficient and faster.</p><pre>import { renderToPipeableStream } from &#39;react-dom/server&#39;;<br><br>renderToPipeableStream(&lt;App /&gt;, { onShellReady() {} });</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffb504ee8e56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The History of JavaScript and Its Approach to Design Patterns]]></title>
            <link>https://medium.com/@yash_sharma0409/the-history-of-javascript-and-its-approach-to-design-patterns-79da2f8977a8?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/79da2f8977a8</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 01:00:28 GMT</pubDate>
            <atom:updated>2024-07-11T01:00:28.620Z</atom:updated>
            <content:encoded><![CDATA[<p>Note: this has been curated from sources and the content of this copied from different sources</p><p>JavaScript and Java have different origins, design philosophies, and use cases, which have influenced how each language handles design patterns. JavaScript’s flexibility and dynamic nature offer developers a great deal of freedom, whereas Java enforces a more rigid structure.</p><h3>Origins and Design Philosophies</h3><h4>Java</h4><ul><li><strong>Origins:</strong> Java was developed by Sun Microsystems in the mid-1990s as a language for building networked applications. It was designed to be a portable, object-oriented language with strong typing.</li><li><strong>Philosophy:</strong> Java enforces a strict object-oriented paradigm, with a focus on robustness, portability, and maintainability. It includes built-in support for design patterns through its class-based structure and interfaces.</li></ul><h4>JavaScript</h4><ul><li><strong>Origins:</strong> JavaScript was created by Brendan Eich at Netscape in 1995. Initially intended to add interactivity to web pages, it was designed to be lightweight and easy to use.</li><li><strong>Philosophy:</strong> JavaScript was built to be a flexible, prototype-based language. It was designed to be simple and approachable for non-programmers, focusing on ease of use and rapid development.</li></ul><h3>Design Patterns in Java and JavaScript</h3><h4>Java’s Approach to Design Patterns</h4><p>Java’s design enforces the use of object-oriented principles and design patterns. The language’s syntax and standard library promote structured programming and the use of well-established patterns.</p><ul><li><strong>Classes and Interfaces:</strong> Java’s class-based system supports inheritance and polymorphism, making it easier to implement design patterns like Singleton, Factory, and Strategy.</li><li><strong>Strong Typing:</strong> Java’s strong typing system helps catch errors at compile time, encouraging developers to adhere to patterns that promote type safety and consistency.</li><li><strong>Frameworks and Libraries:</strong> Java frameworks (e.g., Spring, Hibernate) are built around design patterns, further reinforcing their use.</li></ul><h4>JavaScript’s Approach to Design Patterns</h4><p>JavaScript’s flexibility allows developers to use or ignore design patterns as needed. Its dynamic nature and lack of strict typing give developers the freedom to choose their coding style.</p><ul><li><strong>Prototypal Inheritance:</strong> JavaScript’s prototype-based inheritance system is more flexible than Java’s class-based system, allowing for dynamic object creation and modification.</li><li><strong>Functional Programming:</strong> JavaScript supports first-class functions and closures, enabling functional programming techniques that can sometimes replace traditional design patterns.</li><li><strong>Dynamic Typing:</strong> JavaScript’s dynamic typing allows for more flexible code but can lead to runtime errors if not carefully managed.</li><li><strong>Minimalistic Core:</strong> JavaScript’s core language is minimalistic, providing basic building blocks without enforcing a particular structure. This minimalism allows for a wide variety of coding styles and paradigms.</li></ul><h3>Practical Considerations</h3><h4>Web Development and Rapid Prototyping</h4><p>JavaScript’s initial use case was to add interactivity to web pages, a domain where rapid prototyping and ease of use were paramount. This led to a design that prioritized flexibility and speed over strict adherence to patterns.</p><ul><li><strong>Browser Environment:</strong> JavaScript was designed to run in browsers with varying capabilities, necessitating a flexible and forgiving language.</li><li><strong>Event-Driven Programming:</strong> JavaScript’s event-driven model is well-suited for the asynchronous nature of web development, but doesn’t always align with traditional design patterns.</li></ul><h4>Evolution and Modern JavaScript</h4><p>JavaScript has evolved significantly since its inception, with modern features that support more structured programming and design patterns.</p><ul><li><strong>ES6 and Beyond:</strong> Modern JavaScript (ES6+) includes classes, modules, and other features that facilitate the use of design patterns.</li><li><strong>Frameworks and Libraries:</strong> Libraries and frameworks like React, Angular, and Vue.js introduce their own patterns and structures, guiding developers towards more maintainable code.</li></ul><h3>Conclusion</h3><p>JavaScript’s history and design philosophy explain why it does not enforce design patterns like Java. Java’s strict, class-based, object-oriented approach promotes the use of design patterns to ensure maintainability and robustness. In contrast, JavaScript’s flexible, dynamic nature and initial focus on rapid development and ease of use allow developers to choose whether or not to use design patterns.</p><p>This flexibility can be both a strength and a weakness. It allows for rapid development and innovation but can lead to inconsistencies and maintainability issues if not managed carefully. Modern JavaScript has incorporated features that support more structured programming, allowing developers to apply design patterns where appropriate while still maintaining the language’s inherent flexibility.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79da2f8977a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Key Property in React: Importance and Potential Pitfalls]]></title>
            <link>https://medium.com/@yash_sharma0409/the-key-property-in-react-importance-and-potential-pitfalls-172394dea0cf?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/172394dea0cf</guid>
            <category><![CDATA[keys]]></category>
            <category><![CDATA[property]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 00:48:14 GMT</pubDate>
            <atom:updated>2024-07-11T00:48:14.186Z</atom:updated>
            <content:encoded><![CDATA[<p>React, a popular JavaScript library for building user interfaces, introduces several properties that developers must understand and use correctly to ensure efficient and maintainable applications. One such critical property is the key attribute. Proper use of the key attribute is essential for ensuring that React efficiently updates the DOM. Misuse or neglect of this property can lead to performance issues and unpredictable behavior in your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYscqStHCc4T77gxAakliQ.jpeg" /></figure><p>Understanding the key Property</p><p>The key attribute is a special string attribute you need to include when creating lists of elements. Keys help React identify which items have changed, are added, or are removed. They should be given to the elements inside the array to give the elements a stable identity:</p><pre>const listItems = items.map((item) =&gt;<br>  &lt;li key={item.id}&gt;<br>    {item.name}<br>  &lt;/li&gt;<br>);</pre><p>Importance of the key Property</p><ul><li><strong>Optimized Updates:</strong> Keys help React determine which items in a list have changed. Without keys, React relies on the default behavior, which may involve re-rendering all list items, leading to suboptimal performance.</li><li><strong>Maintain Component State:</strong> Keys provide a way for React to uniquely identify elements, allowing it to maintain the state of components correctly. When keys change, React treats that element as a new one, which is crucial for form elements, input fields, or any interactive components within lists.</li><li><strong>Avoiding Unnecessary Re-renders:</strong> By correctly using keys, you ensure that React can make efficient updates and avoid unnecessary re-renders. This optimization helps in making the application more responsive and performant.</li></ul><p>Potential Issues Without Proper key Usage</p><ol><li><strong>Performance Bottlenecks:</strong> If keys are not used or improperly assigned (e.g., using indices in a dynamic list), React may re-render all elements in a list unnecessarily, leading to performance issues, especially in large lists.</li><li><strong>Incorrect Component State:</strong> Improper key usage can result in components losing their state. For example, if the key of an input field changes, React will recreate the input field, resetting its value and losing user input.</li><li><strong>Unpredictable Behavior:</strong> Without stable keys, React may not correctly manage component lifecycles, leading to unexpected behavior and bugs that are difficult to trace and fix.</li></ol><p>Best Practices for Using key</p><ol><li><strong>Use Unique and Stable Identifiers:</strong> Assign keys based on unique identifiers for each item in a list. Using unique IDs from your data source is generally a good practice.</li><li><strong>Avoid Using Array Indices:</strong> While it’s tempting to use array indices as keys, this practice can lead to issues when the list changes dynamically. Only use indices when you are sure the list won’t change.</li><li><strong>Consistent Keys Across Renders:</strong> Ensure that the keys remain consistent between renders. Changing keys can cause React to treat components as new, leading to loss of state and re-renders.</li></ol><h3>Example: Correct and Incorrect Key Usage</h3><p><strong>Incorrect Usage: Using Array Indices as Keys</strong></p><pre>const listItems = items.map((item, index) =&gt;<br>  &lt;li key={index}&gt;<br>    {item.name}<br>  &lt;/li&gt;<br>)</pre><p><strong>Correct Usage: Using Unique Identifiers as Keys</strong></p><pre>const listItems = items.map((item) =&gt;<br>  &lt;li key={item.id}&gt;<br>    {item.name}<br>  &lt;/li&gt;<br>);</pre><p>The key property in React is a fundamental attribute for optimizing list rendering and maintaining component state. Proper usage of keys is essential for ensuring your application runs efficiently and behaves predictably. Neglecting this key aspect can lead to significant performance issues and unpredictable behavior, making your application difficult to maintain and use. By following best practices and understanding the importance of keys, you can leverage React&#39;s full potential to build robust and performant user interfaces.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=172394dea0cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon leadership principles — interview questions]]></title>
            <link>https://medium.com/@yash_sharma0409/amazon-leadership-principles-interview-questions-3503e0402def?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/3503e0402def</guid>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[leadership-principles]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[amazon]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Sat, 29 Jun 2024 12:12:17 GMT</pubDate>
            <atom:updated>2024-06-29T12:12:17.594Z</atom:updated>
            <content:encoded><![CDATA[<h3>Amazon leadership principles — interview questions</h3><p>** Running sheet for adding leadership principles interview questions since amazon focuses a lot on these</p><p><strong>Behavioural questions </strong><br> ⁃ Describe a time when you didn’t agree with your manager.<br> ⁃ Tell me about a time when you went above and beyond your job<br> ⁃ Customer facing conflict, how did you solve it, what did you learn from it. Tell me about a time you had less time to achieve goal and how you did it.<br> ⁃ Tell me a time you overdeliver a project that makes customers happy.<br> ⁃ Tell me about a time when you had to make an important time-critical decision that needed manager approval, but it was impossible to get a manager?/<br> ⁃ Tell me about a time when you didn’t agree with a decision.<br> ⁃ Tell me about a time when you went against a managerial decision<br> ⁃ Tell me about a deadline you couldn’t hit. What happened?<br> ⁃ Tell me about a time when you went above and beyond on a project because you felt it was right<br> ⁃ Give me an example of a time when you didn’t seem like you were going to reach your goals.<br> ⁃ Ownership — Went extra effort in doing something Outside of your job <br> ⁃ How did they absorb extra work. — setting up the priority.</p><p><strong>Ownership</strong><br> ⁃ Give a time when you are not finish your commitment — requirement got diverged. Maybe emergency leaves. Valid blocker with proper communication to all stakeholders and new target dates with correct plan. Outcome — successful delivery <br> ⁃ You made a hard decision to sacrifice short term gain for a long term goal. — talk about inventory issue <br> ⁃ When you saw peer struggling and step in and help.</p><p><strong>Bias for action</strong><br> ⁃ 1 way door, 2 way door. Reversible decisions. <br> ⁃ Tell me a time when u don’t have enough time to figure out. Lack of analysis. <br> ⁃ Tell me a time when you have work against tight deadlines. Didn’t have a time to consider all situations. <br> ⁃ Sev 2 situations — critical. Don’t focus on RCA. first fix the problem. Then do RCA. Business impact. Respond immediately <br> ⁃ Risk that you have taken when the speed was critical <br> ⁃ Took business decision without approval <br> ⁃ Manager is on leave but you have to take a decision.</p><p><strong>Customer obsession </strong><br> ⁃ Above and beyond for customer <br> ⁃ Feedback to drive innovation. — text search on manage items page. <br> ⁃ Tech is not flexible when customer changes are required.</p><p><strong>Invent and simplify </strong><br> ⁃ Documentation improvement. <br> ⁃ Complex problem when you solved it with a simple solution. <br> ⁃ What innovation you did. <br> ⁃ You made something simple for customers. <br> <br><strong>Learn and be curious </strong><br> ⁃ How do you improve effectiveness. Are you learning anything new</p><p><strong>Hire and develop the best</strong></p><p><strong>Earn trust </strong><br> ⁃ Treat others with respect. If you do something wrong then accept it. <br> ⁃ Tell me a time when you significantly contributed to improve moral and productivity. <br> ⁃ Tough and critical feedback you received and how did you go about it. — Accept it and improve</p><p><strong>Dive deep </strong><br> ⁃ Detailed knowledge is important. <br> ⁃ What is the most difficult problem you worked on <br> ⁃ How do you diagnose a problem — check logs and metrics. <br> ⁃ Tell me a time when you were trying to understand a problem. <br> ⁃ Troubleshooting.</p><p><strong>Deliver results </strong><br> ⁃ Requirement changes. Timeline changes. Then also how are you able to deliver with right quality. <br> ⁃ Tight deadline — over and beyond.</p><p><strong>Think big</strong></p><p><strong>Insist on the higher standards</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3503e0402def" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Seas of useEffect: Guide to Avoiding Mistakes in React JS]]></title>
            <link>https://medium.com/@yash_sharma0409/navigating-the-seas-of-useeffect-guide-to-avoiding-mistakes-in-react-js-36f6d8fe6b49?source=rss-46f9cca1b7ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/36f6d8fe6b49</guid>
            <category><![CDATA[useeffect]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[avg_programmer]]></dc:creator>
            <pubDate>Sun, 11 Feb 2024 06:46:55 GMT</pubDate>
            <atom:updated>2024-02-11T06:46:55.319Z</atom:updated>
            <content:encoded><![CDATA[<p>Writing React applications is a journey that often involves navigating the complexities of managing side effects. The useEffect hook is a powerful tool in the React developer&#39;s toolkit, but it can be easy to get lost in its seas and make mistakes that lead to unexpected behaviors. In this human-centric guide, we&#39;ll explore some common mistakes developers make with useEffect and share practical tips to avoid them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECMbDnSetx4cQK1BraWMKA.jpeg" /></figure><p><strong>Understanding</strong> Dependencies:</p><p>Imagine useEffect as a lighthouse guiding your ship through the vast sea of rendering. One common mistake is neglecting the dependency array, causing the effect to run on every render.</p><p>Mistake:</p><pre>useEffect(() =&gt; {<br>  // Effect code<br>});</pre><p>Solution: Clearly define dependencies to make the effect more predictable.</p><pre>useEffect(() =&gt; {<br>  // Effect code<br>}, [dependency1, dependency2]);</pre><p><strong>Managing Async Operations:</strong></p><p>Sailing through asynchronous waters can be tricky. Failing to handle promises properly within useEffect can lead to unforeseen issues.</p><p>Mistake:</p><pre>useEffect(() =&gt; {<br>  fetchData().then((data) =&gt; setData(data));<br>}, []);useEffect(() =&gt; { fetchData().then((data) =&gt; setData(data)); }, []);</pre><p>Solution: Use an async function inside useEffect and handle promises gracefully.</p><pre>useEffect(() =&gt; {<br>  const fetchDataAsync = async () =&gt; {<br>    const data = await fetchData();<br>    setData(data);<br>  };<br><br>  fetchDataAsync();<br>}, []);<br></pre><p><strong>Cleaning Up Effect:</strong></p><p>Picture useEffect as a responsible sailor who cleans up after each adventure. Forgetting to clean up subscriptions or timers can result in resource leaks.</p><p>Mistake:</p><pre>useEffect(() =&gt; {<br>  const subscription = subscribeToData();<br>  // ...<br><br>  // Oops! Forgot to unsubscribe<br>}, []);<br><br></pre><p>Solution: Return a cleanup function to ensure proper cleanup.</p><pre>useEffect(() =&gt; {<br>  const subscription = subscribeToData();<br>  // ...<br><br>  return () =&gt; {<br>    // Cleanup code, like unsubscribing<br>    subscription.unsubscribe();<br>  };<br>}, []);<br><br></pre><p><strong>Conditional Effects:</strong></p><p>Sometimes, your ship only needs to set sail under specific conditions. Neglecting these conditions might lead to unnecessary voyages.</p><ul><li>Mistake:</li></ul><pre>useEffect(() =&gt; {<br>  fetchData();<br>}, [data]);</pre><ul><li>Solution: Wrap the effect in a conditional to control when it should run.</li></ul><pre>useEffect(() =&gt; {<br>  if (someCondition) {<br>    fetchData();<br>  }<br>}, [someCondition]);</pre><p><strong>Avoiding Stale Closures:</strong></p><p>Visualize closures as messages in bottles. When they are stale, the message might not reflect the current state of your application.</p><p>Mistake:</p><pre>const fetchDataAndUpdateState = () =&gt; {<br>  fetchData().then((data) =&gt; setData(data));<br>};<br><br>useEffect(() =&gt; {<br>  fetchDataAndUpdateState();<br>}, []);</pre><p>Solution: Utilize the functional form of state update to avoid stale closures.</p><pre>const fetchDataAndUpdateState = () =&gt; {<br>  fetchData().then((data) =&gt; setData((prevData) =&gt; data));<br>};<br><br>useEffect(() =&gt; {<br>  fetchDataAndUpdateState();<br>}, []);</pre><p>Conclusion:</p><p>In the vast ocean of React development, the useEffect hook is a compass that guides you through managing side effects. By understanding its intricacies and avoiding common mistakes, you can ensure smoother sailing in your application development. Remember, every line of code tells a story, and writing useEffect with care ensures your React application&#39;s narrative unfolds seamlessly. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36f6d8fe6b49" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>