<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abdul Moazzim on Medium]]></title>
        <description><![CDATA[Stories by Abdul Moazzim on Medium]]></description>
        <link>https://medium.com/@abdulmoazzam0815?source=rss-1558384b4060------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*O5ynJ9xSaSPebPeXCkPPZA.jpeg</url>
            <title>Stories by Abdul Moazzim on Medium</title>
            <link>https://medium.com/@abdulmoazzam0815?source=rss-1558384b4060------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:25:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdulmoazzam0815/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Teachers Are My Superheroes]]></title>
            <link>https://medium.com/@abdulmoazzam0815/teachers-are-my-superheroes-43ba07ed7b48?source=rss-1558384b4060------2</link>
            <guid isPermaLink="false">https://medium.com/p/43ba07ed7b48</guid>
            <category><![CDATA[spirituality]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[teachers]]></category>
            <dc:creator><![CDATA[Abdul Moazzim]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 15:18:37 GMT</pubDate>
            <atom:updated>2026-11-29T15:18:37.852Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*hDWZ-yJacJ8XgprK84Satw.jpeg" /></figure><p><em>They may never know how far their influence reaches, but somewhere in the world, a student is carrying a lesson they taught years ago.</em></p><p>We grow up watching superheroes save the world.</p><p>They have extraordinary powers, wear impressive costumes, fight villains, and appear whenever someone needs saving. As children, we admire them for their courage, strength, and ability to make the impossible possible.</p><p>But as we grow older, we begin to recognize a different kind of superhero.</p><p>They don’t wear capes. They don’t fly. They don’t possess extraordinary physical strength.</p><p>They stand in classrooms, hold books, write on whiteboards, explain difficult concepts, answer questions, and patiently repeat lessons for students who don’t understand them the first time.</p><p>They are teachers.</p><p>And perhaps we don’t appreciate just how extraordinary they are.</p><h3>The people who shape our futures</h3><p>A teacher’s job is often misunderstood as simply delivering lectures, completing syllabi, assigning homework, and preparing students for examinations.</p><p>But teaching is so much more than that.</p><p>A teacher enters a classroom filled with students, each carrying a different story. Some are confident. Some are struggling. Some are curious. Some are afraid of making mistakes. Some are still trying to discover what they want to become.</p><p>And somehow, a teacher has the responsibility to help all of them grow.</p><p>They teach us mathematics, science, literature, history, programming, and countless other subjects. But alongside these subjects, they teach us patience, discipline, responsibility, critical thinking, and the courage to keep going when things become difficult.</p><p>Sometimes, the most important lesson a teacher gives us isn’t written on the board.</p><p>It’s something we carry for the rest of our lives.</p><h3>A few words can change someone’s life</h3><p>Imagine being a student who believes they aren’t good enough.</p><p>Maybe they failed an examination. Maybe they struggle to understand a subject. Maybe they compare themselves with everyone around them and feel that they are falling behind.</p><p>Then one day, a teacher tells them:</p><p><em>“I believe you can do better.”</em></p><p>Or perhaps:</p><p><em>“You have potential. Don’t give up.”</em></p><p>These words may take only a few seconds to say.</p><p>But for the student hearing them, they might become the beginning of something entirely different.</p><p>A teacher’s belief can become a student’s confidence.</p><p>Their encouragement can become someone’s motivation.</p><p>Their patience can make a struggling student feel that they belong.</p><p>And their support can help someone discover a future they never imagined for themselves.</p><p>We never really know how powerful our words can be, especially when they come from someone a student respects.</p><p>Sometimes, a teacher believes in us before we have learned to believe in ourselves.</p><h3>They see more than our grades</h3><p>In a world where students are often measured through marks, grades, rankings, and achievements, teachers have the opportunity to see something beyond numbers.</p><p>They see the effort behind an examination result.</p><p>They notice the student who keeps trying despite struggling.</p><p>They recognize curiosity, creativity, kindness, leadership, and perseverance; qualities that cannot always be measured through a traditional grading system.</p><p>A student might not be the best in the classroom today.</p><p>But they might become an extraordinary researcher, engineer, artist, entrepreneur, doctor, writer, or leader tomorrow.</p><p>A good teacher understands that education isn’t a race in which everyone must reach the finish line at the same time.</p><p>Every student has a different pace.</p><p>Every student has a different path.</p><p>And sometimes, the greatest achievement isn’t getting the highest grade. It’s helping a student discover their own ability to grow.</p><h3>The patience we rarely notice</h3><p>Think about how many times a teacher explains the same concept.</p><p>How many questions they answer.</p><p>How many assignments they review.</p><p>How many hours they spend preparing lessons that may only last a few minutes in a classroom.</p><p>Think about the students who challenge their patience, the days when they are tired, the responsibilities they carry outside their profession, and the effort required to continue showing up.</p><p>Yet, they do.</p><p>They return to the classroom.</p><p>They teach another lesson.</p><p>They encourage another student.</p><p>They correct another mistake.</p><p>They try again.</p><p>Teaching requires an extraordinary amount of patience because the results aren’t always immediate.</p><p>A teacher may plant a seed today and never see it grow into a tree.</p><p>A student may understand the importance of a lesson years later, long after the teacher has moved on to another classroom.</p><p>And that is one of the most beautiful, yet often overlooked, aspects of being a teacher.</p><p>They invest in futures they may never personally witness.</p><h3>A beautiful connection in our faith</h3><p>As a Muslim, I have always found something beautiful in the connection between knowledge, respect, and the people who teach us.</p><p>Islam places great importance on seeking knowledge, learning, wisdom, and showing respect to those who guide us.</p><p>We often speak about the rights of our parents, and rightly so. They nurture us, care for us, sacrifice for us, and help us become who we are.</p><p>But teachers hold a special place in our lives, too.</p><p>Our parents nurture our bodies, our hearts, and our lives. Teachers nurture our minds, our understanding, our character, and sometimes even the way we see the world.</p><p>In a sense, they become spiritual parents; not replacing our biological parents, but helping nurture the person we are becoming.</p><p>They teach us not only what to know, but sometimes how to think, how to behave, how to treat others, and how to distinguish between what is right and wrong.</p><p>There is something deeply meaningful about a person dedicating their time to teaching another human being something beneficial.</p><p>Knowledge is not simply transferred from one person to another. It becomes part of someone’s life, decisions, actions, and character.</p><p>And when a student carries that knowledge forward, teaches someone else, or uses it to benefit humanity, the influence of that original teacher continues.</p><p>Perhaps this is one of the most beautiful forms of legacy: doing something good whose impact continues beyond your own lifetime.</p><p>A teacher may never see all the good that grows from a lesson they taught.</p><p>But Allah knows the effort, the patience, the intention, and every life that may have benefited from it.</p><h3>Their lessons travel farther than they ever will</h3><p>A teacher may spend their entire career within the walls of a school, college, or university.</p><p>But their influence can travel across continents.</p><p>A student graduates, moves to another city, studies abroad, starts a company, joins a research laboratory, becomes a parent, or begins teaching others.</p><p>And somewhere within their decisions, their habits, and their values, there are lessons inherited from their teachers.</p><p>A teacher’s influence doesn’t end when a student leaves the classroom.</p><p>It travels with them.</p><p>It appears when a former student faces a difficult problem and remembers not to give up.</p><p>It appears when they help someone else understand something.</p><p>It appears when they make a decision based on integrity.</p><p>It appears when they become the person who encourages someone else.</p><p>Perhaps the greatest legacy of a teacher isn’t the number of students who remember their name.</p><p>Perhaps it is the number of lives that become better because of what they taught.</p><h3>Behind every student, there is a story</h3><p>I have started to think about this more deeply as I reflect on my own journey.</p><p>I am currently pursuing my undergraduate degree in Computer Systems Engineering at NED University of Engineering and Technology in Karachi.</p><p>Like many students, I entered university with dreams, curiosity, and plenty of things I didn’t know.</p><p>Over the years, I learned programming, artificial intelligence, machine learning, data structures, algorithms, operating systems, and many other subjects.</p><p>But university has also been a journey of discovering myself.</p><p>I have worked on projects, participated in competitions, explored research opportunities, completed internships, and gradually developed bigger ambitions for my future.</p><p>I want to pursue higher education, explore artificial intelligence more deeply, contribute to research, and work on problems that have a meaningful impact.</p><p>When I look back at the journey so far, I realize that my teachers have been part of so many of these chapters.</p><p>Some taught me the fundamentals that I rely on today.</p><p>Some challenged me to think more deeply.</p><p>Some encouraged me to explore opportunities beyond the classroom.</p><p>And some helped me recognize qualities in myself that I hadn’t fully noticed.</p><h3>The impact becomes clearer with time</h3><p>During my undergraduate journey, I had professors who taught me programming, artificial intelligence, machine learning, data structures, algorithms, and operating systems.</p><p>Their lessons didn’t simply help me complete examinations or assignments. They helped build the foundation on which I continue to learn new technologies, develop projects, and explore research.</p><p>As I began taking on more responsibilities, participating in competitions, and working with people from different backgrounds, I started realizing how important those foundations were.</p><p>For example, during the Global Sustainability Challenge 2025–2026, I had the opportunity to work as the technical lead of our team. We advanced to the global finals in Munich, becoming one of the top 20 finalist teams.</p><p>That experience required technical problem-solving, teamwork, leadership, persistence, and the willingness to learn things beyond what I already knew.</p><p>And when I reflect on those qualities, I can see how much of their foundation was built throughout my years of education.</p><p>The teachers who encouraged curiosity.</p><p>The teachers who emphasized fundamentals.</p><p>The teachers who expected us to be disciplined.</p><p>The teachers who challenged us to think independently.</p><p>Their influence wasn’t always visible in a particular achievement.</p><p>But it was present in the person I was becoming while working toward it.</p><h3>When a teacher sees something in you</h3><p>One of the most meaningful experiences for a student is reading how a teacher describes them.</p><p>Recently, I received recommendation letters from professors who had taught and supervised me throughout my undergraduate journey.</p><p>Reading their words made me pause.</p><p>They described my dedication, curiosity, perseverance, academic performance, problem-solving abilities, leadership, and willingness to learn.</p><p>Some of these qualities are things I constantly try to improve.</p><p>I still have so much to learn. I still make mistakes. I still struggle with things I wish I could understand more quickly. I still have ambitions that require years of effort.</p><p>But reading those letters reminded me that growth isn’t always something we recognize ourselves.</p><p>Sometimes, the people who teach us see our progress more clearly than we do.</p><p>They remember where we started.</p><p>They observe how we approach challenges.</p><p>They see the effort we put into learning.</p><p>And when they take the time to acknowledge that growth, it gives us something incredibly valuable: the reassurance that our efforts matter.</p><p>Those letters weren’t just documents for postgraduate applications.</p><p>To me, they were reminders of the relationships, lessons, and encouragement that had become part of my journey.</p><h3>One day, we leave their classrooms</h3><p>Eventually, every student moves on.</p><p>We graduate.</p><p>We pursue careers.</p><p>We travel.</p><p>We enter new universities, workplaces, and environments.</p><p>We meet new people and begin new chapters.</p><p>Our teachers remain behind, welcoming another group of students, explaining another lesson, and helping another generation discover its potential.</p><p>Perhaps years later, we will unexpectedly remember one of their lectures.</p><p>Perhaps we will use a concept they taught us without even realizing it.</p><p>Perhaps we will hear ourselves advising someone else and recognize that those words once came from our own teacher.</p><p>And maybe, one day, we will return to visit them.</p><p>We will tell them about the projects we built, the opportunities we pursued, the challenges we overcame, and the dreams that became reality.</p><p>They might smile.</p><p>They might say they always knew we could do it.</p><p>And in that moment, we may finally understand how much they cared about our journey.</p><h3>To every teacher</h3><p>To every teacher who has ever entered a classroom and tried to make a difference:</p><p>Your work matters.</p><p>Even on the days when students don’t listen.</p><p>Even when your efforts go unnoticed.</p><p>Even when the results aren’t immediate.</p><p>Even when you don’t know whether your lesson will be remembered.</p><p>Somewhere, a student is carrying something you taught them.</p><p>Somewhere, your encouragement is helping someone continue.</p><p>Somewhere, your patience is helping someone believe they are capable.</p><p>Somewhere, a former student is making a decision, solving a problem, pursuing a dream, or helping another person, and a small part of that moment belongs to you.</p><p>You may never know the full extent of your influence.</p><p>You may never meet the people whose lives your students eventually touch.</p><p>But your impact doesn’t end at the classroom door.</p><p>It continues through every student you teach, every lesson you leave behind, and every life that becomes a little better because you chose to teach.</p><p>And to my own teachers, who have been part of my journey, my growth, and the dreams I am still working toward:</p><p>Thank you for being patient with me.</p><p>Thank you for teaching me.</p><p>Thank you for challenging me.</p><p>Thank you for believing in me.</p><p>Thank you for helping me become a little better than I was yesterday.</p><p>I still have a long way to go, and I hope that wherever life takes me, I carry your lessons with me.</p><p>Because when I think about superheroes, I no longer think only about the ones I watched in movies as a child.</p><p>I think about the people standing in classrooms, shaping futures without knowing exactly how far their influence will reach.</p><p><strong>Teachers are my superheroes.</strong></p><p>And I think the world could use a little more recognition for the extraordinary work they do every single day.</p><p><em>Lots of love and respect to every teacher who has ever been part of someone’s journey. May Allah bless you, reward your efforts, and allow the knowledge you share to continue benefiting others. Ameen.</em> ️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43ba07ed7b48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Does Python Need Virtual Environments, While Node.js Usually Doesn’t?]]></title>
            <link>https://medium.com/@abdulmoazzam0815/why-does-python-need-virtual-environments-while-node-js-usually-doesnt-138a18014aef?source=rss-1558384b4060------2</link>
            <guid isPermaLink="false">https://medium.com/p/138a18014aef</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Abdul Moazzim]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 18:02:24 GMT</pubDate>
            <atom:updated>2026-11-23T18:02:24.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsAc7czKBXbMTopBHukjXA.png" /></figure><p>If you’ve worked with both Python and Node.js, you might have noticed an interesting difference.</p><p>In Python, developers are strongly encouraged to create a virtual environment before installing dependencies. You’ll frequently see commands like:</p><pre>python -m venv .venv</pre><p>However, in Node.js, developers typically just initialize a project and install packages:</p><pre>npm init -y<br>npm install express</pre><p>No explicit virtual environment. No additional setup.</p><p>So, why does Python need virtual environments while Node.js seemingly doesn’t?</p><p>The answer lies in <strong>how both ecosystems manage dependencies and isolate packages.</strong></p><h3>1. The Problem: Dependency Conflicts</h3><p>Imagine you’re working on two Python projects.</p><ul><li>Project A requires Django 4.2.</li><li>Project B requires Django 5.0.</li></ul><p>If you install Django globally using pip, both projects share the same Python package installation.</p><p>For example:</p><pre>pip install django==4.2</pre><p>Later, you install another version:</p><pre>pip install django==5.0</pre><p>Now, the globally installed Django version has changed.</p><p>Project A might break because it expects Django 4.2, but the environment now contains Django 5.0.</p><p>This is called a <strong>dependency conflict</strong>.</p><p>The problem isn’t exclusive to Django. It can happen with virtually any Python library.</p><h3>2. How Python Solves This: Virtual Environments</h3><p>Python solves this problem through virtual environments.</p><p>A virtual environment creates an isolated Python package installation for a particular project.</p><p>Let’s create two projects:</p><pre>mkdir project-a project-b</pre><p>Create a virtual environment inside each:</p><pre>cd project-a<br>python -m venv .venv</pre><p>And:</p><pre>cd ../project-b<br>python -m venv .venv</pre><p>Now, each project has its own isolated environment.</p><pre>project-a/<br>├── .venv/<br>│   └── Lib/<br>│       └── site-packages/<br>│           └── Django 4.2<br>└── main.py</pre><pre>project-b/<br>├── .venv/<br>│   └── Lib/<br>│       └── site-packages/<br>│           └── Django 5.0<br>└── main.py</pre><p>Both projects can use different Django versions without interfering with each other.</p><p>Activate the environment:</p><p><strong>Windows:</strong></p><pre>.venv\Scripts\Activate.ps1</pre><p><strong>Linux/macOS:</strong></p><pre>source .venv/bin/activate</pre><p>Install dependencies:</p><pre>pip install django==4.2</pre><p>The package gets installed inside the active virtual environment rather than the global Python installation.</p><p>To record dependencies:</p><pre>pip freeze &gt; requirements.txt</pre><p>This makes it easier to reproduce the project’s environment on another machine.</p><h3>3. Why Node.js Doesn’t Usually Need a Virtual Environment</h3><p>Node.js approaches dependency management differently.</p><p>When you execute:</p><pre>npm install express</pre><p>npm installs Express inside the current project’s node_modules directory.</p><p>For example:</p><pre>project-a/<br>├── node_modules/<br>│   └── express/<br>├── package.json<br>└── package-lock.json</pre><p>Another project can install an entirely different version:</p><pre>project-b/<br>├── node_modules/<br>│   └── express/<br>├── package.json<br>└── package-lock.json</pre><p>Each project has its own dependency directory.</p><p>This means:</p><ul><li>Project A can use Express 4.</li><li>Project B can use Express 5.</li><li>Neither project needs to modify the other’s dependencies.</li></ul><p><strong>In other words, Node.js already provides project-level dependency isolation through its package management workflow.</strong></p><p>That’s why developers generally don’t need an additional virtual environment for npm packages.</p><h3>4. But Wait! What About Python’s requirements.txt and Node’s package.json?</h3><p>Both ecosystems provide mechanisms to record and reproduce dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*Ww2CcgCy_T2Ja7FQE6UVJw.png" /></figure><p>One important distinction:</p><p>A Python virtual environment isolates installed packages, while requirements.txt records which packages should be installed.</p><p>Similarly, Node’s node_modules contains installed packages, while package.json declares dependencies and package-lock.json locks their resolved versions.</p><p>These files serve different purposes.</p><h3>5. Does Node.js Need Environment Isolation at All?</h3><p>Not exactly. Node.js avoids the need for virtual environments for ordinary project dependencies, but it doesn’t mean everything is isolated.</p><p>Consider these scenarios:</p><p><strong>1. Different Node.js versions</strong></p><p>Project A might require Node.js 18, while Project B requires Node.js 22.</p><p>Installing different npm packages doesn’t solve this because Node.js itself is a runtime, not a project dependency.</p><p>Developers use tools such as:</p><ul><li>nvm (Node Version Manager)</li><li>fnm (Fast Node Manager)</li><li>Volta</li></ul><p>These tools allow developers to switch between Node.js versions.</p><p><strong>2. Global npm packages</strong></p><p>If you install a package globally:</p><pre>npm install -g typescript</pre><p>It becomes available globally rather than being installed inside one particular project.</p><p>Global packages can also create version conflicts.</p><p><strong>3. Python interpreter versions</strong></p><p>Python has a similar distinction. A virtual environment isolates packages, but it doesn’t independently manage every Python interpreter version. Tools such as pyenv can help manage multiple Python versions.</p><h3>6. The Bigger Picture: Different Design Philosophies</h3><p>The difference isn’t that Python is poorly designed or Node.js is inherently better at dependency management.</p><p>They simply evolved different approaches.</p><p>Python’s traditional package installation workflow can install packages into a shared interpreter environment. Virtual environments provide the isolation needed for independent projects.</p><p>Node.js’s npm workflow installs dependencies locally by default, creating project-level isolation without requiring a separate environment-management command.</p><p>There are also tools such as Poetry, uv, Pipenv, and Conda that make Python dependency and environment management more convenient.</p><h3>Conclusion</h3><p>The main takeaway is simple:</p><p><strong>Python uses virtual environments because package installations can otherwise interfere with one another. Node.js generally doesn’t need them because npm installs project dependencies locally inside </strong><strong>node_modules by default.</strong></p><p>Both ecosystems solve the same fundamental problem: keeping project dependencies independent and reproducible.</p><p>Understanding this difference is important because dependency management isn’t just about installing libraries. It’s about ensuring that multiple projects can coexist, evolve independently, and run reliably across different development environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=138a18014aef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding 5 Fundamental Sorting Algorithms: Intuition, Complexity, Stability, and Optimizations]]></title>
            <link>https://medium.com/@abdulmoazzam0815/understanding-5-fundamental-sorting-algorithms-intuition-complexity-stability-and-optimizations-3fdb0cd18e8e?source=rss-1558384b4060------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fdb0cd18e8e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Abdul Moazzim]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 18:38:35 GMT</pubDate>
            <atom:updated>2026-11-23T17:48:14.080Z</atom:updated>
            <content:encoded><![CDATA[<p>Sorting is one of the fundamental problems in computer science. Whether we are organizing database records, ranking search results, processing large datasets, or building efficient applications, sorting plays an important role in software development.</p><p>However, different sorting algorithms approach the same problem differently. Some prioritize simplicity, others minimize memory usage, while some achieve better average-case performance through divide-and-conquer strategies.</p><p>In this article, we’ll explore five fundamental sorting algorithms:</p><ol><li>Bubble Sort</li><li>Selection Sort</li><li>Insertion Sort</li><li>Merge Sort</li><li>Quick Sort</li></ol><p>We’ll examine their underlying intuition, implementations, time and space complexities, stability, in-place properties, and practical optimizations.</p><h3>1. Bubble Sort</h3><h3>Intuition</h3><p>Bubble Sort repeatedly compares adjacent elements and swaps them if they are in the wrong order.</p><p>After each complete pass, the largest unsorted element moves to its correct position at the end of the array.</p><p>Consider:</p><p>[5, 3, 8, 2, 1]</p><p>During the first pass:</p><ul><li>Compare 5 and 3 → swap.</li><li>Compare 5 and 8 → no swap.</li><li>Compare 8 and 2 → swap.</li><li>Compare 8 and 1 → swap.</li></ul><p>The array becomes:</p><p>[3, 5, 2, 1, 8]</p><p>Notice that the largest element, 8, has reached its correct position. We repeat this process until the entire array is sorted.</p><h3>Implementation</h3><pre>def bubble_sort(arr):<br>    n = len(arr)<br>    for i in range(n):<br>        swapped = False<br>        for j in range(n - i - 1):<br>            if arr[j] &gt; arr[j + 1]:<br>                arr[j], arr[j + 1] = arr[j + 1], arr[j]<br>                swapped = True<br>        if not swapped:<br>            break<br>    return arr</pre><h3>Optimization</h3><p>The basic Bubble Sort algorithm continues making passes even when the array is already sorted.</p><p>We can optimize it using a Boolean flag, swapped. If an entire pass completes without any swaps, the array is already sorted, so we terminate early.</p><p>Another optimization is tracking the last swapped position, allowing subsequent passes to ignore the already sorted suffix.</p><h3>Complexity</h3><ul><li>Best Case: O(n) — already sorted with early termination.</li><li>Average Case: O(n²).</li><li>Worst Case: O(n²) — reverse sorted.</li><li>Auxiliary Space: O(1).</li></ul><p><strong>Properties:</strong></p><ul><li>Stable: Yes.</li><li>In-place: Yes.</li><li>Adaptive: Yes, with early termination.</li></ul><h3>2. Selection Sort</h3><h3>Intuition</h3><p>Selection Sort divides the array into two conceptual regions:</p><ul><li>Sorted region.</li><li>Unsorted region.</li></ul><p>Initially, the entire array is unsorted.</p><p>We repeatedly find the smallest element from the unsorted region and place it at the beginning of that region.</p><p>Consider:</p><p>[7, 4, 9, 2, 5]</p><p>First pass:</p><ul><li>Find the minimum element: 2.</li><li>Swap it with the first element, 7.</li></ul><p>Result:</p><p>[2, 4, 9, 7, 5]</p><p>Second pass:</p><ul><li>Ignore the sorted element 2.</li><li>Find the minimum in [4, 9, 7, 5].</li><li>The minimum is 4, already in the correct position.</li></ul><p>Continue until the array is sorted.</p><h3>Implementation</h3><pre>def selection_sort(arr):<br>    n = len(arr)<br>    for i in range(n):<br>            min_index = i<br>            for j in range(i + 1, n):<br>                if arr[j] &lt; arr[min_index]:<br>                    min_index = j<br>            if min_index != i:<br>                arr[i], arr[min_index] = arr[min_index], arr[i]<br>        return arr</pre><h3>Optimization</h3><p>Selection Sort already minimizes the number of swaps: at most n-1 swaps for an array of n elements.</p><p>A useful minor optimization is to avoid unnecessary self-swaps when the minimum is already at the current position.</p><p>Unlike Bubble Sort, Selection Sort cannot achieve O(n) best-case time because it must still search the remaining unsorted region for the minimum element.</p><p>A stable variant can be implemented by shifting elements instead of swapping, but this changes the movement cost and is not the standard implementation.</p><h3>Complexity</h3><ul><li>Best Case: O(n²).</li><li>Average Case: O(n²).</li><li>Worst Case: O(n²).</li><li>Auxiliary Space: O(1).</li></ul><p><strong>Properties:</strong></p><ul><li>Stable: No (standard implementation).</li><li>In-place: Yes.</li><li>Adaptive: No.</li></ul><h3>3. Insertion Sort</h3><h3>Intuition</h3><p>Insertion Sort works similarly to arranging playing cards in your hand.</p><p>We maintain a sorted portion on the left and an unsorted portion on the right. We pick an element from the unsorted portion and insert it into its correct position within the sorted portion.</p><p>Consider:</p><p>[7, 3, 8, 2, 6]</p><p>Initially, we consider 7 sorted.</p><p>Next, pick 3:</p><ul><li>Compare it with 7.</li><li>Shift 7 one position right.</li><li>Insert 3 before 7.</li></ul><p>Result:</p><p>[3, 7, 8, 2, 6]</p><p>Next, pick 8. Since 8 is greater than 7, it is already in the correct position. Continue until the entire array is sorted.</p><h3>Implementation</h3><pre>def insertion_sort(arr):<br>    for i in range(1, len(arr)):<br>        key = arr[i]<br>        j = i - 1<br>        <br>        while j &gt;= 0 and arr[j] &gt; key:<br>            arr[j + 1] = arr[j]<br>            j -= 1<br>        arr[j + 1] = key<br>    return arr</pre><h3>Why shifting instead of swapping?</h3><p>Instead of repeatedly swapping adjacent elements, we temporarily store the key and shift larger elements one position to the right.</p><p>This reduces unnecessary element assignments.</p><p>It also preserves the relative order of equal elements because we use &gt; rather than &gt;=.</p><h3>Optimizations</h3><p><strong>1. Binary Insertion Sort</strong></p><p>Instead of linearly searching for the correct insertion position, we can use binary search to locate it. This reduces the number of comparisons from O(n) to O(log n) per insertion.</p><p>However, shifting elements still requires O(n) movements per insertion, so overall time complexity remains O(n²).</p><p><strong>2. Hybrid sorting</strong></p><p>Insertion Sort performs particularly well on small or nearly sorted arrays.</p><p>This is why practical implementations of algorithms such as Timsort and hybrid Quick Sort implementations use insertion sort for small subarrays.</p><h3>Complexity</h3><ul><li>Best Case: O(n) — already sorted.</li><li>Average Case: O(n²).</li><li>Worst Case: O(n²) — reverse sorted.</li><li>Auxiliary Space: O(1).</li></ul><p><strong>Properties:</strong></p><ul><li>Stable: Yes.</li><li>In-place: Yes.</li><li>Adaptive: Yes.</li></ul><h3>4. Merge Sort</h3><h3>Intuition</h3><p>Merge Sort uses the Divide and Conquer technique.</p><p>Instead of sorting the entire array at once, we repeatedly divide it into smaller subarrays until each subarray contains only one element.</p><p>A single-element array is already sorted.</p><p>We then merge these smaller sorted arrays into larger sorted arrays.</p><p>Consider:</p><p>[8, 3, 5, 2, 9, 1, 6, 4]</p><p>First, divide:</p><pre>              [8, 3, 5, 2, 9, 1, 6, 4]<br>                    /          \<br>           [8, 3, 5, 2]      [9, 1, 6, 4]<br>             /     \            /     \<br>          [8, 3]  [5, 2]     [9, 1]  [6, 4]<br>           / \     / \        / \     / \<br>          [8][3]  [5][2]     [9][1]  [6][4]</pre><p>Now merge the elements in sorted order:</p><pre>[3, 8]   [2, 5]   [1, 9]   [4, 6]</pre><pre>    [2, 3, 5, 8]      [1, 4, 6, 9]</pre><pre>          [1, 2, 3, 4, 5, 6, 8, 9]</pre><h3>Implementation</h3><pre>def merge_sort(arr):<br>    if len(arr) &lt;= 1:<br>        return arr<br>    mid = len(arr) // 2<br>    left = merge_sort(arr[:mid])<br>    right = merge_sort(arr[mid:])<br>    return merge(left, right)<br><br>def merge(left, right):<br>    result = []<br>    i = j = 0<br>    while i &lt; len(left) and j &lt; len(right):<br>        if left[i] &lt;= right[j]:<br>            result.append(left[i])<br>            i += 1<br>        else:<br>            result.append(right[j])<br>            j += 1<br>    result.extend(left[i:])<br>    result.extend(right[j:])<br>    return result</pre><h3>Optimizations</h3><p><strong>1. Skip unnecessary merging</strong></p><p>If the largest element of the left subarray is already smaller than or equal to the smallest element of the right subarray, the two sorted portions are already globally ordered.</p><p>We can avoid the merge operation.</p><p><strong>2. Insertion Sort for small subarrays</strong></p><p>For small subarrays, Insertion Sort can be faster because it avoids recursive function-call overhead and additional merging work.</p><p><strong>3. Bottom-up Merge Sort</strong></p><p>Instead of recursively dividing the array, we can iteratively merge subarrays of increasing sizes:</p><ul><li>Merge runs of size 1.</li><li>Merge runs of size 2.</li><li>Merge runs of size 4.</li><li>Continue until the entire array is sorted.</li></ul><p>This avoids recursive call overhead.</p><h3>Complexity</h3><ul><li>Best Case: O(n log n).</li><li>Average Case: O(n log n).</li><li>Worst Case: O(n log n).</li><li>Auxiliary Space: O(n) for the typical array implementation.</li></ul><p><strong>Properties:</strong></p><ul><li>Stable: Yes, when equal elements are taken from the left subarray first.</li><li>In-place: No, in the typical array implementation.</li><li>Adaptive: Not in its basic implementation, although optimized variants can exploit existing ordered runs.</li></ul><h3>5. Quick Sort</h3><h3>Intuition</h3><p>Quick Sort is another Divide and Conquer algorithm.</p><p>However, unlike Merge Sort, it first partitions the array around a selected pivot.</p><p>The objective is to arrange:</p><ul><li>Elements smaller than or equal to the pivot on the left.</li><li>Elements greater than the pivot on the right.</li></ul><p>Once the pivot reaches its correct position (in Lomuto partitioning), we recursively sort the left and right subarrays.</p><p>Consider:</p><p>[7, 2, 9, 4, 3, 8, 1]</p><p>Select 4 as the pivot.</p><p>After partitioning, one possible arrangement is:</p><p>[2, 1, 3] 4 [9, 7, 8]</p><p>The pivot is now in its correct sorted position.</p><p>We recursively apply the same process to both sides.</p><h3>Two important partition strategies</h3><p>There are two commonly taught partition schemes: Lomuto and Hoare.</p><h4>A. Lomuto Partition Scheme</h4><p>Lomuto typically selects the last element as the pivot.</p><p>It uses two pointers:</p><ul><li>j: Scans the array.</li><li>i: Tracks the boundary of elements smaller than or equal to the pivot.</li></ul><p>Whenever an element smaller than or equal to the pivot is found, we expand the smaller-elements region and swap the element into that region.</p><p>Implementation:</p><pre>def lomuto_partition(arr, low, high):<br>      pivot = arr[high]<br>      i = low - 1<br>      for j in range(low, high):<br>          if arr[j] &lt;= pivot:<br>              i += 1<br>              arr[i], arr[j] = arr[j], arr[i]<br>      arr[i + 1], arr[high] = arr[high], arr[i + 1]<br>      return i + 1</pre><p>The returned value is the pivot’s final sorted index.</p><h4>B. Hoare Partition Scheme</h4><p>Hoare partitioning uses two pointers that move in opposite directions.</p><p>Typically, the first element is selected as the pivot.</p><ul><li>i moves from left to right, looking for an element greater than or equal to the pivot.</li><li>j moves from right to left, looking for an element smaller than or equal to the pivot.</li><li>If the pointers have not crossed, swap the two misplaced elements.</li><li>Continue until the pointers cross.</li></ul><p>Implementation:</p><pre>def hoare_partition(arr, low, high):<br>    pivot = arr[low]<br>    i = low - 1<br>    j = high + 1<br>    while True:<br>        i += 1<br>        while arr[i] &lt; pivot:<br>            i += 1<br>        j -= 1<br>        while arr[j] &gt; pivot:<br>            j -= 1<br>        if i &gt;= j:<br>            return j<br>        arr[i], arr[j] = arr[j], arr[i]</pre><p>An important distinction:</p><p>Lomuto returns the pivot’s final sorted index, whereas Hoare returns a partition boundary. Therefore, their recursive calls are different.</p><p>Lomuto:</p><pre>quick_sort(arr, low, p - 1)<br>quick_sort(arr, p + 1, high)</pre><p>Hoare:</p><pre>quick_sort(arr, low, p)<br>quick_sort(arr, p + 1, high)</pre><h3>Quick Sort implementation</h3><p>Using Lomuto partitioning:</p><pre>def quick_sort(arr, low, high):<br>    if low &lt; high:<br>        p = lomuto_partition(arr, low, high)<br>        quick_sort(arr, low, p - 1)<br>        quick_sort(arr, p + 1, high)<br>    return arr</pre><h3>Pivot selection strategies</h3><p>Choosing a pivot significantly affects Quick Sort’s performance.</p><p>Common approaches include:</p><ol><li>First element: Simple, but can perform poorly on already sorted arrays.</li><li>Last element: Simple, but also vulnerable to unfavorable input arrangements.</li><li>Middle element: A reasonable heuristic, but does not guarantee balanced partitions.</li><li>Random pivot: Randomly selects an element, reducing the likelihood of consistently poor partitions on predictable input.</li><li>Median-of-three: Selects the median among the first, middle, and last elements to obtain a more representative pivot.</li></ol><h3>Optimizations</h3><p><strong>1. Randomized Quick Sort</strong></p><p>Randomly select a pivot before partitioning. This improves expected performance across different input arrangements.</p><p><strong>2. Median-of-three pivot selection</strong></p><p>Choose the median of three candidate elements instead of blindly selecting the first or last element.</p><p><strong>3. Three-way partitioning</strong></p><p>For arrays containing many duplicate elements, divide the array into three regions:</p><ul><li>Elements smaller than the pivot.</li><li>Elements equal to the pivot.</li><li>Elements greater than the pivot.</li></ul><p>This avoids repeatedly processing large groups of equal values.</p><p><strong>4. Hybrid Quick Sort</strong></p><p>Switch to Insertion Sort when the subarray becomes sufficiently small. This reduces recursive overhead and can improve practical performance.</p><p><strong>5. Tail-recursion optimization</strong></p><p>Recursively process the smaller partition and iterate over the larger one to reduce recursion stack usage.</p><h3>Complexity</h3><ul><li>Best Case: O(n log n).</li><li>Average Case: O(n log n).</li><li>Worst Case: O(n²).</li><li>Auxiliary Space: O(log n) average recursion stack; O(n) in the worst case for a straightforward recursive implementation.</li></ul><p><strong>Properties:</strong></p><ul><li>Stable: No, in standard implementations.</li><li>In-place: Yes, for standard in-place partitioning.</li><li>Adaptive: Not inherently, although hybrid variants can exploit small or favorable subarrays.</li></ul><h3>6. Complete Complexity Comparison</h3><p>Here is a comparison of all five algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*zozORUjHks_Ej4kwvUF5fg.png" /><figcaption>Complexity Comparison</figcaption></figure><h3>7. Stability and In-Place Comparison</h3><p>Two important properties help us evaluate sorting algorithms beyond their time complexity.</p><h3>What is a stable sorting algorithm?</h3><p>A stable sorting algorithm preserves the relative order of elements having equal keys.</p><p>For example, consider:</p><pre>[(Ali, 85), (Ahmed, 90), (Sara, 85)]</pre><p>If we sort by marks in ascending order, a stable algorithm preserves Ali before Sara because both have 85 marks and Ali appeared first.</p><h3>What is an in-place sorting algorithm?</h3><p>An in-place sorting algorithm rearranges elements within the original array while using only a small amount of auxiliary memory, typically O(1).</p><p>Note that recursion stack space still counts as auxiliary space.</p><h3>Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*y9l9qQ2wpHpBK_S3TELTwQ.png" /></figure><h3>8. When Should You Use Each Algorithm?</h3><p>Understanding when to use an algorithm is just as important as understanding its implementation.</p><p>AlgorithmSuitable scenariosBubble SortEducational purposes and understanding basic sorting conceptsSelection SortSmall datasets where minimizing swaps is importantInsertion SortSmall or nearly sorted datasetsMerge SortWhen predictable O(n log n) performance and stability are importantQuick SortGeneral-purpose in-memory sorting when average-case performance is important</p><p>In real-world software development, we generally rely on optimized library implementations rather than manually implementing these algorithms.</p><p>For example, Python’s built-in sorted() and .sort() use Timsort, a stable adaptive sorting algorithm that combines ideas from Merge Sort and Insertion Sort.</p><h3>9. Final Takeaways</h3><p>Each sorting algorithm teaches an important problem-solving technique:</p><ul><li>Bubble Sort teaches adjacent comparisons and swapping.</li><li>Selection Sort teaches minimum selection and reducing unnecessary swaps.</li><li>Insertion Sort teaches maintaining a sorted region and efficient element shifting.</li><li>Merge Sort teaches “Divide and Conquer” with predictable time complexity.</li><li>Quick Sort teaches partitioning, pivot selection, and recursive problem decomposition.</li></ul><p>More importantly, don’t evaluate sorting algorithms only by their Big-O complexity.</p><p>Consider:</p><ul><li>Input size and distribution.</li><li>Number of duplicate elements.</li><li>Memory constraints.</li><li>Stability requirements.</li><li>Number of comparisons and swaps.</li><li>Recursion overhead.</li><li>Practical performance on the target workload.</li></ul><p><strong>The best algorithm is not necessarily the one with the smallest theoretical complexity. It is the one that best satisfies the requirements of the problem.</strong></p><p>Keep practicing by manually tracing each algorithm before implementing it. Understanding why each pointer moves, why each swap happens, and how the array changes is what builds strong DSA fundamentals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fdb0cd18e8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First Kaggle Notebook: Understanding Linear Regression by Implementing It from Scratch]]></title>
            <link>https://medium.com/@abdulmoazzam0815/my-first-kaggle-notebook-understanding-linear-regression-by-implementing-it-from-scratch-da41d189ba8c?source=rss-1558384b4060------2</link>
            <guid isPermaLink="false">https://medium.com/p/da41d189ba8c</guid>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Abdul Moazzim]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 15:54:14 GMT</pubDate>
            <atom:updated>2026-11-02T15:54:14.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gDQRpwWlkCMwu2VLT7jZ0w.jpeg" /><figcaption>Notebook for Linear Regression</figcaption></figure><p>Every machine learning journey starts somewhere. Mine started with <strong>Linear Regression</strong>.</p><p>I recently worked on my first Kaggle notebook, where I explored how Linear Regression works under the hood using Python and NumPy.</p><p>I followed a tutorial to learn the algorithm, but I didn’t want to stop at just understanding the explanation or copying the code. I wanted to understand the mathematics, the implementation, and what was happening at each step.</p><p>So, I implemented the algorithm multiple times.</p><h3>Learning by implementing</h3><p>I started with the <strong>Normal Equation</strong>, which helped me understand how we can calculate model parameters analytically.</p><p>After that, I moved towards <strong>Gradient Descent</strong>. This is where things became particularly interesting.</p><p>I implemented Gradient Descent in different ways:</p><ul><li><strong>Three-loop implementation:</strong> Iterating through training iterations, features, and training examples.</li><li><strong>Two-loop implementation:</strong> Using NumPy operations to reduce the number of loops.</li><li><strong>Fully vectorized implementation:</strong> Using matrix multiplication to calculate gradients efficiently in a single expression.</li></ul><p>Each implementation helped me understand something new about matrix dimensions, predictions, errors, gradients, transposes, and vectorization.</p><p>One of my biggest takeaways was understanding how vectorization makes mathematical operations more concise and computationally efficient.</p><h3>What I learned</h3><p>This exercise taught me that understanding an ML algorithm requires more than knowing its definition or calling a library’s fit() method.</p><p>Implementing it from scratch helped me connect the mathematical concepts with actual code.</p><p>I also realized that rewriting an implementation is not necessarily repetition without purpose. Sometimes, implementing the same algorithm in different ways is one of the best ways to develop a deeper understanding.</p><h3>My first Kaggle notebook</h3><p>I’ve published my work on Kaggle:</p><p><a href="https://www.kaggle.com/code/abdulmoazzim/linear-regression-from-scratch"><strong>Linear Regression from Scratch — Normal Equation &amp; Gradient Descent</strong></a></p><p>This is my first notebook, and I see it as the beginning of a much longer learning journey.</p><h3>What’s next?</h3><p>I plan to keep publishing notebooks on Kaggle as I progress through machine learning.</p><p>My upcoming work will explore:</p><ul><li>Exploratory Data Analysis (EDA)</li><li>Data preprocessing and feature engineering</li><li>Classical machine learning algorithms</li><li>Model evaluation and optimization</li><li>Eventually, deep learning</li></ul><p>My goal isn&#39;t just to complete tutorials, but to understand the concepts, implement them, experiment, and document my progress along the way.</p><p>I’m sharing this journey as a learner. There is still a lot to explore, and I’m excited about what comes next.</p><p><strong>One notebook at a time. One concept at a time.</strong></p><p>#MachineLearning #Python #Kaggle #LinearRegression #NumPy #LearningInPublic #AI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da41d189ba8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating From pip to uv: Why Your Python Workflow Needs an Upgrade]]></title>
            <link>https://medium.com/@abdulmoazzam0815/migrating-from-pip-to-uv-why-your-python-workflow-needs-an-upgrade-6870c0ad13e5?source=rss-1558384b4060------2</link>
            <guid isPermaLink="false">https://medium.com/p/6870c0ad13e5</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Abdul Moazzim]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 10:24:24 GMT</pubDate>
            <atom:updated>2026-09-02T10:26:02.816Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been writing Python for any length of time, your muscle memory probably includespip install, a venv you forgot to activate, and a requirements.txt file that&#39;s slightly out of sync with reality. That workflow has been &quot;good enough&quot; for over a decade — but it&#39;s slow and held together by several separate tools that don&#39;t always agree.</p><p>Enter <strong>uv</strong>: a single Rust-based binary from Astral (the team behind the Ruff linter) that replaces pip, pip-tools, virtualenv, pyenv, pipx, and Poetry-style project management — all at once, and dramatically faster.</p><p>This post walks through what uv actually is, how it’s architected, why it’s faster, the command mapping you need to migrate, and a practical migration path for an existing pip project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/0*60wU3rDPWLKves44" /></figure><h3>What Is uv, Really?</h3><p>uv is a Python packaging and project manager written in Rust. It handles:</p><ul><li>Installing and resolving packages (pip’s job)</li><li>Creating and managing virtual environments (virtualenv’s job)</li><li>Installing and switching between Python interpreter versions (pyenv’s job)</li><li>Running one-off CLI tools in isolated environments (pipx’s job)</li><li>Managing a project’s dependencies, lockfile, and build (Poetry’s job)</li></ul><p>Instead of five tools with five different mental models, you get one binary and one consistent interface.</p><h3>Architecture: Why uv Is So Fast</h3><p>uv’s speed isn’t a marketing trick — it comes from real architectural decisions:</p><p><strong>1. Written in Rust, not Python.</strong> pip is a Python program, which means its own execution has interpreter overhead. uv is a compiled native binary, so the tool itself starts and runs orders of magnitude faster.</p><p><strong>2. A global, content-addressed cache.</strong> When uv downloads or builds a package, it stores it in a global cache keyed by content hash rather than by project. If you have ten projects that all depend onnumpy, uv doesn&#39;t redownload or rebuild it ten times — it links the cached copy into each project&#39;s environment. This is the single biggest reason repeated installs feel instant.</p><p><strong>3. A modern, parallelized dependency resolver.</strong> pip’s resolver works sequentially and re-evaluates a lot of state as it goes. uv’s resolver is written to explore the dependency graph in parallel and short-circuit incompatible branches early, which matters enormously on large, deeply-nested dependency trees.</p><p><strong>4. Hardlinking/copy-on-write installs instead of copying files.</strong> On most filesystems, uv installs packages into a virtual environment using hardlinks or reflinks from the global cache rather than physically copying every file. Installation becomes a filesystem metadata operation instead of a disk I/O–heavy copy.</p><p><strong>5. A unified lockfile format (</strong><strong>uv.lock).</strong> Unlike requirements.txt, which only pins top-level packages you list, uv.lock captures the fully resolved dependency graph — exact versions, hashes, and per-platform markers — so a project installs identically on every machine and CI runner.</p><p>Together, this is why benchmarks commonly show uv completing installs 10–100x faster than pip, especially on cache hits.</p><h3>Core Advantages Over pip</h3><ul><li><strong>Speed</strong> — both cold installs and, especially, repeat installs across projects.</li><li><strong>One tool instead of five</strong> — no more juggling pip + virtualenv + pyenv + pipx + Poetry.</li><li><strong>Deterministic builds</strong> — uv.lock guarantees the same resolved environment everywhere.</li><li><strong>Automatic virtual environment management</strong> — uv run and uv sync create and use a project&#39;s .venv without you manually activating anything.</li><li><strong>Built-in Python version management</strong> — uv python install 3.12 downloads and manages interpreters directly, no pyenv required.</li><li><strong>Drop-in pip compatibility</strong> — uv ships a uv pip interface that mirrors pip&#39;s CLI almost exactly, so you can migrate incrementally.</li><li><strong>Extras that used to require separate tools</strong> — uv add (add a dependency), uv tool run / uvx (run a CLI tool in an ephemeral environment, like pipx), and experimental commands like uv audit for scanning locked dependencies against known vulnerabilities.</li></ul><h3>Command Mapping: pip → uv</h3><p>Task pip / virtualenv / pyenv uv Install uv itself — curl -LsSf https://astral.sh/uv/install.sh | sh Create a virtual environment python -m venv .venv uv venv Activate environment source .venv/bin/activate not required — uv run handles it Install a package pip install requests uv add requests (project) or uv pip install requests (pip-style) Install from requirements.txt pip install -r requirements.txt uv pip install -r requirements.txt Freeze dependencies pip freeze &gt; requirements.txt uv pip freeze or use uv.lock Remove a package pip uninstall requests uv remove requests Install project + deps pip install -e . uv sync Run a script in the env python script.py (after activating) uv run script.py Install a specific Python version pyenv install 3.12 uv python install 3.12 Run a CLI tool in isolation pipx run black uvx black Lock dependencies (pip-tools) pip-compile uv lock Update the lockfile pip-compile --upgrade uv lock --upgrade</p><h3>Migrating an Existing pip Project: A Practical Path</h3><p>You don’t have to rewrite everything on day one. uv is designed for incremental adoption.</p><p><strong>Step 1 — Install uv.</strong></p><pre>curl -LsSf https://astral.sh/uv/install.sh | sh</pre><p><strong>Step 2 — Try it as a drop-in pip replacement first.</strong> Inside your existing project, with your existing requirements.txt, just swap the binary:</p><pre>uv venv<br>uv pip install -r requirements.txt</pre><p>This alone typically gives you a large speed boost with zero changes to how your project is structured.</p><p><strong>Step 3 — Move to a real uv project once you’re comfortable.</strong></p><pre>uv init<br>uv add $(cat requirements.txt)</pre><p>This generates a pyproject.toml and a uv.lock file capturing your fully resolved dependency graph.</p><p><strong>Step 4 — Pin your Python version explicitly.</strong></p><pre>uv python install 3.12<br>uv python pin 3.12</pre><p><strong>Step 5 — Replace </strong><strong>python script.py with </strong><strong>uv run script.py</strong> in your local workflow, Makefiles, and CI. uv run guarantees that the command executes in the correct synced environment without you having to manually activate anything.</p><p><strong>Step 6 — Update CI.</strong> Most CI setups only need one new step: install uv, then run uv sync before your test/build commands. You no longer need separate steps for setting up Python, creating a venv, and installing requirements — uv collapses those into one.</p><p><strong>Step 7 — Commit </strong><strong>uv.lock.</strong> Treat it like package-lock.json or Cargo.lock — it&#39;s what gives every teammate and CI runner an identical, reproducible environment.</p><h3>Things to Watch For</h3><ul><li>uv is CLI-only — there’s no GUI, which can be a friction point in some data-science workflows that lean on Conda-style tooling.</li><li>The global cache is a shared resource; it grows over time and occasionally needs pruning (uv cache clean).</li><li>Some very niche pip plugins or index configurations may not have a direct uv equivalent yet — check uv’s docs if you rely on custom index behavior.</li><li>If your team uses Conda specifically for non-Python binary dependencies (e.g., certain scientific libraries), uv doesn’t replace that use case — it replaces pip/venv/Poetry/pyenv/pipx.</li></ul><h3>Wrapping Up</h3><p>uv doesn’t ask you to change how you think about Python packaging — it asks you to stop juggling five tools that each solve one piece of it. The migration path is gradual: start by swapping the binary under your existingrequirements.txt, and move to a full pyproject.toml + uv.lock setup once you see the speed difference for yourself. For most teams, that difference alone is the argument.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6870c0ad13e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Scattering process.env Everywhere — Centralize Your Config]]></title>
            <link>https://medium.com/@abdulmoazzam0815/stop-scattering-process-env-everywhere-centralize-your-config-fbfe93ba3986?source=rss-1558384b4060------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbfe93ba3986</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Abdul Moazzim]]></dc:creator>
            <pubDate>Sat, 29 Aug 2026 18:13:10 GMT</pubDate>
            <atom:updated>2026-08-29T18:13:10.266Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Stop Scattering process.env Everywhere — Handle Your Env Variables in One Place</blockquote><p>Alright, quick one today. This is something I picked up while working on a few backend projects and going through some tutorials with other devs, and it genuinely changed how I structure every project now. Sharing it because I think more people should be doing this from day one instead of learning it the hard way (like I did).</p><h3>The problem: process.env sprinkled all over your codebase</h3><p>If you’ve built any Node/Express app, you’ve probably written something like this in your entry file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoZLoZ8JFWWsk_N3aQ92Vw.png" /><figcaption>Code showing process.env accessed directly across an Express app, with inline fallback values for FRONTEND_URL and PORT.</figcaption></figure><p>Looks harmless. But now imagine this same pattern repeated in your db config, your auth middleware, your email service, your payment gateway integration… process.env.SOMETHING showing up in a dozen files, each with its own fallback value, its own typo risk, and zero validation.</p><p>A few pain points this creates:</p><ul><li><strong>No single source of truth.</strong> You don’t know what env vars your app actually needs unless you grep the whole repo.</li><li><strong>Silent failures.</strong> Forget to set API_KEY in production? You won&#39;t find out until something breaks at 2 am, deep inside whatever function happened to use it.</li><li><strong>No type safety.</strong> Everything coming out of process.env is string | undefined. Good luck debugging a config bug six files downstream from where the variable was actually read.</li><li><strong>Fallback values everywhere.</strong> || &quot;http://localhost:5001&quot; scattered across files means your &quot;defaults&quot; are inconsistent and easy to forget when you refactor.</li></ul><h3>The fix: one config file, validated once, at startup</h3><p>The idea is simple — centralize env handling into a single module that:</p><ol><li>Reads process.env</li><li>Validates it against a schema (using something like <strong>Zod</strong> or <strong>Joi</strong> — pick your favorite)</li><li>Fails fast and loud if anything required is missing</li><li>Exports a clean, typed, frozen object for the rest of the app to import</li></ol><p>Here’s roughly what that looks like with Zod:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RRdNP9wQFUaKja2Xkmuczw.png" /><figcaption>Code showing a Zod schema validating required env variables, exiting on failure, and exporting a frozen envs object.</figcaption></figure><p>And now, anywhere else in your app, instead of this:</p><pre>origin: [process.env.FRONTEND_URL || &quot;http://localhost:5001&quot;],</pre><p>You do this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgF4IJWh8bAi-HBj5888AA.png" /><figcaption>Code showing an Express app importing a centralized envs object from a config file instead of using process.env directly.</figcaption></figure><p>That’s it. No more optional chaining guesses, no more inline fallbacks, no more “wait, is this var even required?” moments.</p><h3>Why this is worth doing</h3><ul><li><strong>Fail fast.</strong> If a required env var is missing, your app crashes immediately on boot with a clear error — not three requests into production.</li><li><strong>One place to look.</strong> Need to know every config value your service depends on? Open one file.</li><li><strong>Type safety for free.</strong> With Zod/Joi inferring types, autocomplete just works, and typos get caught at compile time instead of runtime.</li><li><strong>Cleaner, more modular codebase.</strong> Your business logic files stop caring about <em>where</em> config comes from — they import a typed object.</li><li><strong>Easier testing.</strong> Swapping in test config becomes trivial when it’s all funneled through a single module rather than read ad hoc.</li></ul><p>This same pattern works regardless of your stack — Python (Pydantic settings), Go (envconfig / Viper), Java (Spring’s @ConfigurationProperties), whatever. The language and library don&#39;t matter; the principle does: <strong>validate your config once, at the edge, and pass it around as a typed object instead of reaching into the environment from everywhere.</strong></p><h3>This is part of a series</h3><p>I’ve been picking up small, practical patterns like this from tutorials and from working alongside other devs, and I want to start sharing them as I go instead of hoarding them in my notes. This was one of the more useful ones for keeping a codebase modular as it grows.</p><p>If you’ve got a similar tip - something small that made your codebase noticeably cleaner or saved you a debugging headache - drop it in the comments. Would genuinely love to hear what’s worked for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbfe93ba3986" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starting to Write. Badly, At First.]]></title>
            <link>https://medium.com/@abdulmoazzam0815/starting-to-write-badly-at-first-10381643722d?source=rss-1558384b4060------2</link>
            <guid isPermaLink="false">https://medium.com/p/10381643722d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Abdul Moazzim]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 07:18:00 GMT</pubDate>
            <atom:updated>2026-08-16T07:18:00.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Me taking small steps one at a time" src="https://cdn-images-1.medium.com/max/612/1*NnVaUkJPYmf6O6OYwMPfQQ.jpeg" /></figure><p>I’m <a href="https://www.linkedin.com/in/abdulmoazzim/"><strong>Abdul Moazzim</strong></a>, a final-year Computer Systems Engineering student, a MERN stack developer, and someone who’s spent the last while learning a lot of things in private. This blog is me deciding to stop doing that.</p><p>Here’s the honest version of where I’m at: I work as a developer, I’ve interned at a software house, I’m deep in a self-taught roadmap that covers React, TypeScript, SQL, and system design every single day. None of that happened because I had it figured out from day one. It happened in small, repeated sessions — reading docs, breaking things, writing them down so I wouldn’t forget, and doing it again the next day.</p><p>That last part, writing things down, is what this blog actually is.</p><p>I’m not starting this because I’ve mastered something and want to teach it. I’m starting it because I’m <em>in</em> the middle of learning a lot of things at once, and I think the process is more useful to share than the finished, polished version most people only post once they already look like experts. Generics that finally clicked. A useMemo bug that ate an afternoon. Why a stock exchange’s order types matter more than I expected. The stuff that’s actually happening, as it happens.</p><p>So consider this the first entry in a running log, part notes-to-future-me, part maybe-useful-to-someone-else. If you’re also early in your engineering journey, or building something on the side while juggling a degree and a job, I hope some of this ends up useful. And if I get something wrong along the way, that’s kind of the point; this is where I show the work, not just the result.</p><p>Let’s get into it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10381643722d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>