<?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: Vedangi Thokal</title>
    <description>The latest articles on Forem by Vedangi Thokal (@vedangit).</description>
    <link>https://forem.com/vedangit</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%2F1090959%2F0cbfb0e0-9340-448f-8e8b-a79fe21e64f8.jpg</url>
      <title>Forem: Vedangi Thokal</title>
      <link>https://forem.com/vedangit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vedangit"/>
    <language>en</language>
    <item>
      <title>Pagination vs. Infinite Scrolling: What's Best for Your Website?</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Sat, 01 Mar 2025 17:49:40 +0000</pubDate>
      <link>https://forem.com/vedangit/pagination-vs-infinite-scrolling-whats-best-for-your-website-453d</link>
      <guid>https://forem.com/vedangit/pagination-vs-infinite-scrolling-whats-best-for-your-website-453d</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;When building websites that display lists of data (e.g., blog posts, products, search results), developers have two primary choices: &lt;strong&gt;pagination&lt;/strong&gt; and &lt;strong&gt;infinite scrolling&lt;/strong&gt;. Both approaches aim to present large datasets in a user-friendly way, but they come with their own pros, cons, and best-use scenarios.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll cut through the jargon and get straight to the point: &lt;strong&gt;What’s the difference?&lt;/strong&gt; &lt;strong&gt;When should you use each?&lt;/strong&gt; And &lt;strong&gt;How do you implement them?&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Pagination: The Old Reliable&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;
Pagination divides your content into distinct pages. Typically, you’ll see something like “Page 1, Page 2, Page 3” at the bottom of a list of posts or products.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user clicks on a page number to load the corresponding set of items.&lt;/li&gt;
&lt;li&gt;Each page loads a fixed number of items (e.g., 10 or 20 posts).&lt;/li&gt;
&lt;li&gt;You load the next set by clicking the next page number.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why use it?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User control&lt;/strong&gt;: People can easily jump to specific sections (Page 5, for example).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: You're only loading a set number of items, so it's easy to manage and faster for the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO&lt;/strong&gt;: Each page is a separate URL, which means you can optimize each one individually.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Content-heavy websites&lt;/strong&gt;: If you have lots of information, pagination is useful because it divides the load and keeps things organized.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search engines&lt;/strong&gt;: For SEO purposes, pagination is better, as it allows search engines to index each page separately.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;E-commerce websites&lt;/strong&gt; with categories like “Electronics” or “Fashion” will often use pagination, letting users filter through pages of items.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Infinite Scrolling: Endless Feeds&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;br&gt;
Infinite scrolling automatically loads more content as the user scrolls down the page, with no need to click a “Next” button or navigate through pages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You start with a small set of items at the top of the page.&lt;/li&gt;
&lt;li&gt;As the user scrolls down, the next set of items loads automatically.&lt;/li&gt;
&lt;li&gt;This process continues until the user reaches the bottom of the page (or the server runs out of content).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why use it?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Continuous experience&lt;/strong&gt;: Users can just scroll without interruption, which is great for browsing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engagement&lt;/strong&gt;: It keeps people scrolling, which can increase interaction with your content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile-friendly&lt;/strong&gt;: Infinite scrolling is particularly well-suited to mobile, where users prefer quick, uninterrupted access to new content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Social media&lt;/strong&gt;: Feeds in Instagram, Twitter, and Facebook use infinite scrolling to show endless posts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;News or blogs&lt;/strong&gt;: For continuous content consumption like reading articles or viewing image galleries, where users are more likely to keep scrolling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small data sets&lt;/strong&gt;: If you’re not dealing with a massive amount of content or complex data, infinite scrolling is a simple solution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Twitter&lt;/strong&gt; or &lt;strong&gt;Instagram&lt;/strong&gt;, where users are scrolling endlessly through new posts.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Pagination vs. Infinite Scrolling: Which One to Choose?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;There’s no one-size-fits-all answer, but here’s the breakdown:&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;Use Pagination If:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Your content is structured in a way that users might need to jump between specific points (like pages of products).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO&lt;/strong&gt; is important, and you want each page to be indexed separately.&lt;/li&gt;
&lt;li&gt;You’re working with large data sets, and you want to ensure your site performs well without overloading the browser.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;Use Infinite Scrolling If:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;You want a smooth, uninterrupted experience for users who are browsing and don’t mind scrolling indefinitely.&lt;/li&gt;
&lt;li&gt;The content doesn’t require users to jump between specific points but rather encourages continuous consumption.&lt;/li&gt;
&lt;li&gt;You’re targeting &lt;strong&gt;mobile-first&lt;/strong&gt; users, as infinite scrolling is much more mobile-friendly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: You can even use both in some cases (e.g., paginate large data sets but use infinite scrolling for feeds on the homepage).&lt;/p&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;How to Implement Pagination and Infinite Scrolling in Next.js?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Here’s a simple breakdown of how to implement both in Next.js:&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;1. Pagination in Next.js&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;For pagination, you typically create an API route that returns a specific set of items per page. Here’s how:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create API Route&lt;/strong&gt;: Create &lt;code&gt;/api/posts&lt;/code&gt; to fetch paginated posts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend Fetching&lt;/strong&gt;: On the frontend, load posts for the current page when the page loads and when the user clicks the “Next Page” button.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;2. Infinite Scrolling in Next.js&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;For infinite scrolling, you use the &lt;code&gt;scroll&lt;/code&gt; event to detect when the user is near the bottom of the page and fetch more items.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;API Route&lt;/strong&gt;: Same as pagination, you need an API route that sends a set number of posts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: Listen for the &lt;code&gt;scroll&lt;/code&gt; event and load more items when the user reaches the bottom of the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s a code breakdown (super simplified for clarity):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pagination:&lt;/strong&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="c1"&gt;// Fetch paginated data when the user clicks "Load More"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;loadPosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&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;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/posts?page=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;amp;limit=10`&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nf"&gt;setPosts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prevPosts&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;prevPosts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;data&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;Infinite Scrolling:&lt;/strong&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="c1"&gt;// Detect when the user is scrolling near the bottom of the page&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleScroll&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="k"&gt;if &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="o"&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;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scrollTop&lt;/span&gt; &lt;span class="o"&gt;&amp;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;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;offsetHeight&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&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="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;setPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Load next page&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;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In the end, &lt;strong&gt;pagination&lt;/strong&gt; and &lt;strong&gt;infinite scrolling&lt;/strong&gt; both have their place in modern web design. Your choice should depend on your website's content, the user experience you want to provide, and the technical considerations like SEO and performance. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Choose Pagination&lt;/strong&gt; for a controlled, user-friendly navigation experience, especially with structured content or large datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose Infinite Scrolling&lt;/strong&gt; for a seamless, engaging experience that’s great for content-heavy sites like social media, news feeds, or mobile-first apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep it simple, and use the method that best serves your users and your content.&lt;br&gt;
 (this blog was enhanced by AI, rest assured the content remains authentic)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>fullstack</category>
      <category>learning</category>
    </item>
    <item>
      <title>A Year of Learning, Leading, and Building: Here’s What I’ve Been Up To</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Thu, 05 Dec 2024 12:26:19 +0000</pubDate>
      <link>https://forem.com/vedangit/a-year-of-learning-leading-and-building-heres-what-ive-been-up-to-3fdp</link>
      <guid>https://forem.com/vedangit/a-year-of-learning-leading-and-building-heres-what-ive-been-up-to-3fdp</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Hello everyone!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;It’s been almost a full year since my last blog post, and today, I’m excited to say—I’m back!  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Why I Took a Break&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Why no blog posts? Honestly, I realized I needed to focus on &lt;em&gt;doing&lt;/em&gt; the work first. There was also the good ol' &lt;strong&gt;Imposter Syndrome&lt;/strong&gt;, making me question if what I was sharing was good enough or valuable enough. Life got hectic, and sometimes, something has to give.  &lt;/p&gt;

&lt;p&gt;But in hindsight, it was necessary. I took that time to grow in ways I never expected. Today, I’m excited to share what I’ve been up to and where I’m headed next.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What Kept Me Busy&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This past year has been all about pushing boundaries, both technical and personal.   &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Diving into IoT with a Solo Project&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;I took on a completely domain: building a &lt;strong&gt;Forest Protection System&lt;/strong&gt; using IoT. It was a full-stack solution, integrating multiple sensors, establishing WiFi connectivity, and developing an API to handle real-time data storage in a database.&lt;br&gt;&lt;br&gt;
  I even implemented real-time notifications to alert users about critical events. This project pushed me out of my comfort zone and gave me hands-on experience with IoT, APIs, and real-time systems.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Landing an Internship&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;After a lot of effort (and quite a few applications), I secured a summer internship offer at a really good company! The process taught me resilience and looooooot about where I am lacking as an aspiring computer science engineer, and the experience ahead excites me.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Leading a Technical Club&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;This year, I stepped up as the &lt;strong&gt;President of a major technical club&lt;/strong&gt; at my college. It’s been an incredible journey of mentorship, connecting with juniors, making friends, and driving initiatives that matter. Seeing others grow has been one of the most rewarding parts of this experience.&lt;br&gt;&lt;br&gt;
Not every idea worked. Some events didn’t get the turnout we hoped for, and a few initiatives didn’t gain traction. Balancing club responsibilities with academics was tough, and I learned the hard way that delegation is key.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Technical Growth&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;I’ve developed my technical skills &lt;em&gt;immensely&lt;/em&gt; this year. Consistent &lt;strong&gt;DSA practice&lt;/strong&gt; became a routine, and I explored various tech stacks, building projects that challenged and inspired me. That said, not every project idea clicked. Some didn’t take off, while others had to be shelved because of time constraints. It was frustrating, but each setback sharpened my focus. I even participated in a national hackathon, which was an intense and although we did not make it but rewarding experience.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Job Hunt Grind&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Applying to jobs was no joke—I applied like a crazy person! But every rejection, every interview, taught me something new. The journey was exhausting but worth it.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What’s Next?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;TBH, so much more :)&lt;br&gt;
I have a lot (almost too much) on my bucket list. I want to explore so much in this field, I want to do open source, research, I want to build a SaaS product. I want to refine my Computer Science fundamentals and my DSA skills. I want to learn System Design. I want to sell digital products to make some side income and also help people on the way. &lt;/p&gt;

&lt;p&gt;But mostly, I just want to do good &amp;lt;3 &lt;/p&gt;




&lt;p&gt;I've loved the dev.to community ever since I've joined it. Thanks for sticking around — let’s get back to building, learning, and growing together!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
      <category>career</category>
      <category>learning</category>
    </item>
    <item>
      <title>A key constraint blunder ruined my MySQL practical exam. Don't let it happen to you.</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Tue, 02 Jan 2024 17:41:06 +0000</pubDate>
      <link>https://forem.com/vedangit/a-key-constraint-blunder-ruined-my-mysql-practical-exam-dont-let-it-happen-to-you-3j6n</link>
      <guid>https://forem.com/vedangit/a-key-constraint-blunder-ruined-my-mysql-practical-exam-dont-let-it-happen-to-you-3j6n</guid>
      <description>&lt;p&gt;I Messed Up My MySQL Practical! Here's How You Can Avoid My Mistake&lt;/p&gt;

&lt;p&gt;I'm gonna tell you a story about how a tiny mistake almost wrecked my MySQL lab exam. It's all about keys, those little things that keep your database organized.&lt;/p&gt;

&lt;p&gt;So, here's what happened: I forgot to put a composite primary key in one of my relationship tables. That's like forgetting to put a lock on a door — things get messy real fast.&lt;/p&gt;

&lt;p&gt;To fix the mess, I had to revisit the fundamentals of keys in MySQL:&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Keys:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Primary Key&lt;/strong&gt;: A guarantee that every row has a unique identifier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Foreign Key&lt;/strong&gt;: A bridge between tables, referencing a primary key in another table to enforce referential integrity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unique Key&lt;/strong&gt;: A constraint that prevents duplicates in specific columns, ensuring each value is one-of-a-kind.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composite Key&lt;/strong&gt;: A primary key composed of multiple columns, often used in relationship tables to establish unique relationships.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  ✨Primary Key: The Main Label for Every Item
&lt;/h3&gt;

&lt;p&gt;Think of this as a name tag for each row in a table. It's unique and makes sure nothing gets mixed up.&lt;br&gt;
&lt;strong&gt;Constraints: Must be unique and not null (every item needs a name tag!).&lt;/strong&gt;&lt;br&gt;
Code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE `customers` (
  `customer_id` INT NOT NULL AUTO_INCREMENT,  // This is the primary key
  `name` VARCHAR(50),
  PRIMARY KEY (`customer_id`)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✨Foreign Key: The Reference Tag that Connects Items
&lt;/h3&gt;

&lt;p&gt;This key links row to another rowin a different table.&lt;br&gt;
&lt;strong&gt;Constraints: References a primary key in another table&lt;/strong&gt;, like a friend's name tag in a different box.&lt;br&gt;
Code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE `orders` (
  `order_id` INT NOT NULL AUTO_INCREMENT,
  `customer_id` INT,  // This is a foreign key, linking to the "customers" table
  `order_date` DATE,
  PRIMARY KEY (`order_id`),
  FOREIGN KEY (`customer_id`) REFERENCES `customers` (`customer_id`)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✨Unique Key: The Special Feature Label
&lt;/h3&gt;

&lt;p&gt;This label means only one item (row) can have that specific feature (column value).&lt;br&gt;
Constraints: Enforces uniqueness, but the value can be null (not every item needs a special feature).&lt;br&gt;
Code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE `products` (
  `product_id` INT NOT NULL AUTO_INCREMENT,
  `product_code` VARCHAR(10) UNIQUE,  // This is a unique key
  `product_name` VARCHAR(50),
  PRIMARY KEY (`product_id`)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✨Composite Key: The Double Label for Special Boxes
&lt;/h3&gt;

&lt;p&gt;A double ID tag for rows in a table.&lt;br&gt;
&lt;strong&gt;Constraints: Each column within the composite key must be unique as a group.&lt;/strong&gt;&lt;br&gt;
Code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE `course_registrations` (
  `student_id` INT,
  `course_id` INT,
  PRIMARY KEY (`student_id`, `course_id`)  // This is a composite key
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What happened to my database without a composite primary key?
&lt;/h2&gt;

&lt;p&gt;Four words. &lt;br&gt;
Data Duplication and Query Chaos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's everything happened without a composite primary key:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Duplicate Entries&lt;/strong&gt;: Like uninvited guests at a party, duplicate entries started cropping up in the table, causing confusion and inconsistencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ambiguous Relationships&lt;/strong&gt;: The table's purpose was to link entities, but without a clear way to identify unique relationships, things got tangled up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unpredictable Queries&lt;/strong&gt;: My SQL queries, designed to retrieve specific data, suddenly became unreliable. They returned inconsistent results, making it hard to trust the information I was getting.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To fix my mess, I had to add the missing composite key&lt;/p&gt;

&lt;p&gt;Here's what I learned:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Plan your keys carefully&lt;/strong&gt;: Think about them like you'd think about organizing your closet. You need to know where everything goes and how to find it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draw pictures&lt;/strong&gt; of your tables and how they connect: This helps you see where you might need composite keys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Double-check&lt;/strong&gt; your keys and test your database often: Make sure your data is staying organized and working like it should.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember, keys are like the guardians of your database. They keep things in order and make sure your data stays reliable. Don't let a key mistake mess up your project—or in my case, a database practical!&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's have a chat!
&lt;/h3&gt;

&lt;p&gt;🎯 &lt;a href="https://www.linkedin.com/in/vedangi-thokal-528037249/"&gt;Linkedin &lt;/a&gt; &lt;/p&gt;

&lt;p&gt;🎯 &lt;a href="https://twitter.com/Vedangitt"&gt;Twitter&lt;/a&gt;  &lt;/p&gt;

</description>
      <category>mysql</category>
      <category>database</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Devs who go for unconventional programming languages and technologies 🥂</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Mon, 11 Dec 2023 09:50:07 +0000</pubDate>
      <link>https://forem.com/vedangit/devs-who-go-for-unconventional-programming-languages-and-technologies-1iad</link>
      <guid>https://forem.com/vedangit/devs-who-go-for-unconventional-programming-languages-and-technologies-1iad</guid>
      <description>&lt;p&gt;Developers who go for learning unconventional programming languages (i.e not C++ or Java or Python) or technologies, what is your motivation behind it? and how do you go about learning them?  &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>From Tags to Braces: Understanding XML and JSON</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Sat, 09 Dec 2023 03:48:55 +0000</pubDate>
      <link>https://forem.com/vedangit/from-tags-to-braces-understanding-xml-and-json-im9</link>
      <guid>https://forem.com/vedangit/from-tags-to-braces-understanding-xml-and-json-im9</guid>
      <description>&lt;p&gt;In today's interconnected world, data exchange is omnipresent. From sharing information between applications to transmitting vast amounts of data across the web, data exchange formats play a crucial role in enabling seamless communication.&lt;/p&gt;

&lt;p&gt;XML and JSON are both data formats used to store and exchange data. They are both human-readable and can be easily parsed by computers. Let's dive a little deeper into both of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  XML: A Structured Data Representation
&lt;/h2&gt;

&lt;p&gt;XML stands for Extensible Markup Language. It is a tag-based language that uses tags to define elements and their attributes. XML is self-describing, which means that the tags themselves define the meaning of the data. This makes XML a good choice for storing data that needs to be exchanged between different systems.&lt;/p&gt;

&lt;p&gt;Consider the following XML snippet representing a book:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;book&amp;gt;
  &amp;lt;title&amp;gt;The Lord of the Rings&amp;lt;/title&amp;gt;
  &amp;lt;author&amp;gt;J.R.R. Tolkien&amp;lt;/author&amp;gt;
  &amp;lt;genre&amp;gt;Fantasy&amp;lt;/genre&amp;gt;
  &amp;lt;yearPublished&amp;gt;1954&amp;lt;/yearPublished&amp;gt;
&amp;lt;/book&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, "book" is the root element, encapsulating all other elements. "title", "author", "genre", and "yearPublished" represent individual data entities within the book. Attributes can be added to elements to provide further details, for instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;book id="book1"&amp;gt;
  &amp;lt;title&amp;gt;The Lord of the Rings&amp;lt;/title&amp;gt;
  &amp;lt;author&amp;gt;J.R.R. Tolkien&amp;lt;/author&amp;gt;
  &amp;lt;genre&amp;gt;Fantasy&amp;lt;/genre&amp;gt;
  &amp;lt;yearPublished&amp;gt;1954&amp;lt;/yearPublished&amp;gt;
&amp;lt;/book&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;XML's structured nature makes it well-suited for representing hierarchical data relationships. It is widely used in various domains, including document management, configuration files, and web services.&lt;/p&gt;

&lt;h2&gt;
  
  
  JSON: A Lightweight Data Format
&lt;/h2&gt;

&lt;p&gt;JSON stands for JavaScript Object Notation. It is a lightweight data interchange format that is based on JavaScript objects. JSON uses key-value pairs to store data, which makes it easy to parse and use in web applications. JSON is less verbose than XML, which makes it a more popular choice for storing data that needs to be transferred over the web.&lt;/p&gt;

&lt;p&gt;Consider the following JSON representation of a book:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "title": "The Lord of the Rings",
  "author": "J.R.R. Tolkien",
  "genre": "Fantasy",
  "yearPublished": 1954
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This JSON structure mirrors the XML representation, using key-value pairs to represent the book's attributes. JSON's simplicity and ease of integration with JavaScript make it a popular choice for web applications and data exchange.&lt;/p&gt;

&lt;p&gt;Here is a table summarizing the key differences between XML and JSON:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iARz7TXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpecbuvkykdvm6sdzkcr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iARz7TXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpecbuvkykdvm6sdzkcr.png" alt="Image description" width="785" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some examples of how XML and JSON are used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;XML&lt;/strong&gt; is used to store data in a variety of applications, including web applications, databases, and configuration files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JSON&lt;/strong&gt; is used to store data in web applications, APIs, and data interchange formats.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which format should you use?
&lt;/h2&gt;

&lt;p&gt;The best format to use depends on your specific needs. If you need a self-describing format that is easy to parse and exchange between different systems, then XML is a good choice. If you need a lightweight format that is easy to use in web applications, then JSON is a good choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-on XML and JSON Manipulation
&lt;/h2&gt;

&lt;p&gt;To effectively work with XML and JSON, it's essential to understand how to manipulate and parse these data formats. Various programming languages provide libraries and tools for handling XML and JSON data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parsing XML
&lt;/h3&gt;

&lt;p&gt;Parsing XML involves extracting data from the XML structure. Popular XML parsers include DOM (Document Object Model) and SAX (Simple API for XML). These parsers provide methods for navigating the XML tree and accessing elements, attributes, and text.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parsing JSON
&lt;/h3&gt;

&lt;p&gt;Parsing JSON involves converting the JSON text into a corresponding data structure in the programming language. Many programming languages have built-in JSON parsers or libraries like JSON in Python or JSON.parse() in JavaScript. These parsers convert the JSON text into a native data structure, such as a dictionary or object.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hands-on Exercise: Creating and Parsing XML/JSON
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create an XML file representing a list of books.&lt;/li&gt;
&lt;li&gt;Use an XML parser to read the XML file, extract the book titles, and display them.&lt;/li&gt;
&lt;li&gt;Convert the extracted book titles into JSON format.&lt;/li&gt;
&lt;li&gt;Use a JSON parser to read the JSON string, convert it back into a list of book titles, and display them.&lt;/li&gt;
&lt;li&gt;This exercise will provide practical experience in creating, parsing, and manipulating XML and JSON data.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;1. Creating an XML file:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;books&amp;gt;
  &amp;lt;book&amp;gt;
    &amp;lt;title&amp;gt;The Lord of the Rings&amp;lt;/title&amp;gt;
    &amp;lt;author&amp;gt;J.R.R. Tolkien&amp;lt;/author&amp;gt;
    &amp;lt;genre&amp;gt;Fantasy&amp;lt;/genre&amp;gt;
    &amp;lt;yearPublished&amp;gt;1954&amp;lt;/yearPublished&amp;gt;
  &amp;lt;/book&amp;gt;
  &amp;lt;book&amp;gt;
    &amp;lt;title&amp;gt;The Hitchhiker's Guide to the Galaxy&amp;lt;/title&amp;gt;
    &amp;lt;author&amp;gt;Douglas Adams&amp;lt;/author&amp;gt;
    &amp;lt;genre&amp;gt;Science Fiction&amp;lt;/genre&amp;gt;
    &amp;lt;yearPublished&amp;gt;1979&amp;lt;/yearPublished&amp;gt;
  &amp;lt;/book&amp;gt;
&amp;lt;/books&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This XML file represents a collection of books, with each book represented as an  element. The , , , and  elements provide information about each book.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Parsing XML with DOM (Document Object Model):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import xml.dom.minidom

# Parse the XML file
dom = xml.dom.minidom.parse('books.xml')

# Get the root element
root = dom.documentElement

# Extract book titles
book_titles = []
for book in root.getElementsByTagName('book'):
    title = book.getElementsByTagName('title')[0].firstChild.nodeValue
    book_titles.append(title)

# Display book titles
print("Book Titles:")
for title in book_titles:
    print("-", title)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Python code uses the xml.dom.minidom module to parse the XML file. It extracts the book titles using the getElementsByTagName() method and stores them in a list. Finally, it prints the extracted book titles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Convert book titles to JSON:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import json

# Convert book titles to JSON string
book_titles_json = json.dumps(book_titles)

# Display JSON string
print("Book Titles (JSON):")
print(book_titles_json)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Python code converts the list of book titles into a JSON string using the json.dumps() function. It then prints the JSON string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Parse JSON with json module:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import json

# Parse JSON string
json_data = json.loads(book_titles_json)

# Convert JSON data to list of book titles
parsed_book_titles = []
for book_data in json_data:
    parsed_book_titles.append(book_data)

# Display parsed book titles
print("Parsed Book Titles:")
for title in parsed_book_titles:
    print("-", title)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Python code parses the JSON string back into a list of book titles using the json.loads() function. It then extracts the book titles from the JSON data and stores them in a new list. Finally, it prints the parsed book titles.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus :)
&lt;/h2&gt;

&lt;p&gt;Convert a pre-existing CSV file into XML and JSON using Python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import csv
import xml.etree.ElementTree as ET
import json

# Read CSV data from file
with open('data.csv', 'r') as csvfile:
    reader = csv.reader(csvfile)
    data = list(reader)

# Convert CSV data to XML
root = ET.Element("data")
for row in data[1:]:
    person = ET.SubElement(root, "person")
    name = ET.SubElement(person, "name")
    age = ET.SubElement(person, "age")
    city = ET.SubElement(person, "city")

    name.text = row[0]
    age.text = str(row[1])
    city.text = row[2]

xml_data = ET.tostring(root, encoding="utf-8").decode("utf-8")

# Convert CSV data to JSON
json_data = []
for row in data[1:]:
    person = {
        "name": row[0],
        "age": row[1],
        "city": row[2],
    }
    json_data.append(person)

# Print XML and JSON data
print("XML data:")
print(xml_data)

print("\nJSON data:")
print(json.dumps(json_data, indent=4))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-life Usage Examples
&lt;/h2&gt;

&lt;p&gt;XML and JSON are widely used in various domains, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Web Services&lt;/strong&gt;: XML is often used to define web service interfaces and exchange data between web applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration Files&lt;/strong&gt;: XML is commonly used to store configuration settings for applications and systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document Management&lt;/strong&gt;: XML is well-suited for representing and managing structured documents, such as reports, invoices, and legal documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Exchange&lt;/strong&gt;: JSON is popular for exchanging data between web applications due to its lightweight and easy-to-parse nature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NoSQL Databases&lt;/strong&gt;: JSON is often used as the data storage format for NoSQL document databases.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;This hands-on exercise provides a basic understanding of creating, parsing, and manipulating XML and JSON data. Understanding these data formats is crucial for developers and data analysts working with various data sources and applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's have a chat!
&lt;/h2&gt;

&lt;p&gt;🎯 Linkedin - &lt;a href="https://www.linkedin.com/in/vedangi-thokal-528037249/"&gt;https://www.linkedin.com/in/vedangi-thokal-528037249/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎯 Twitter - &lt;a href="https://twitter.com/Vedangitt"&gt;https://twitter.com/Vedangitt&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>xml</category>
      <category>json</category>
    </item>
    <item>
      <title>Mastering Regular Expressions (Regex): A Beginner's Guide</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Mon, 27 Nov 2023 13:08:22 +0000</pubDate>
      <link>https://forem.com/vedangit/mastering-regular-expressions-regex-a-beginners-guide-ngn</link>
      <guid>https://forem.com/vedangit/mastering-regular-expressions-regex-a-beginners-guide-ngn</guid>
      <description>&lt;p&gt;Have you ever tried searching for a specific word in a document, but it's buried among a sea of text? Or perhaps you've wanted to validate email addresses in a form, but it seems like an impossible task. That's where Regular Expressions, or Regex, come to the rescue.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Regex, Anyway?
&lt;/h2&gt;

&lt;p&gt;Regex is like a super-powered search bar on steroids. It allows you to define patterns, and then search, match, or manipulate text based on those patterns. This means you can find email addresses in a haystack of text, extract phone numbers from a jumble of characters, and much more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Blocks of Regex
&lt;/h2&gt;

&lt;p&gt;To become a Regex guru, you need to understand the basic building blocks:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Dot &lt;code&gt;.&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The dot is like a wild card. It matches any character. So, if you're searching for "cat," "bat," and "hat," you can use .a., and it will find all of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Asterisk &lt;code&gt;*&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The asterisk means "zero or more." So, if you search for ca*t, it will match "ct," "cat," "caat," and so on. It's like saying, "Find me 'ca,' and then any number of 'a's followed by 't'."&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Plus &lt;code&gt;+&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The plus means "one or more." If you search for ca+t, it will match "cat" and "caat" but not "ct." It's like saying, "Find me 'ca,' at least one 'a,' and then 't'."&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The Question Mark &lt;code&gt;?&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This one is for "zero or one." If you look for colou?r, it matches "color" and "colour." It's like saying, "The 'u' is optional."&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Square Brackets &lt;code&gt;[]&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;You can use square brackets to specify a range. For example, [0-9] matches any digit from 0 to 9.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. The Pipe &lt;code&gt;|&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The pipe is like an "or" operator. For example, cat|dog matches either "cat" or "dog."&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-Life Applications of Regex
&lt;/h2&gt;

&lt;p&gt;Regex is not just a theoretical concept; it has countless real-world applications. Let's dive into some practical examples:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Extracting Email Addresses
&lt;/h3&gt;

&lt;p&gt;Imagine you have a long document, and you want to extract all the email addresses. Regex can make this task a breeze. Here's an example in Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import re

text = "Contact us at hello@email.com or support@website.net"
emails = re.findall(r'\S+@\S+', text)
print(emails)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code, re.findall() searches for patterns that match email addresses. The pattern \S+@\S+ looks for one or more non-whitespace characters, followed by an at symbol, and then one or more non-whitespace characters again.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Validating Phone Numbers
&lt;/h3&gt;

&lt;p&gt;Let's say you have a form on your website, and you want to validate the format of phone numbers. Regex can help ensure that users enter their numbers correctly. Here's a Python example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import re

text = "Call us at 123-456-7890 or 987.654.3210"
phone_numbers = re.findall(r'\d{3}[-.]\d{3}[-.]\d{4}', text)
print(phone_numbers)
In this code, we're searching for patterns like "123-456-7890" or "987.654.3210." The pattern \d{3}[-.]\d{3}[-.]\d{4} looks for three digits, followed by either a hyphen or a period, and then three more digits, and finally four more digits.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  More Practical Uses of Regex
&lt;/h2&gt;

&lt;p&gt;Regex is incredibly versatile and can be applied in various contexts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Extraction: Extract specific information from text or log files.&lt;/li&gt;
&lt;li&gt;Data Validation: Validate user input, such as email addresses, phone numbers, and dates.&lt;/li&gt;
&lt;li&gt;Text Editing: Search and replace text in code editors or word processors.&lt;/li&gt;
&lt;li&gt;Web Scraping: Extract structured data from websites.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Regex is your trusty companion in the world of text manipulation. With the right patterns and some practice, you can sift through text like a pro and automate tasks that would otherwise be tedious and time-consuming. So, I hope this blog helps you embrace the power of Regex to conquer your text-related challenges. 🔍🧙‍♂️✨&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's have a chat!
&lt;/h2&gt;

&lt;p&gt;🎯 Linkedin - &lt;a href="https://www.linkedin.com/in/vedangi-thokal-528037249/"&gt;https://www.linkedin.com/in/vedangi-thokal-528037249/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎯 Twitter - &lt;a href="https://twitter.com/Vedangitt"&gt;https://twitter.com/Vedangitt&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>regex</category>
      <category>programming</category>
    </item>
    <item>
      <title>Top GitHub Resources to Level Up Your Python game</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Mon, 27 Nov 2023 02:13:14 +0000</pubDate>
      <link>https://forem.com/vedangit/top-github-resources-to-level-up-your-python-game-35gg</link>
      <guid>https://forem.com/vedangit/top-github-resources-to-level-up-your-python-game-35gg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;💻 Are you secretly relieved that the era of semicolons is behind you?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Whether you're just starting with Python or looking to boost your skills, GitHub is like a virtual toolbox filled with helpful resources. In this blog, I'm going to guide you through some must-know GitHub repositories for Python beginners.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. "The Hitchhiker's Guide to Python" by Kenneth Reitz
&lt;/h2&gt;

&lt;p&gt;Navigate the vast universe of Python with this comprehensive guide. From setting up your development environment to best practices and project structure, this repository is your companion in mastering Python.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/kennethreitz/python-guide"&gt;The Hitchhiker's Guide to Python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. "Awesome Python" by Vinta Chen
&lt;/h2&gt;

&lt;p&gt;True to its name, this repository curates a list of awesome Python libraries, frameworks, and software. Here, you will discover tools that can make your Python journey smoother, and explore a curated collection of resources for various domains.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/vinta/awesome-python"&gt;Awesome Python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. "Python Patterns" by Brandon Rhodes
&lt;/h2&gt;

&lt;p&gt;Patterns are the building blocks of good software design. This repository provides a collection of design patterns implemented in Python, allowing you to understand and apply proven solutions to common problems.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/faif/python-patterns"&gt;Python Patterns&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. "Python Cheatsheet" by gto76
&lt;/h2&gt;

&lt;p&gt;A cheat sheet is a quick reference guide, and this repository delivers just that. Packed with syntax, concepts, and examples, it's a handy resource for both beginners and experienced developers looking for a quick Python refresh.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/gto76/python-cheatsheet"&gt;Python Cheatsheet&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. "Real Python" by Real Python
&lt;/h2&gt;

&lt;p&gt;This repository is an extension of the Real Python platform, offering a collection of tutorials, articles, and exercises. It's a valuable resource for diving deep into Python concepts, web development, data science, and more.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/realpython/materials"&gt;Real Python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. "30 Days of Python" by Asabeneh Yetayeh
&lt;/h2&gt;

&lt;p&gt;For those who believe in learning by doing, this repository provides a 30-day roadmap with exercises and projects. It's an engaging way to build a strong foundation and practical skills in Python.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/Asabeneh/30-Days-Of-Python"&gt;30 Days of Python&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. "Python-100-Days" by jackfrued
&lt;/h2&gt;

&lt;p&gt;Embark on a 100-day coding journey with this repository. It covers Python basics, data structures, algorithms, web development, and more. A structured plan to level up your Python skills in a systematic way.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/jackfrued/Python-100-Days"&gt;Python-100-Days&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. "Python Project Scripts" by Larymak
&lt;/h2&gt;

&lt;p&gt;Tired of just writing programs? Do you want to develop an actual project? Well, you are at the right place then. In this repo, you will find a collection of 75 Python miniproject scripts written by various authors. Head to the link below and build now!&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/larymak/Python-project-Scripts"&gt;Python-project-scripts&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. "Python mini projects" by Python-world
&lt;/h2&gt;

&lt;p&gt;In a similar fashion to the previous repository, this link will lead to you 103 different Python mini projects that you can implement alongside your learning journey.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/Python-World/python-mini-projects"&gt;python-mini-projects&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. "Python Beginners" by macloo
&lt;/h2&gt;

&lt;p&gt;This repository is a tutorial to Python based on the book Automate the Boring Stuff with Python, by Al Sweigart (2015). It includes week-by-week schedules, one-time how-to documents, and hands-on examples covering Python fundamentals, web scraping with BeautifulSoup, and web app development using Flask. Whether it's navigating the command line or diving into Flask, this repository offers a structured path for learners.&lt;/p&gt;

&lt;p&gt;🎇 Repository Link: &lt;a href="https://github.com/macloo/python-beginners"&gt;python-beginners&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm sure these GitHub repositories will serve as invaluable companions. Here's to exploring, learning, and contributing to the Python community 🥂&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's have a chat!
&lt;/h2&gt;

&lt;p&gt;🎯 Linkedin - linkedin.com/in/vedangi-thokal-528037249&lt;/p&gt;

&lt;p&gt;🎯 Twitter - twitter.com/Vedangitt&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
      <category>github</category>
    </item>
    <item>
      <title>A Minimalist's Guide to Software Development: Less Code, More Elegance</title>
      <dc:creator>Vedangi Thokal</dc:creator>
      <pubDate>Sun, 26 Nov 2023 07:28:24 +0000</pubDate>
      <link>https://forem.com/vedangit/a-minimalists-guide-to-software-development-less-code-more-elegance-37n1</link>
      <guid>https://forem.com/vedangit/a-minimalists-guide-to-software-development-less-code-more-elegance-37n1</guid>
      <description>&lt;p&gt;&lt;em&gt;💡&lt;br&gt;
It's like Marie Kondo met your code and whispered, "Does this spark joy?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fbo982eh9tev27nz91mx6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fbo982eh9tev27nz91mx6.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the world of software development, where complexity can easily get out of hand, we'll explore A Minimalist's Guide to Software Development, discussing how minimalism and simplicity can lead to cleaner and more efficient code.&lt;/p&gt;

&lt;p&gt;At its core, minimalism in software development is about achieving more with less. It's about crafting code that is straightforward, concise, and easy to understand. This way you can give your intricate project a streamlined approach and maintain productivity (and a developer's sanity).&lt;/p&gt;
&lt;h2&gt;
  
  
  Code Readability Matters
&lt;/h2&gt;

&lt;p&gt;Consider the following Python example, which calculates the average of a list of numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def calculate_average(numbers):
    total = 0
    count = 0
    for num in numbers:
        total += num
        count += 1
    return total / count
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can tell what this function does by looking at its name. But can you tell how it does it at a glance? No, right? In this non-minimalist code, the function's purpose is not immediately evident, and it involves unnecessary complexity. But now :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def calculate_average(numbers):
    return sum(numbers) / len(numbers)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This version is concise, highly readable, and achieves the same result. We know in a second that we are dividing the sum of a few given elements by the number of elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real-World Example: Database Query
&lt;/h2&gt;

&lt;p&gt;Imagine you need to retrieve all active users from a database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import database

def get_active_users():
    connection = database.connect()
    cursor = connection.cursor()
    cursor.execute("SELECT * FROM users WHERE status='active'")
    users = []
    for row in cursor.fetchall():
        users.append(row)
    connection.close()
    return users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import database

def get_active_users():
    with database.connect() as connection:
        with connection.cursor() as cursor:
            cursor.execute("SELECT * FROM users WHERE status='active'")
            return cursor.fetchall()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The latter version not only reduces code length but also handles resource management more elegantly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Less Is More
&lt;/h2&gt;

&lt;p&gt;You're packing for a vacation, and you're determined to travel light. You toss in your favourite T-shirt, a pair of sneakers, and your very important toothbrush. But then, You start adding five extra pairs of shoes, a collection of hats, and a hairdryer "just in case." Suddenly, you're sitting on your luggage which looks like it's about to burst at the seams, and you're not even sure where you're going.&lt;/p&gt;

&lt;p&gt;Now, think of your software project as that luggage. Just as overpacking can lead to a chaotic and unnecessarily heavy suitcase, overloading your code with dependencies is like putting on a jet engine on your shoes. It might look impressive, but it's not practical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid unnecessary dependencies
&lt;/h3&gt;

&lt;p&gt;Only import dependencies that you actually need to accomplish the task at hand. Extra dependencies increase complexity and build potential bugs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Follow the DRY principle
&lt;/h3&gt;

&lt;p&gt;Don't 👏 Repeat 👏 Yourself. Extract reusable functions, variables and modules to avoid duplication.&lt;/p&gt;

&lt;h3&gt;
  
  
  Write self-documenting code
&lt;/h3&gt;

&lt;p&gt;Use expressive names for variables, functions and classes. This reduces the need for extensive comments, keeping your code minimal. Besides, less explaining means more time for coding (or enjoying your vacation).&lt;/p&gt;

&lt;h2&gt;
  
  
  Other than that
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Documentation
&lt;/h3&gt;

&lt;p&gt;While keeping code concise, ensure that it's well-documented to aid understanding and future maintenance. The vision of your code should be clearly conveyed in the documentation. &lt;/p&gt;

&lt;h3&gt;
  
  
  Version Control
&lt;/h3&gt;

&lt;p&gt;Utilize version control systems like Git to track code changes, making it easier to manage and collaborate.&lt;/p&gt;

&lt;p&gt;It's not about saying less, but saying more with less. So, keep it clear, keep it concise, and let your code speak for itself. Happy coding folks! 🚀👩‍💻&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's have a chat!
&lt;/h2&gt;

&lt;p&gt;🎯 Linkedin - &lt;a href="https://www.linkedin.com/in/vedangi-thokal-528037249/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/vedangi-thokal-528037249/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎯 Twitter - &lt;a href="https://twitter.com/Vedangitt" rel="noopener noreferrer"&gt;https://twitter.com/Vedangitt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;.#GDG #GDGPune #blogathonS02 #devfest2023 &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
      <category>gdg</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
