<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Aniket Singh</title>
    <description>The latest articles on Forem by Aniket Singh (@aniketsingh98571).</description>
    <link>https://forem.com/aniketsingh98571</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F492332%2F4e1a81b8-1017-4d25-96b4-6269ab82eb50.jpg</url>
      <title>Forem: Aniket Singh</title>
      <link>https://forem.com/aniketsingh98571</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aniketsingh98571"/>
    <language>en</language>
    <item>
      <title>2024: Unwrapping My Year of Change and Adventure</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Mon, 06 Jan 2025 11:06:41 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/2024-unwrapping-my-year-of-change-and-adventure-2l3k</link>
      <guid>https://forem.com/aniketsingh98571/2024-unwrapping-my-year-of-change-and-adventure-2l3k</guid>
      <description>&lt;p&gt;Before we dive into the activities I undertook in 2024, let's take a step back and revisit the resolutions I set for myself in 2023. 🔄 I had been working with my first company for 2.6 years, a place I joined right after graduation. This journey taught me a lot about collaboration, adapting to new trends, and continuous learning. 🎓💼&lt;/p&gt;

&lt;p&gt;Working with a company for such a long period, you naturally form personal connections with your team members. This makes the decision to leave quite challenging. However, I realized that growth often requires change, be it in terms of salary or work culture. So, I made a resolution in 2023 to find a new job by the end of the year. 💡🎯&lt;/p&gt;

&lt;p&gt;Yes, you heard it right! Even though I work in tech, changing jobs required me to hit the books again. I had to brush up on data structures, system design, and solve machine coding puzzles. So, I began my prep, solving questions on platforms like CodeChef, GeeksforGeeks, LeetCode, and reading through various system design articles. 📚💻&lt;/p&gt;

&lt;p&gt;Simultaneously, I started applying for jobs and attending interviews. Although the rate of receiving interview calls was only 20%, I remained undeterred. I knew that every 'no' was one step closer to the 'yes' I was working towards. &lt;/p&gt;

&lt;p&gt;Initially, I stumbled and fell at every interview I attended. It was disheartening, to say the least. 😔 The failures bred self-doubt, making me question my abilities. After all, how could someone who had worked on production-level apps for 2.5 years fail? What was I doing wrong? 🤔&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flps3bu06s02bi62b27pk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flps3bu06s02bi62b27pk.jpg" alt="Fail Meme" width="575" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, after the initial few interviews, I decided to turn my failures into lessons. I started maintaining notes on the areas that needed improvement. These notes were a reflection of my shortcomings in the interviews. 📝💡&lt;/p&gt;

&lt;p&gt;These notes turned out to be a game-changer! They helped me identify my weak spots and work on them. With every interview, I was learning, growing, and inching closer to my goal. And sure enough, after a few more interviews, I managed to crack a few companies! 🎉💼&lt;/p&gt;

&lt;p&gt;Finally, I decided to go with the company I'm currently with. It was a journey filled with ups and downs, but every stumble was worth it. So here's to embracing failures, learning from them, and turning them into stepping stones towards success! 🚀🌟&lt;/p&gt;

&lt;p&gt;With a few months left before joining the new company, and after the whirlwind of job-switching hustle, I decided it was time for a breather. 🍃 So, I packed my bags and set off on a trekking adventure with my ex-manager. 🎒👟&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsv643r1k56c9xlnhsm7.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsv643r1k56c9xlnhsm7.JPG" alt="Image description" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The experience was nothing short of surreal. 🏞️ Being amidst nature, away from the chaos of the city, felt like a balm to my soul. Every step I took, every trail I followed, brought a sense of calm that's hard to find in our everyday lives. 🌳🌲&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0487mwrzjm7ivkh0iuy.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0487mwrzjm7ivkh0iuy.JPG" alt="Image description" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5jmu9qnans6bqts71kb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5jmu9qnans6bqts71kb.jpg" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The rustling leaves, the chirping birds, the cool breeze - it was a symphony of nature that played the perfect background score to our adventure. 🍂🐦🌬️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficgha9wjplmvf4jrj0r5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficgha9wjplmvf4jrj0r5.jpg" alt="Image description" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9g21f7jo9ndr47paxetr.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9g21f7jo9ndr47paxetr.JPG" alt="Image description" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a rejuvenating 10-day trip, it was time to get back to the grind and kickstart the onboarding process at my new company. 📝💼 With a new company comes new tools to learn, and this time it was TypeScript. Having worked with JavaScript for two years, picking up TypeScript was a breeze for me. 💻🚀&lt;/p&gt;

&lt;p&gt;Upon joining, I was assigned a project that required me to learn the AntD Design system. This was a new territory for me, and I had to learn it on the go while implementing it on the frontend. 🎨🖥️&lt;/p&gt;

&lt;p&gt;I dove right in, and with time and the guidance of senior engineers, I gained a good grasp of AntD. In this project, I also got the opportunity to work with monorepos and follow atomic design principles for a scalable frontend architecture. 🧩🔬&lt;/p&gt;

&lt;p&gt;Every day brought new learnings and challenges, but with each one, I grew not just as a professional but also as an individual. So here's to embracing new tools, learning on the go, and turning challenges into opportunities for growth! 🌱🌟&lt;/p&gt;

&lt;p&gt;In the past, I had worked with startups, where the approach to project management was quite unconventional. However, in my new role, we used more structured tools like JIRA for task management and Sentry for alerting. 📋🔔&lt;/p&gt;

&lt;p&gt;Working with these tools not only streamlined our processes but also significantly boosted our productivity. 🚀💼 It made tackling issues easier and more efficient, allowing us to focus on what truly mattered - creating and innovating. 💡🎯&lt;/p&gt;

&lt;p&gt;Lately, I've also incorporated AI tools into my workflows. I've been using Cursor for writing code, Claude for resolving tech doubts, and GPT for proofreading and copywriting. 🖥️🤖&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqx0cc8nnl6mmyzr9j5pw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqx0cc8nnl6mmyzr9j5pw.jpeg" alt="Image description" width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Being passionate about writing, I've also managed to secure 2-3 paid gigs for tech writing. 📝💰 A big shout-out to the dev.to platform for providing such opportunities! 🙌🎉&lt;/p&gt;

&lt;p&gt;Over time, I've come to realize the importance of extending our software services by building a SaaS product. 🌐💻 Building a successful SaaS requires understanding and knowing your audience. To achieve this, I've embarked on a journey of personal branding. 🚀🎯&lt;/p&gt;

&lt;p&gt;I've secured a domain name for my portfolio site, created an Instagram page dedicated to tech content, and started posting regularly on LinkedIn and Twitter. 🌐📸💼&lt;/p&gt;

&lt;p&gt;I built a SaaS product, and although it didn't work out as planned, the journey was filled with invaluable lessons. 📚💡&lt;/p&gt;

&lt;p&gt;In my current organization, we have a book club that has encouraged me to delve into the world of books. 📚💡 I took this path and ordered a few from a long list of recommendations. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnrdy16i194lin3pnu6k.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnrdy16i194lin3pnu6k.jpg" alt="Image description" width="800" height="1421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we step into 2025, let's make it a year of enriching our minds with more books, 📚 rejuvenating our souls with more trips, 🌍 giving our dreams another shot with more SaaS ventures, 💻 and focusing on real connections by spending less time on social media. 📵 Here's to a year of growth, exploration, and mindful living! 🌟🚀 Let's make every moment count! 💫&lt;/p&gt;

&lt;p&gt;So, there you have it - my 2024 wrapped up! 🎁🎉 A year full of ups and downs, but with plenty of moments to cherish at the top. &lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>newyearchallenge</category>
      <category>career</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Mobile Web Woes: Navigating Common CSS and Font Issues 📱🔧</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sat, 09 Sep 2023 13:34:19 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/mobile-web-woes-navigating-common-css-and-font-issues-1m99</link>
      <guid>https://forem.com/aniketsingh98571/mobile-web-woes-navigating-common-css-and-font-issues-1m99</guid>
      <description>&lt;h2&gt;
  
  
  Introduction 🚀
&lt;/h2&gt;

&lt;p&gt;Ah, the joys of web development! Everything looks perfect on your desktop browser, but then you switch to mobile, and suddenly it's like you've entered a parallel universe. Weird vertical scrolls, fonts that refuse to load on the first render, and those pesky extra scroll glitches. 🤦‍♂️&lt;/p&gt;

&lt;p&gt;But fear not, fellow developer! We've got the solutions to these common mobile web development issues. Let's dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Mysterious Case of the Extra Vertical Scroll 📜
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; You've set your div to take up 100vh, but on mobile, you're still getting some unexpected vertical scrolls. Why? Mobile browsers like Chrome and Safari introduce extra UI elements that can mess with your perfect layouts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Dynamically set the body height based on the window's inner height.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;setBodyHeight&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resize&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setBodyHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setBodyHeight&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; By setting the body's height to the window's inner height, we ensure that our page takes up the exact height of the visible viewport, regardless of any browser UI elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Font Loading Fiasco 🅰️
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; You're using custom fonts, but during the initial render, the browser's default fonts load instead. This can lead to a jarring experience for users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Preload your fonts!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"preload"&lt;/span&gt; &lt;span class="na"&gt;as=&lt;/span&gt;&lt;span class="s"&gt;"font"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"YOUR_FONT_PATH_HERE"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"preload"&lt;/span&gt; &lt;span class="na"&gt;as=&lt;/span&gt;&lt;span class="s"&gt;"font"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"YOUR_SECOND_FONT_PATH_HERE"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; By preloading fonts, you're telling the browser to fetch them early in the loading process. This ensures that by the time your content renders, your custom fonts are ready to be displayed. Storing assets in a CDN like Cloudinary can further speed up this process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjnlu5z1uz5madrxteax.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjnlu5z1uz5madrxteax.jpg" alt="Image description" width="500" height="756"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Horizontal Scroll Sneak Attack 🚫
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; You've set your website to be 100vw width with no extra horizontal scrolls. It works on desktop, but some mobile browsers ignore the overflow property on the body, leading to unwanted horizontal scrolling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Use a wrapper for your body content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"WholeBodyWrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;noscript&amp;gt;&lt;/span&gt;You need to enable JavaScript to run this app.&lt;span class="nt"&gt;&amp;lt;/noscript&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.WholeBodyWrapper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;overflow-x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; By wrapping the entire content of the body and setting the overflow property on the wrapper, we ensure that the overflow rule is respected, even on mobile browsers that might ignore it on the body element itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion 🎉
&lt;/h2&gt;

&lt;p&gt;Mobile web development can be tricky, but with the right tools and knowledge, you can navigate these common pitfalls with ease. Remember, the key is to test, adjust, and test again. Happy coding! 🚀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxdnzcs6hx1mwpqlttr0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxdnzcs6hx1mwpqlttr0.jpg" alt="Image description" width="702" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this blog post serves as a helpful guide! Remember to replace the placeholders in the code snippets with your actual paths or values.&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>css</category>
      <category>fonts</category>
      <category>responsive</category>
    </item>
    <item>
      <title>Building and Deploying Nodejs Backend on AWS using Serverless Framework</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sun, 07 May 2023 10:10:01 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/building-and-deploying-nodejs-backend-on-aws-using-serverless-framework-175d</link>
      <guid>https://forem.com/aniketsingh98571/building-and-deploying-nodejs-backend-on-aws-using-serverless-framework-175d</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is serverless computing?&lt;/strong&gt;&lt;br&gt;
Serverless computing is a cloud computing model where the cloud provider dynamically manages the allocation and scaling of computing resources for running application code, allowing developers to focus solely on writing and deploying code without worrying about the underlying infrastructure. In simpler terms, it's a way of running code without having to worry about the servers on which it runs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is server-based computing?&lt;/strong&gt;&lt;br&gt;
In a traditional server-based architecture, the developer would need to provision and manage virtual machines, operating systems, web servers, and other infrastructure components required to host and run their application. This approach requires a significant investment in time and resources to set up and maintain, and can be expensive to scale and secure. &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server&lt;/th&gt;
&lt;th&gt;Serverless&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A server does not scale up or down. Its capacity cannot be exceeded,  and its resources stay available even if they’re not being used (being effectively wasted).&lt;/td&gt;
&lt;td&gt;Serverless systems automatically scale server instances up and down to handle the load.  I just wanted to let you know that you do nothing to achieve this behavior.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A server requires maintenance. If you run a server, you might have to monitor it, install software,  install patches, tune it, and perform other operations. You have to figure out how to deploy your code to it.&lt;/td&gt;
&lt;td&gt;Serverless system require no maintenance. The cloud provider handles all these details of managing  the underlying hardware. You just write and deploy code using tools provided by the cloud vendor.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A server has some ongoing cost associated with it. Typically costs are paid on an hourly, daily, or monthly  basis just to keep the server up and running, even if it’s not being used.&lt;/td&gt;
&lt;td&gt;Serverless systems are billed per function invocation. When you deploy code to a serverless backend,  you will be charged for resources uses (invocations, memory, bandwidth). If you use nothing, you are  charged nothing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A server allows you to deploy services that run on an ongoing basis. You can typically log in and run whatever  programs you want, whenever you want, for as long as you want.&lt;/td&gt;
&lt;td&gt;Serverless systems are event-driven by nature. You deploy code that runs in response to events that occur  in the system. These can be things like database triggers that respond to changes, or HTTP requests that serve an API.  Code does not run outside of the context of handling some event, and it is often constrained by some time limits.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Monolith Architecture&lt;/td&gt;
&lt;td&gt;Microservice Architecture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Example - AWS EC2&lt;/td&gt;
&lt;td&gt;Example -  AWS Lambda&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbtghbyot544hmhnp5tp.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbtghbyot544hmhnp5tp.jpeg" alt="Image description" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay! We will be developing two node API's for better understanding of the process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Requirements&lt;/strong&gt;:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://console.aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.postman.com/" rel="noopener noreferrer"&gt;Postman&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;:-&lt;/p&gt;

&lt;p&gt;1)  Initialize Node.js project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2)  Install serverless and serverless-offline libraries&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt; &lt;span class="nx"&gt;serverless&lt;/span&gt;
&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;serverless&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;offline&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3)  Execute the below command from your project directory terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;serverless&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;nodejs&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After following the above steps, your project directory will look something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbu5py6k5igtzjrpyznnj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbu5py6k5igtzjrpyznnj.png" alt="Image description" width="190" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4)  Delete &lt;code&gt;handler.js&lt;/code&gt; file and make a folder named &lt;code&gt;api&lt;/code&gt;.&lt;br&gt;
5)  Inside &lt;code&gt;api&lt;/code&gt; folder, create two files named &lt;code&gt;calculator.js&lt;/code&gt; and &lt;code&gt;sayHello.js&lt;/code&gt;&lt;br&gt;
6) copy and paste the below codes in their respective file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sayHello.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sayHello&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Go Serverless!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;calculator.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;calculator&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;queryStringParameters&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;===&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;add&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;num1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;num2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you might be thinking what is event, context and callback? 🤔 Don't worry I got you covered 😎.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event&lt;/strong&gt;: In AWS Lambda, an event is a trigger that initiates the execution of a Lambda function. An event can come from various sources, such as an API Gateway HTTP request, a file upload to an S3 bucket, or a message in an Amazon Simple Queue Service (SQS) queue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt;: The context object is an input parameter passed to a Lambda function at runtime, providing information about the execution environment and resources available to the function. The context object includes details such as the AWS request ID, function name, version, and memory size, and can be used by the function to interact with other AWS services and resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Callback&lt;/strong&gt;: A callback is a function that is passed as an argument to the Lambda function and is called by the function when it completes its execution. The callback function allows the Lambda function to return data to the calling code or to report errors or exceptions that occurred during execution. The callback function typically has two arguments: an error object and a data object, which the function can use to communicate the results of its execution back to the calling code.&lt;/p&gt;

&lt;p&gt;Now our two API's are ready, it's time to configure our functions in &lt;code&gt;serverless.yml&lt;/code&gt; file so that they can be deployed to AWS without any hassle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is &lt;code&gt;serverless.yml&lt;/code&gt; file?&lt;/strong&gt;&lt;br&gt;
The serverless.yml file is a configuration file used by the Serverless Framework to define and deploy serverless applications on various cloud platforms, such as AWS, Azure, and Google Cloud Platform. The serverless.yml file contains the application's infrastructure as code, including the services, functions, resources, and plugins required to run the application.&lt;/p&gt;

&lt;p&gt;The serverless.yml file typically includes the following sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;service: Defines the name and description of the serverless application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;provider: Defines the cloud provider and its specific configuration options.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;functions: Defines the serverless functions, their code, and their configuration options.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;resources: Defines the additional resources required by the application, such as databases, queues, and buckets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;plugins: Defines the plugins required by the application to extend the Serverless Framework's functionality.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By defining the application's infrastructure in a serverless.yml file, developers can easily deploy, manage, and version their serverless applications using the Serverless Framework's CLI. The &lt;code&gt;serverless.yml&lt;/code&gt; file also provides a reusable and portable way of defining serverless applications, allowing developers to deploy their applications on multiple cloud providers with minimal changes to the configuration file.&lt;/p&gt;

&lt;p&gt;Now since you know what's the purpose of &lt;code&gt;serverless.yml&lt;/code&gt; file, copy and paste the below configuration in your &lt;code&gt;serverless.yml&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;serverless-blog&lt;/span&gt;
&lt;span class="na"&gt;frameworkVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3"&lt;/span&gt;

&lt;span class="na"&gt;provider&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;aws&lt;/span&gt;
  &lt;span class="na"&gt;runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nodejs18.x&lt;/span&gt;
  &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ap-southeast-1&lt;/span&gt;

&lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;serverless-offline&lt;/span&gt;

&lt;span class="na"&gt;functions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;hello&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api/sayHello.sayHello&lt;/span&gt;
    &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/hello&lt;/span&gt;
          &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;post&lt;/span&gt;

  &lt;span class="na"&gt;calculataor&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api/calculator.calculator&lt;/span&gt;
    &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/calculator&lt;/span&gt;
          &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;get&lt;/span&gt;
          &lt;span class="na"&gt;request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;querystrings&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
                &lt;span class="na"&gt;num1&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
                &lt;span class="na"&gt;num2&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's deep dive into each and every thing mentioned in the configuration file:&lt;/p&gt;

&lt;p&gt;1) service: The name of your service.&lt;br&gt;
2) frameworkVersion: Framework version of serverless-lambda&lt;br&gt;
3) provider: In our case, we are using AWS and our functions will be deployed in the &lt;code&gt;ap-southeast-1&lt;/code&gt; region.&lt;br&gt;
4) plugins: If you are using some dev dependencies or external tools make sure to mention that in this section. In our case we are using &lt;code&gt;serverless-offline&lt;/code&gt; library as dev-dependency for local testing.&lt;br&gt;
5) functions: In this section, we list our all functions that we want to deploy on AWS.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;i) `hello` and `calculator` are the name of the functions that will be visible on AWS under lambda service.

ii) handler: It is the path where a particular function is defined. Example, in `api` folder we have `sayHello.js` file and in sayHello.js, we have `sayHello` module defined. Hence the handler is `api/sayHello.sayHello`

iii) http: It denotes that we are going to use Lambda proxy, you can refer AWS and serverless docs if you want some other proxies.

iv) path: It is the route on which we will be invoking that function. Example:- https://dev.to/calculator.

v) method: API methods like GET, PUT, POST etc.

vi) request: If you are using GET request then you have to define the query parameters in the style mentioned above.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;So, Yes! That's it. It's time to test our API's.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpst4kth2dtfr9o5ke36.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpst4kth2dtfr9o5ke36.jpeg" alt="Image description" width="200" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7) Run the below command in your project directory terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;serverless&lt;/span&gt; &lt;span class="nx"&gt;offline&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;httpPort&lt;/span&gt;  &lt;span class="mi"&gt;4000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successful building you will get the following URL's:&lt;br&gt;
&lt;code&gt;http://localhost:4000/dev/hello&lt;/code&gt;&lt;br&gt;
&lt;code&gt;http://localhost:4000/dev/calculator&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's test and See the Output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qure3yhv2co89srolpb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qure3yhv2co89srolpb.png" alt="Image description" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0deq8obz3w7zrswmndi1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0deq8obz3w7zrswmndi1.png" alt="Image description" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yay! We did it 🤝.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg1t1lxqmjtxtjhkcgvog.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg1t1lxqmjtxtjhkcgvog.jpg" alt="Image description" width="600" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Time for final deployment 👨‍💻!&lt;/p&gt;

&lt;p&gt;8) Run the below command from your project directory terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;serverless&lt;/span&gt; &lt;span class="nx"&gt;deploy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything goes well, you will see API Gateway URL's on your terminal.&lt;/p&gt;

&lt;p&gt;Once you run &lt;code&gt;serverless deploy&lt;/code&gt; a cloudformation service is created by AWS with resources such as API gateway, AWS Lambda, S3 bucket, etc based on your yml configurations. Cloudformation gives developers an added advantage to just focus on code and not worry about the resource creation. &lt;/p&gt;

&lt;p&gt;To Lean more about serverless - &lt;a href="https://www.serverless.com/" rel="noopener noreferrer"&gt;https://www.serverless.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you reached till here, I bet you learned something new today!&lt;br&gt;
Keep Learning, Keep Sharing! 😉&lt;/p&gt;

</description>
      <category>aws</category>
      <category>node</category>
      <category>serverless</category>
      <category>backend</category>
    </item>
    <item>
      <title>Debugging Web Applications.</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sun, 19 Mar 2023 12:17:18 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/debugging-web-applications-2g96</link>
      <guid>https://forem.com/aniketsingh98571/debugging-web-applications-2g96</guid>
      <description>&lt;p&gt;Hey readers 👋 , welcome back to yet another blog on a very interesting topic in which many beginner-level web developers struggle 😢.&lt;/p&gt;

&lt;p&gt;Debugging is a very important skill in software engineering, many software engineers spend a lot more time in debugging than actual coding. Trust me debugging doesn't mean that you are not a good software engineer or you didn't write clean code, well in fact if taken in a positive way it means that you are aware of the product which you are developing fully and know the edge cases also of that product 😎.&lt;/p&gt;

&lt;p&gt;Prevention is better than cure, well this quote fits in the software industry too meaning if we find and prevent bugs early in the development or testing phase then the risk of application breaking in production may reduce.&lt;/p&gt;

&lt;p&gt;Bugs don't have to be only code related, they can be functionality bugs also for example you are clicking a button and the behavior of that button is something else rather than what you expected.&lt;/p&gt;

&lt;p&gt;Let's discuss various debugging tactics 😉:-&lt;/p&gt;

&lt;p&gt;✨Debugging frontend with border CSS property:-&lt;/p&gt;

&lt;p&gt;Consider below HTML code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;{classes.CheckContainerOne}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hey I am Here!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, in this case, we want the &lt;code&gt;p&lt;/code&gt; tag to be vertically and horizontally centered into its respective div which is &lt;code&gt;CheckContainerOne&lt;/code&gt;, To make the content center to its div we need to first assign a height and width to the div and then flex it.&lt;/p&gt;

&lt;p&gt;Check the below CSS for the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.CheckContainerOne&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50vw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output 1:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5prbfmal7n9o4xk4es0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5prbfmal7n9o4xk4es0.png" alt="Image description" width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the above output, we cannot predict whether our content is centered or not, so how can we check it? Well just give a border to the div and then see the magic 😁.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.CheckContainerOne&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50vw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0hk98wuj19v1a74js2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0hk98wuj19v1a74js2k.png" alt="Image description" width="769" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this, we can easily say 'Yes! our div is now centered' 🤝.&lt;br&gt;
In this scenario, some developers prefer using &lt;code&gt;background-color&lt;/code&gt; instead of &lt;code&gt;border&lt;/code&gt; and it depends 😒. From the above trick, you can also check whether your div is properly placed at the right location or not.&lt;/p&gt;

&lt;p&gt;✨Inspecting elements using the browser inspect tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;{classes.BorderContainer}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Inspect Me!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="nc"&gt;.BorderContainer&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50vw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="n"&gt;pz&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is an issue in the above CSS code but you didn't notice it during development and you are wondering why the CSS is not being reflected on the frontend 🤔. Well, don't worry I got you covered 😎.&lt;br&gt;
Follow the below steps:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Right-click on the web page and choose &lt;code&gt;inspect&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Once you click on inspect, you will see below screen&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl3l5szlc1k9jfixt9848.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl3l5szlc1k9jfixt9848.png" alt="Image description" width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now select the element where you think is an issue and see the CSS code on the right side. You can also select the div from the inspect tool HTML view.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqd8x7tcyhkhghnqo9gta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqd8x7tcyhkhghnqo9gta.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the above image, we can see that our border property is invalid, now we got the culprit and can fix it.&lt;/p&gt;

&lt;p&gt;If you are working with any modern framework or library on the frontend then you might have used some UI library like react-date-picker etc. In the library, you might want to tweak some CSS to fit in with your website theme. To override CSS styles of the UI library you have to write the same CSS classes in the root CSS file called &lt;code&gt;index.css&lt;/code&gt; or sometimes the library itself provides a JSON which contains the classes which you can override. Now there can be a case that the class is not overridden and the CSS is not applied, in this case, you can use the above trick to check whether the class is added or not.&lt;/p&gt;

&lt;p&gt;✨Debugging using &lt;code&gt;console.log()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;{classes.ButtonContainer}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;onClick=&lt;/span&gt;&lt;span class="s"&gt;{checkFunction}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Check Value&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;checkFunction&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This is working&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might have done the above thing many times, but why do we do it? Well, we just want to check whether we attached the event listener properly and to the correct element or not.&lt;/p&gt;

&lt;p&gt;There are certain situations where we are not getting the expected value, check below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;checkFunction&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This is working&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now some people might think that the &lt;code&gt;a&lt;/code&gt; value will be &lt;code&gt;5&lt;/code&gt; but it's not and you try to console the &lt;code&gt;a&lt;/code&gt; value at a different line in the code.&lt;br&gt;
If you are a react js developer then printing &lt;code&gt;state&lt;/code&gt; and &lt;code&gt;ref&lt;/code&gt; values every time is pretty normal. Not all local variables in react components are accessible in JSX, especially if you are changing it in runtime and if it didn't get updated you tend to console it in JSX.&lt;/p&gt;

&lt;p&gt;✨Debugging Backend Code:&lt;br&gt;
Every backend developer sometimes gets frustrated about why data is not coming to the backend and due to this, they start blaming frontend developer that probably you have not sent the data in a proper format. Well, why play the blame game here? you can just console the body of the request using &lt;code&gt;req.body&lt;/code&gt; and check whether data is coming or not.&lt;/p&gt;

&lt;p&gt;Well, now that backend developers say that my &lt;code&gt;req.body&lt;/code&gt; is empty that means there is an issue on the frontend. You as a frontend developer can debug using the network tab of the browser.&lt;br&gt;
How can I access the network tab?&lt;br&gt;
Follow the below steps:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Right Click on the web page and click on inspect.&lt;/li&gt;
&lt;li&gt;Go to the network tab.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Something like the below will be your screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iz3zbpa2gqsxtb6luhv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iz3zbpa2gqsxtb6luhv.png" alt="Image description" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the network tab, you can check your payload, request headers, the response from the server, and all the requests which you are sending from frontend.&lt;/p&gt;

&lt;p&gt;✨Experimenting with styles in the browser:-&lt;br&gt;
If you don't want to directly code the css instead you want to first experiment with different styles then you can do this using the inspect tool of the browser.&lt;/p&gt;

&lt;p&gt;See the below video for reference:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/dn9teekkw/video/upload/v1679226758/tuts_hj16kp.mp4" rel="noopener noreferrer"&gt;Inspect Tool&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✨Using Browser call stack to debug:&lt;br&gt;
You can also track the function calls, variable environments, and their values with the help of the call stack in the browser. I don't use it much.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Things to follow, Things to avoid in CSS!</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Fri, 25 Nov 2022 11:39:21 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/things-to-follow-things-to-avoid-in-css-nj9</link>
      <guid>https://forem.com/aniketsingh98571/things-to-follow-things-to-avoid-in-css-nj9</guid>
      <description>&lt;p&gt;Hey readers 👋, before starting to explain things let me first introduce myself so that you can gain some trust in what I am saying and why I am saying it. I am a self-taught developer currently working at a startup whose projects majorly involve building complex web3 and web2 products. We give the utmost importance to UX/UI in our projects.&lt;/p&gt;

&lt;p&gt;My role at the organization involves developing the front end of the applications. Yes, I am responsible for centering a div in the middle of a page 😅. My work consists in developing UI screens with adding more interactivity with some cool animations. Here animations don't mean hover and active effects but making a line move around the four divs in a jig-saw manner and a lot more. &lt;br&gt;
Trust me, front-end development is not an easy task 😥 . But don't be afraid of it, it's interesting too 😊.&lt;/p&gt;

&lt;p&gt;I primarily use ReactJS for the front-end side of applications. Even though you use any libraries or frameworks like Vue, Angular, Svelte, etc under the hood it's all about HTML, CSS, and Javascript. The reason being JSX is all about the Syntactic way of writing HTML only. To override the default classes of a library you should know CSS. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:-&lt;/strong&gt; Never start your web development journey with libraries of JS and CSS like react, angular, bootstrap, Bulma, etc.&lt;/p&gt;

&lt;p&gt;Until now you must have got little sense of "Why HTML and CSS are so much important?", let me be brief now. See when you work at a web agency or a startup where you have to build websites from scratch with the designs that the designer provided to you, you have to be pixel-perfect in your work because every time the designer will not ask you for the same edits. As we all know how much creative designers are, and that's not the actual problem because they are meant to be creative and your job as being frontend engineer is to transform their imagination into code. This is where the core HTML and CSS knowledge comes into the picture. &lt;/p&gt;

&lt;p&gt;Whenever a design is provided to you, your mind should start thinking about how should I structure this. Should I use flex or grid? All these decisions become easy when you have in-depth knowledge of HTML and CSS.&lt;/p&gt;
&lt;h2&gt;
  
  
  Good Practises ✅
&lt;/h2&gt;
&lt;h3&gt;
  
  
  🎇 Short-hand properties.
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;margin-right&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="err"&gt;20&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;margin-left&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="err"&gt;10&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Instead, you can follow this:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="err"&gt;0&lt;/span&gt; &lt;span class="err"&gt;20&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt; &lt;span class="err"&gt;20&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Aliasing:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;margin&lt;/span&gt;&lt;span class="nd"&gt;:top&lt;/span&gt; &lt;span class="nt"&gt;right&lt;/span&gt; &lt;span class="nt"&gt;bottom&lt;/span&gt; &lt;span class="nt"&gt;left&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✨ CSS variables.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;font-size&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="err"&gt;16&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;color&lt;/span&gt;&lt;span class="nd"&gt;:red&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Imagine a case where your application is fully developed and its codebase is quite large, the client wants to change the color of the text from red to green and reduce the font-size a little bit.&lt;/p&gt;

&lt;p&gt;Now, will it be a good idea to go through each CSS file and do the changes? Not at all, at least to me.&lt;/p&gt;

&lt;p&gt;In index.css of your react application you can do something like this:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="py"&gt;--black&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;#000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="py"&gt;--X-large&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;18px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now go to any css file and do this:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;  &lt;span class="nt"&gt;font-size&lt;/span&gt;&lt;span class="nd"&gt;:var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--X-large&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now even if the client wants to change anything, you have to tweak only one index.css file that's it.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎆 Global styling.
&lt;/h3&gt;

&lt;p&gt;You might be doing something like the below in your CSS files:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of this, you can simply add the above code in index.css of your react application and all the changes will be applied to each component.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ Class Naming Conventions.
&lt;/h3&gt;

&lt;p&gt;Always make sure to follow standard naming conventions. The organization you are working in might have a dev guide related to this, if not then you can tell everyone to follow a common naming convention, like giving class names in PascalCases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.ClassContainer&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🎆 Debugging with borders.
&lt;/h3&gt;

&lt;p&gt;If you are not sure how much space a container is taking in a page or where is this container placed?&lt;br&gt;
Just add a border to that container, and it will solve your problems.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hey There!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🎇 Browser Compatibility.
&lt;/h3&gt;

&lt;p&gt;Not all CSS properties and their values are supported in browsers and also the look of certain HTML elements gets changed when viewed on browsers like safari.&lt;br&gt;
So it's better to do a compatibility test of CSS properties using caniuse and also build custom components for HTML elements.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎇 Understanding Box Model.
&lt;/h3&gt;

&lt;p&gt;It is important to know the CSS Box model, it will help you to adjust spaces between elements, inside of elements, and their borders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27atqw1rmjag4wfezygi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27atqw1rmjag4wfezygi.png" alt="Box Model" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ When to use percentages? When to use px?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"InnerContainer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hey There!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&lt;/span&gt;
  &lt;span class="err"&gt;&amp;lt;/div&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;900px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;900px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.InnerContainer&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;80%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Suppose you have a condition just like above, where there is one parent container named "container" and its child container named "InnerContainer", so what you can do is give a constant width to the parent container and make the child container width in percentage. Now what will happen is that the child container will take 80% of 900px, and on smaller devices, you can just reduce the size of the parent container and the child container will automatically take up the required size because it is in percentages. This is not only valid till only two containers, but you can nest till any number of containers, just give the constant width to the outermost container and rest percentages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bad Practises ❌
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🎆Using !important.
&lt;/h3&gt;

&lt;p&gt;Try to avoid using  !important it will work in some cases but there will be a possibility that it can break things as well. In the rarest cases, you can use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎆 Using Positions.
&lt;/h3&gt;

&lt;p&gt;I am not a fan of using positions in some cases just because it becomes too static in the sense you have to manage it on each small device size. Instead, you can go with flexbox if it suits your need.&lt;/p&gt;

&lt;p&gt;Hope you liked the Blog 😁 , See you next time 👋.&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Data is Everything!</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sat, 05 Nov 2022 10:32:52 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/data-is-everything-1mhp</link>
      <guid>https://forem.com/aniketsingh98571/data-is-everything-1mhp</guid>
      <description>&lt;p&gt;We live in a world where "data" is given more priority than others 🙄, and that's a fact 😎! No one wanted to share about "what they are doing", "where they were last night," etc. just because of privacy reasons 😤. Isn't data privacy something that everyone should understand? 🤔 And what will happen if we lose it? "If we are connected to the internet, then we start to lose our privacy," said one of the senior developers.&lt;/p&gt;

&lt;p&gt;The major source of income for big tech giants like Google, Amazon, Meta, etc. comes from our data alone. Curious to know how? continue reading below 🙂. Well, we have been discussing so far "data" and "data privacy", Let's decode both.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is data?
&lt;/h2&gt;

&lt;p&gt;Data is a collection of raw, unorganized facts and details like text, observations, figures, symbols, images and descriptions of things, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is data privacy?
&lt;/h2&gt;

&lt;p&gt;Data privacy generally means the ability of a person to determine for themselves when, how, and to what extent personal information about them is shared with or communicated to others.&lt;/p&gt;

&lt;p&gt;Do you have any idea how data was handled in the web1 world, where all of these things were not happening? Check it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is web1?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Web1 was introduced when the internet was born. At that time the main purpose of websites was to show static content in the form of blogs, newsletters, and articles.&lt;/li&gt;
&lt;li&gt;All the websites were internally linked using hyperlinks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Since there were no user interactions with the websites, the businesses used fewer data overall. "No user interactions" in this context refers to the inability of users to add data to websites, give reviews on items, or express their liking. In a nutshell, we may state that "data privacy was the center of the Web 1 universe. 😉"&lt;/p&gt;

&lt;p&gt;The big picture of Data Privacy comes in the web2 world.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is web2?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Web2 was introduced in order to bring interactiveness to websites and also users can perform certain actions.&lt;/li&gt;
&lt;li&gt;Big tech giants like Google, Amazon, Microsoft, etc are currently ruling the web2 world.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Social networking platforms like Instagram and Twitter and e-commerce websites like Amazon and Flipkart spring to mind when we talk about web2. Every day, these business servers receive millions of Terabytes of data uploads.&lt;/p&gt;

&lt;h3&gt;
  
  
  What actual data gets uploaded to their servers 🤔 ?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The servers of Twitter and Instagram save your photographs, comments, likes, dislikes, messages, and a variety of other things.&lt;/li&gt;
&lt;li&gt;The servers of Flipkart and amazon save your reviews, ratings, purchases, and many other things.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;More than 300 million photos get uploaded per day. Every minute there are 510,000 comments posted and 293,000 statuses updated.&lt;/p&gt;

&lt;h4&gt;
  
  
  Well did I told you that they track your web activity too 🤨? How?
&lt;/h4&gt;

&lt;p&gt;Assuming you've made the decision to get some sneakers from Amazon, you head there to look for them. bought it. Google now suggests some sneakers from a different brand when you start searching for anything else. This is nothing more than a few machine learning algorithms that use information from your online browsing.&lt;/p&gt;

&lt;h4&gt;
  
  
  Is data that important to a company?
&lt;/h4&gt;

&lt;p&gt;Indeed, from a business standpoint, they were interested in learning things like "Are people content with our product? ", "Which product is trending on our platform? ", "reviews linked to a product? ", etc.&lt;/p&gt;

&lt;p&gt;There are several businesses that utilize user data for marketing, financial, and healthcare analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Future of Data -  Alternative data 😎!
&lt;/h3&gt;

&lt;h4&gt;
  
  
  What is Alternative Data?
&lt;/h4&gt;

&lt;p&gt;Alternative data is defined as non-traditional data that can provide an indication of future performance of a company outside of traditional sources, such as company filings, broker forecasts, and management guidance.&lt;/p&gt;

&lt;p&gt;Want to know more about alternative data 😄?&lt;br&gt;
Check out &lt;a href="https://nubela.co/blog/the-ultimate-guide-to-alternative-data-what-is-it-really/" rel="noopener noreferrer"&gt;Proxycurl&lt;/a&gt; now!&lt;/p&gt;

</description>
      <category>bigdata</category>
      <category>statistic</category>
      <category>analytics</category>
      <category>marketing</category>
    </item>
    <item>
      <title>Web1 vs Web2 vs Web3</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Fri, 22 Jul 2022 14:42:49 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/web1-vs-web2-vs-web3-2mjo</link>
      <guid>https://forem.com/aniketsingh98571/web1-vs-web2-vs-web3-2mjo</guid>
      <description>&lt;h2&gt;
  
  
  ✨ Web1 ✨:-
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Web1 was introduced when internet was born. At that time the main purpose of websites was to show static contents in the form of blogs, newsletters and articles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All the websites were internally linked using hyperlinks. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A user was able to only consume the information not interact with it in web1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTML and CSS were used to built websites in Web1.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7cjlbftulyfzircnxpy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7cjlbftulyfzircnxpy2.png" alt="Image representing an example of a website in web1:" width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Web2 🎇
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Web2 was introduced in order to bring interactiveness to websites and also user can perform certain actions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Big tech giants like Google, Amazon, Microsoft are currently ruling the web2 world.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now you may be confused that how these big tech giants are ruling the world, well let me decode it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let's suppose you open instagram.com and logged in into your account.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the instagram home screen you see the posts of the followers which you follow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the instagram feed section, you get to see the posts according to your interests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now the thing here is that you are not controlling what you are seeing in your feed, its instagram who is controlling what and how to display the posts to your feed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;So thats how our user data and activity is stored on instagram servers and based on the data, instagram is recommending the posts to us.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;So in short terms, a central entity called instagram who is controlling the user data in web2 and thats how web2 is lead by the tech giants.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTML, CSS, Javascript, ReactJs etc are the libraries/frameworks used to build websites in web2 world.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And don't forget we are living in web2 world so take care of your data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎆 Web3 🎇
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Web3 is the term which is currently booming a lot.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In web3 each user is its own boss, which means instead of a central entity ruling the data of the users, here each user can monitor the activity going on and they are highly interconnected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In web3 world, we mostly deal with transactions which means whatever actions we perform on the web is recorded in the public ledger as a transaction and everyone can see the transaction details.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web3 contains many topics like NFT, DeFi, Blockchain, Smart Contracts and we will cover this topic separately in future blogs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I hope you got a high level view of how web1,web2 and web3 works 🤞.&lt;br&gt;
See you in the next blog 👋.&lt;/p&gt;

</description>
      <category>web1</category>
      <category>web2</category>
      <category>web3</category>
    </item>
    <item>
      <title>ALL ABOUT OPEN SOURCE</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sat, 20 Feb 2021 14:35:32 +0000</pubDate>
      <link>https://forem.com/edualgo/all-about-open-source-3d2l</link>
      <guid>https://forem.com/edualgo/all-about-open-source-3d2l</guid>
      <description>&lt;h3&gt;
  
  
  What is Open Source?
&lt;/h3&gt;

&lt;p&gt;Open Source software is the software whose source code is freely available under some licensing conditions so that we can provide some extra features to the current version, find bugs and report some issues. With the help of Open-Source software, we can read its source code and if needed we can implement its some part into our project under some licensing conditions. Open Source is not only related to software but also is more related to programming languages, projects and some well-known High leveled Design Systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open Source Software.
&lt;/h3&gt;

&lt;p&gt;Here is the list of Some Popular Open-Source Projects:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Mozilla Firefox&lt;br&gt;
Mozilla Firefox is a customizable internet browser and free open-source software. It offers thousands of plugins that are accessible with a single click of your mouse. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LibreOffice&lt;br&gt;
LibreOffice is a complete office suite that offers presentations, documents, spreadsheets, and databases.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GIMP&lt;br&gt;
Another of the best open software source examples that are worth mentioning is the photo editing tool GIMP.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VLC Media Player&lt;br&gt;
VLC Media Player is one of the most popular open-source software examples that you can use for free.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linux&lt;br&gt;
According to a Stack Overflow survey, 83.1% of developers claimed that Linux is the most wanted platform. Linux is one of the most user-friendly open-source software on the market. It is most commonly used on Android devices and desktops.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GNU Compiler Collection&lt;br&gt;
GNU Compiler Collection is a collection of compilation tools for software development in the C, C++, Ada, Fortran, and other programming languages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python&lt;br&gt;
Python is common programming and scripting language used by custom software developers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PHP&lt;br&gt;
When talking about the best open-source software examples of 2021, we shouldn’t miss PHP. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MySQL:&lt;br&gt;
MySQL is an open-source relational database management system.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Nowadays open source practices are becoming very popular, developers are outsourcing their project to the world so that his/her project gets proper shape as per their needs. There is also a scenario that every person on this planet does not know each tech-stack that exists so if he/she wants to add some extra feature to his project which they might not know then they can approach a person who knows the field and can do the required changes. Many big organizations/companies like Netflix, Linux foundation, etc are making their project open source so that they get ample amount of suggestions, improvements, and bug fixes from experienced developers.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is git?
&lt;/h3&gt;

&lt;p&gt;Git is the most commonly used version control system. Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to. Git also makes collaboration easier, allowing changes by multiple people to all to be merged into one source. Git is the main root of the version control system and many company's/organizations use it on their platform for project tracking.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is GitHub?
&lt;/h3&gt;

&lt;p&gt;GitHub is a website for hosting projects that use git.&lt;/p&gt;

&lt;h3&gt;
  
  
  Various Platforms for Open-Source projects:-
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;GitLab&lt;br&gt;
Gitlab is an open-source, powerful, secure, efficient, feature-rich, and robust application for handling software development and operations (DevOps) lifecycle. This is possibly the number one alternative for Github, as it supports group milestones, issue tracker, configurable issue boards and group issues, moving of issues between projects, and more. It also supports time tracking, powerful branching tools and protected branches and tags, file locking, merges requests, custom notifications, project roadmaps, &lt;br&gt;
issues weights, confidential and related issues, burndown charts for project and group milestones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bitbucket&lt;br&gt;
Bitbucket is a powerful, fully scalable, and high-performance development platform designed for professional teams. Education users and open source projects get free Bitbucket accounts and many other features. You can easily import your GitHub repositories to Bitbucket in 6 simple steps and supports third-party integrations. It has remarkable features such as Bitbucket pipelines, code search, pull requests, flexible deployment models, diff view, smart mirroring, issue tracking, IP whitelisting, and branch permissions for safeguarding your workflow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Beanstalk&lt;br&gt;
Beanstalk is a powerful, secure, high-performance, and reliable platform for managing source code repositories. Beanstalk designed to improve your development workflow using features such as code review, issue tracker, repository statistics, release notes, notifications, email digests, compare view, and a full history &lt;br&gt;
of commits and files, and so much more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Launchpad&lt;br&gt;
Launchpad is a fully free, well-known platform for building, managing, and collaborating on software projects, built by Canonical, the makers of Ubuntu Linux. It has features such as code hosting, Ubuntu package building and hosting bug tracking, code reviews, mail listing, and specification tracking. Furthermore, Launchpad supports translations, answer tracking, and FAQs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitBucket&lt;br&gt;
GitBucket is an open-source, highly pluggable Git platform that runs on JVM (Java Virtual Machine). It comes with features such as a repository viewer, issues tracker, pull requests, documentation, and wiki, as well as a plugin system to extend its core features.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To get into the world of open source, you should know at least one programming language, knowledge in the sense you should be able to solve complex problems using the language. And the second most required thing is learning git and GitHub, there are lots of resources available on the internet regarding the same. Learning doesn't mean only watching the tutorial videos, you must have a habit of "coding-along" while learning.&lt;/p&gt;

&lt;p&gt;Now that you have learned and implemented one programming language and git/GitHub, it's time now to look for some beginner-friendly repositories in which you can make your hands dirty by making some good contributions and applying the knowledge you have gained. There are two ways in which you can find repositories.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using the GitHub search feature.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3fdfzjmaswi7ocu751j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3fdfzjmaswi7ocu751j.jpg" alt="1" width="800" height="199"&gt;&lt;/a&gt;&lt;br&gt;
Here you can write your programming language name on the place where I have marked with red and hit enter then Github will list all the repositories that use the particular language.&lt;/p&gt;

&lt;p&gt;2.Google it.&lt;br&gt;
You can use google search by just typing "Beginner friendly repositories for "[it's just a demo sentence].&lt;/p&gt;

&lt;p&gt;Note:- In the above sections, I have just guided you for searching for a project related to your language, but for finding the relevant organization you need to hustle more as it requires a decent amount of searches in finding perfect-fit organizations related to your tech-stack/language.&lt;/p&gt;

&lt;p&gt;After you found the matching repositories/organization related to your tech-stack/language then setup the code-base on your local machine and start understanding it. If you are finding any difficulty in setting up the code-base then you can contact the maintainer/mentor of the repository regarding the same. But before approaching any maintainer regarding the doubt, firstly you should see for the errors you are getting on the internet and if you&lt;br&gt;
are not able to tackle it then you can approach the maintainer.&lt;/p&gt;

&lt;p&gt;After you get familiar with the code-base try to search for the issues that have a "good-first-issue" label on them, the meaning of the label is that even the beginner having the basic knowledge of the tech-stack can work on the issue. If you found some extra bug or wanted to add some extra feature then you can create an issue by yourself, but make sure that you check all the issues first to ensure that there is no such issue created first.&lt;/p&gt;

&lt;p&gt;Open source is not about just coding, you can work on improving the documentation[Readme. md] also of the project. Documentation is also equally important as coding as it guides the collaborators step by step about the project and "How you can contribute to it".&lt;/p&gt;

&lt;p&gt;If you get stuck on solving some issues, you can take help from other developers using the IRC channel/slack of the organization. The biggest advantage of open source is that the community is there to help you at each stage of your development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Good practices for contribution:-
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Always raise an issue first before creating a PR directly.&lt;/li&gt;
&lt;li&gt;Always make your own branch for making changes and then create a PR from your branch.&lt;/li&gt;
&lt;li&gt;Always be concise about your doubts.&lt;/li&gt;
&lt;li&gt;Be humble while asking your doubt and be patient till your doubts are resolved.&lt;/li&gt;
&lt;li&gt;Always follow the code of conduct and contributing guidelines of the project.&lt;/li&gt;
&lt;li&gt;If you are creating an issue then be descriptive about the issue, add some images related to your fixes, etc.&lt;/li&gt;
&lt;li&gt;During creating a PR, provide a proper description of the changes you have made with screenshots if necessary.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Making your first contribution:-
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Fork the repository.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs7tk3g0vepv3w9zllel7.jpg" alt="2" width="800" height="247"&gt;
open your cmd.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git clone &lt;a href="https://github.com/YOUR-USERNAME/repository-name.git" rel="noopener noreferrer"&gt;https://github.com/YOUR-USERNAME/repository-name.git&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wp3v0e4dz282rahzta1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wp3v0e4dz282rahzta1.jpg" alt="3" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;cd repository-name.&lt;br&gt;
i. git remote add upstream [URL of mail repository]&lt;br&gt;
ii. git pull upstream&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.git checkout -b "branch_name" &lt;br&gt;
 i. git pull upstream branch_name&lt;/p&gt;

&lt;p&gt;5.Make your changes.&lt;/p&gt;

&lt;p&gt;6.git add . // it adds all files&lt;/p&gt;

&lt;p&gt;7.git commit -m "commit-message"&lt;/p&gt;

&lt;p&gt;8.git push -u origin &lt;/p&gt;

&lt;p&gt;9.create a pull request&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv0fc530leh8f6jaem96l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv0fc530leh8f6jaem96l.png" alt="6" width="800" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;10.open pull request.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowyhfai8atiso7gb89m5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowyhfai8atiso7gb89m5.png" alt="7" width="800" height="443"&gt;&lt;/a&gt;&lt;br&gt;
Wait for your PR to get reviewed and merged. Congratulations 👏🥇 you wrote a line of code that is going to be used by hundreds or thousands of people, this feeling can not be expressed as it has its own importance.&lt;/p&gt;

&lt;p&gt;Even though your PR gets merged but it's your responsibility to stay in touch with the project and the maintainers, help other peers who are facing&lt;br&gt;
an issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open Source Programs:-
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://summerofcode.withgoogle.com/" rel="noopener noreferrer"&gt;Google Summer of Code&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://gssoc.girlscript.tech/index.html" rel="noopener noreferrer"&gt;GirlScript Summer of Code&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://fellowship.mlh.io/" rel="noopener noreferrer"&gt;MLH Fellowship&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.outreachy.org/" rel="noopener noreferrer"&gt;Outreachy&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developers.google.com/season-of-docs" rel="noopener noreferrer"&gt;Season of Docs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Advantages of open source contribution.
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Ability to work with a large code-base.&lt;/li&gt;
&lt;li&gt;Grow your network.&lt;/li&gt;
&lt;li&gt;Habit of writing efficient and precise code.&lt;/li&gt;
&lt;li&gt;You can add your contributions to your resume.&lt;/li&gt;
&lt;li&gt;Improves problem-solving skills.&lt;/li&gt;
&lt;li&gt;Get to learn something new.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>opensource</category>
      <category>github</category>
      <category>git</category>
      <category>community</category>
    </item>
    <item>
      <title>GIL in Python</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sun, 07 Feb 2021 08:59:54 +0000</pubDate>
      <link>https://forem.com/edualgo/gil-in-python-2imi</link>
      <guid>https://forem.com/edualgo/gil-in-python-2imi</guid>
      <description>&lt;h2&gt;
  
  
  What is Threading?
&lt;/h2&gt;

&lt;p&gt;Threading in python is used to run multiple threads (tasks, function calls) at the same time. This means that your program will have two things happening at once. Threading is a feature usually provided by the operating system. Each thread has its own memory space.&lt;/p&gt;

&lt;h4&gt;
  
  
  Python code without thread.
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;#Program for time estimation of a function without threads.
#import time module
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="c1"&gt;#initializing start variable with time in seconds before the code execution
&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;do_something&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sleeping 1 second&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Done sleeping&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#If we call the do_something() once it will take 1.01 seconds for execution.    
&lt;/span&gt;&lt;span class="nf"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;#But if call the do_something() twice, it will take upto 2.02 seconds for exection.
#The program runs synchronously.
&lt;/span&gt;&lt;span class="nf"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;finish&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter &lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Finished in&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;finish&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; seconds&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Python code with thread.
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;#Program for time estimation of a function with threads.
#import module
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;threading&lt;/span&gt;

&lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;do_something&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sleeping 1 second....&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Done sleeping...&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#Assigning thread to each function for parallel execution.
&lt;/span&gt;&lt;span class="n"&gt;t1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;threading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Thread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;t2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;threading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Thread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#Telling our OS to execute the threads
&lt;/span&gt;&lt;span class="n"&gt;t1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;t2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;t1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;t2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;finish&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;perf_counter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;#Because of threads process gets completed in 1.02 seconds
&lt;/span&gt;&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Finished in&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;finish&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; seconds&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In threading, the operating system actually knows about each thread and can interrupt it at any time to start running a different thread. Threading runs on a single processor and therefore only runs one at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Concurrency?
&lt;/h2&gt;

&lt;p&gt;The dictionary definition of concurrency is simultaneous occurrence. Concurrency is great for IO-bound operations such as for reading a file or communicating over a network. If many threads start executing simultaneously then we can say that it is concurrent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Process vs Thread
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4d7fag708qujjsx59pmd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4d7fag708qujjsx59pmd.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Multithreading?
&lt;/h2&gt;

&lt;p&gt;In multithreading, the concept of threads is used. Multithreading is defined as the ability of a processor to execute multiple threads concurrently.&lt;/p&gt;

&lt;h2&gt;
  
  
  GIL[Global Interpreter Lock]
&lt;/h2&gt;

&lt;p&gt;The Python Global Interpreter Lock or GIL, in simple words, is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter. This means that only one thread can be in a state of execution at any point in time. &lt;br&gt;
The impact of the GIL isn’t visible to developers who execute single-threaded programs. This means that in python only one thread will be executed at a time. The performance of the single-threaded process and the multi-threaded process will be the same in python and this is because of GIL in python. Python has a reference count variable that keeps track of the number of references that point to the object. When this count reaches zero, the memory occupied by the object is released.&lt;/p&gt;

</description>
      <category>python</category>
      <category>gil</category>
      <category>thread</category>
      <category>multithread</category>
    </item>
    <item>
      <title>Generators in Python</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sun, 24 Jan 2021 07:28:46 +0000</pubDate>
      <link>https://forem.com/edualgo/generators-in-python-3dml</link>
      <guid>https://forem.com/edualgo/generators-in-python-3dml</guid>
      <description>&lt;h2&gt;
  
  
  Yield
&lt;/h2&gt;

&lt;p&gt;Yield is a keyword in python which is used to throw[return] a single value from a list at a time to a calling function, whenever a function encounters a yield keyword it pauses the execution of the function and throws specified values by maintaining the local memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Function which yields the numbers.
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;normal_yield&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
    &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;

&lt;span class="c1"&gt;# iterate over the numbers
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;normal_yield&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whenever calling function execution stops, then control passes to the next line below the yield keyword in the called function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Program to count numbers 1 to 10.
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;number_count&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# value initialization.
&lt;/span&gt;    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="c1"&gt;# infinite loop.
&lt;/span&gt;    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
        &lt;span class="c1"&gt;# after function called, flow execution starts from here.
&lt;/span&gt;        &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="c1"&gt;# Priting the values.
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;number_count &lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Iterators
&lt;/h2&gt;

&lt;p&gt;We can also iterate through the list using the next() iterator function after the list is yielded. Although 'for in' loop is much more convenient than the next() method in case of execution time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;square_number&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;yield &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#variable holding the yielded number
&lt;/span&gt;&lt;span class="n"&gt;my_nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;square_number &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="c1"&gt;#iterating using the next() functions
&lt;/span&gt;&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Generators
&lt;/h2&gt;

&lt;p&gt;Generators are like the normal python functions which we define, but if the function contains the 'yield' keyword in the definition then the function becomes a generator function. Yield is a keyword that makes the generator function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;compute&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
      &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;compute &lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; is Even&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Return vs Yield
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Return
&lt;/h3&gt;

&lt;p&gt;Whenever a function runs, the return statement has to wait for the process to complete and after the function execution comes to an end it returns the whole variable or list to the calling function. This takes some time for execution as well as occupies the memory for the whole list. The next time we want to execute the same function then it will run from the beginning.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;square_numbers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;#return has to wait to process the above statements.
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;span class="n"&gt;my_number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;square_numbers &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Yield
&lt;/h3&gt;

&lt;p&gt;If the function encounters yield keyword it pauses the execution and sends the value to the calling function with keeping local memory as it is, after the calling function executes its task the process returns to the next line of yield in the function definition. With this, the execution speed is maintained as well as it also takes very little space in memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;number_square&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;yield &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;number_square &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advantages of Generators:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Works in a better way with large sets of data as generators 
throw only one value at a time instead of returning the whole 
list like a return.&lt;/li&gt;
&lt;li&gt;Return statement consumes lots of space in memory and also 
takes more time for execution while generators don't.&lt;/li&gt;
&lt;li&gt;Return allows the function to execute from the beginning while 
yield only executes the statement below it and maintains local 
memory for variables.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disadvantage of Generators:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The only disadvantage of generators is that they are not 
commonly used and are less popular.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>generators</category>
      <category>yield</category>
      <category>return</category>
    </item>
    <item>
      <title>Hactoberfest2020</title>
      <dc:creator>Aniket Singh</dc:creator>
      <pubDate>Sat, 17 Oct 2020 04:29:28 +0000</pubDate>
      <link>https://forem.com/aniketsingh98571/hactoberfest2020-357n</link>
      <guid>https://forem.com/aniketsingh98571/hactoberfest2020-357n</guid>
      <description>&lt;p&gt;Completed #hacktoberfest2020!&lt;br&gt;
This was my first time experience with #hacktoberfest.&lt;br&gt;
Being a beginner I learned a lot about how to contribute and the importance of #opensource contribution.&lt;br&gt;
I came across many good repositories that enhanced my knowledge and taught me a lot.&lt;br&gt;
Thank you DigitalOcean, GitHub, and DEV Community for giving developers such a great platform, it was really helpful.&lt;/p&gt;

</description>
      <category>github</category>
      <category>hacktoberfest2020</category>
      <category>digitalocean</category>
    </item>
  </channel>
</rss>
