<?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 Hemant Shinde on Medium]]></title>
        <description><![CDATA[Stories by Hemant Shinde on Medium]]></description>
        <link>https://medium.com/@hemantshinde?source=rss-54e97205f041------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Dq4KBUD2DPndsXp4.jpg</url>
            <title>Stories by Hemant Shinde on Medium</title>
            <link>https://medium.com/@hemantshinde?source=rss-54e97205f041------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:02:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hemantshinde/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[Solve Vibe Coding for Legacy Code]]></title>
            <link>https://medium.com/@hemantshinde/solve-vibe-coding-for-legacy-code-b9b7b9a3a02d?source=rss-54e97205f041------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9b7b9a3a02d</guid>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[enterprise-software]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Hemant Shinde]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 07:39:08 GMT</pubDate>
            <atom:updated>2025-10-13T09:11:24.737Z</atom:updated>
            <content:encoded><![CDATA[<p>AI coding assistants like <strong>Cursor</strong>, <strong>GitHub Copilot</strong>, and others have changed how we code.<br> They’re fast, contextual, and eerily good at understanding what we <em>mean</em> — most of the time.</p><p>But when you drop these tools into a <strong>legacy codebase</strong>, the magic fades.<br> They hallucinate, misunderstand intent, or generate incomplete results.<br> Why?</p><p>Because they rely on <em>vibes</em>.<br> And legacy code has… none.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3mn51v90ezDdz-v09bPHw.png" /></figure><h3>🎛️ The Hidden Mechanism Behind Cursor’s “Vibe”</h3><p>Under the hood, Cursor doesn’t just autocomplete — it runs a <strong>Retrieval-Augmented Generation (RAG)</strong> pipeline over your codebase.</p><p>Here’s what happens:</p><ol><li>Cursor <strong>indexes</strong> your entire repo — it creates embeddings (semantic fingerprints) for each file, class, and function.</li><li>When you ask a question (“Where is authentication handled?”), it searches that index to <strong>retrieve</strong> the most relevant snippets.</li><li>It feeds that retrieved context into an LLM (GPT-4, Claude, etc.) to produce an intelligent answer or new code.</li></ol><p>This system works beautifully — <strong>if</strong> your code is clean, well-structured, and semantically rich.<br> But that’s exactly what legacy systems <em>aren’t</em>.</p><h3>💀 Why Legacy Code Breaks the RAG Pipeline</h3><p>Legacy code wasn’t written for search or semantic understanding.<br> It evolved through years of patches, deadlines, and “just make it work” moments.</p><p>The symptoms:</p><ul><li>Vague function names (doWork(), handleData(), fn3()).</li><li>Overloaded files with mixed responsibilities.</li><li>Bloated code files where the code is just dumped</li><li>No docstrings or comments.</li><li>Tight coupling between unrelated modules.</li><li>Inconsistent naming (userData, usr_details, fetch_user, all in one file).</li></ul><p>When Cursor builds its embedding index on such code, it can’t form a coherent map.<br> The retrieval layer returns <strong>irrelevant or partial snippets</strong>, the LLM receives <strong>incomplete context</strong>, and your generated code feels… <em>off</em>.</p><p>That’s why Cursor often shines when you <em>start fresh</em> — it generates code with clear names, logical structures, and meaningful comments.<br> It’s building a <strong>RAG-friendly repo</strong> from day one.</p><h3>🧭 How to Make Code “RAG-Friendly”</h3><p>You don’t need to rewrite everything.<br> You just need to make your code <em>easier for semantic search to understand</em>.<br> Think of it as <strong>optimizing your repo for AI comprehension</strong>.</p><p>Here’s how.</p><h3>0. 🧩 Break Monoliths into Microservices</h3><p>The core issue while applying Vibe coding to legacy code is the context limit. Cursor creates indexes and performs RAG over it, but the gains in productivity drop drastically with codebase size. Monoliths convert the tasks of finding things in the codebase literally as difficult as finding needle in the haystack.</p><p>In my last project we were working on a Monolith that had 128k files. Poor Cursor has context window of only 200k tokens. Before applying AI, it was necessary to cleanup this mess. Keep your repos small, devoid of any clutter, and AI would do wonders.</p><h3>1. 🧩 Measure and Reduce Complexity</h3><p><strong>Tools:</strong> SonarQube, Radon, Code Climate</p><p>High cyclomatic or cognitive complexity means a single function does too many things — and embeddings blur together.<br> Split long methods into smaller, self-contained ones.</p><p><strong>Goal:</strong><br> Keep <strong>cyclomatic complexity &lt; 10</strong> where possible.<br> Each function should express a single, clear intent.</p><h3>2. ✏️ Improve Readability</h3><p><strong>Tools:</strong> Radon, ESLint, CodeFactor</p><p>Readable code = clean embeddings.<br> Readable functions have logical flow, descriptive names, and consistent formatting — all of which make the model “see” meaning clearly.</p><p><strong>Goal:</strong><br> Prefer clarity over cleverness.<br> If a human has to squint, so does the model.</p><h3>3. 📊 Track Maintainability Index (MI)</h3><p><strong>Tools:</strong> Visual Studio Metrics, SonarQube</p><p>The Maintainability Index combines size, complexity, and comment density.<br> A low MI signals dense, hard-to-parse code — which retrieval systems fail to slice meaningfully.</p><p><strong>Goal:</strong><br> Keep <strong>MI &gt; 65</strong> across core modules.<br> If a file feels bloated, refactor it into smaller, domain-focused parts.</p><h3>4. 🔗 Manage Coupling and Cohesion</h3><p><strong>Tools:</strong> CodeMR, JDepend, PyLint</p><p>Highly coupled systems confuse retrieval.<br> When everything depends on everything, the retriever can’t isolate the right slice of context.</p><p><strong>Goal:</strong></p><ul><li>Reduce unnecessary imports and cross-dependencies.</li><li>Group logic by feature, not just technical layer.</li><li>Isolate cross-cutting concerns like logging or auth.</li></ul><h3>5. 💬 Add Docstrings and Type Hints</h3><p><strong>Tools:</strong> Pylint, pydocstyle, TypeScript compiler</p><p>Embeddings love natural language.<br> A short, well-written docstring adds immense semantic clarity.</p><pre>def calculate_invoice_total(invoices: list[Invoice]) -&gt; float:<br>    &quot;&quot;&quot;Compute total billed amount including taxes and discounts.&quot;&quot;&quot;</pre><p><strong>Goal:</strong><br> One sentence of <em>intent</em>, not implementation.</p><h3>6. 🌐 Visualize and Simplify Dependencies</h3><p><strong>Tools:</strong> CodeSee, SourceGraph, Dependency Cruiser</p><p>Tangled dependencies make retrieval ambiguous.<br> AI tools can’t “trace” logic through deep chains.</p><p><strong>Goal:</strong><br> Flatten dependency graphs — 2–3 hops deep at most.</p><h3>📏 Static Analysis as a Semantic Health Check</h3><p>Think of static analyzers as <strong>semantic quality sensors</strong> for RAG systems.<br> Every metric — complexity, readability, maintainability — reflects how clearly your code can be embedded and understood by an AI model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G8eRI1fd2FOhlCAaJv-raw.png" /></figure><h3>⚡ The “Vibe Coding” Rule</h3><p>AI tools like Cursor don’t just parse syntax — they <em>absorb vibes</em>.</p><p>The “vibe” is your code’s <strong>semantic coherence</strong> — how readable, structured, and self-descriptive it feels to both humans and machines.</p><p>If your repo gives off confusion, the embeddings will too.<br> If it radiates clarity, Cursor becomes a genius.</p><h3>🧩 TL;DR</h3><ul><li>Cursor builds a <strong>semantic index</strong> of your codebase.</li><li>Legacy code often lacks structure → retrieval fails → AI output degrades.</li><li>You can fix this by:<br>- Refactoring for readability.<br>- Reducing complexity.<br>- Adding docstrings and type hints.<br>- Managing dependencies.<br>- Tracking metrics like complexity and maintainability.</li></ul><p><strong>RAG-friendly code is human-readable, modular, and semantically rich.</strong><br> Clean code isn’t just for humans anymore — it’s how you teach AI to understand your system’s soul.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9b7b9a3a02d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why healthcare? Why now?]]></title>
            <link>https://medium.com/@hemantshinde/why-healthcare-why-now-c5af457df6d4?source=rss-54e97205f041------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5af457df6d4</guid>
            <category><![CDATA[india]]></category>
            <category><![CDATA[health]]></category>
            <dc:creator><![CDATA[Hemant Shinde]]></dc:creator>
            <pubDate>Sun, 29 Oct 2017 10:54:47 GMT</pubDate>
            <atom:updated>2017-10-29T10:54:47.383Z</atom:updated>
            <content:encoded><![CDATA[<p>I have recently joined a fellowship in IIT Hyderabad for healthcare entrepreneurship. After almost 10 years of service in software Industry, the question is why this sudden change in career?</p><p>The incident that changed my life happened on a Diwali morning in 2015. I was driving with my wife and kid, and hit a truck from back. the accident happened at 9.30 AM in the morning, but by the time our rescuers took us to hospital, it was 11:30 AM, by the time I was in hospital room, it was 1:30.</p><p>You might wonder why it took us 2 hours to reach the hospital? Did people not help us? In fact, we were so fortunate that a person immediately took care of taking me and my wife out of the crashed car. Once he came to know that ambulance would take time, one of the families from close-by village brought their own vehicle for this bleeding stranger and his family. They took us towards Karad, a nearby town, 30 km away from the place.</p><p>In between the road, the ambulance from 108 was already on their way, they reached the toll booth close to Karad and we were transferred to ambulance which had ventilation facilities available.</p><p>My wife was still unconscious with severe head injury and people were not sure whether she had sustained any brain injuries. When we were in the emergency room of the biggest hospital in Karad, the doctor said that they didn’t have neuro surgeon available today and the patients should be shifted somewhere else.</p><p>We were then taken back to Satara, the district level place where the neuro surgeon was available. It was 55 km away from Karad. This journey of 90 KM was the cause of delay in treatment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*d-dOEHwSg7Qxu5PG6JOhjQ.png" /></figure><p>Fortunately, we both were saved. When I got back on my feet after 3 months, I seriously started thinking about the rural healthcare of India. Here I was, hardly 200 km from Pune, and in the case of emergency, with best of the resources, I couldn’t get effective healthcare solution for 2 hours.</p><p>How could a person from rural background, with lesser means expect to get best of the healthcare? How could he survive his low points, his accidents, his emergencies?</p><p>With that thought in mind, I started exploring options for healthcare entry points for people like me. During this time, I came across this fellowship whose aim is to find solutions to Indian healthcare problems.</p><p>I hope that we find a problem worth spending part of our lives on. I hope that we build a solution that will make a small dent in the healthcare problems of those who can’t access best facilities. I hope, and I believe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5af457df6d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a TV show changed the nation!]]></title>
            <link>https://medium.com/@hemantshinde/how-a-serial-offset-the-negatives-of-mr-trump-f08130b98305?source=rss-54e97205f041------2</link>
            <guid isPermaLink="false">https://medium.com/p/f08130b98305</guid>
            <category><![CDATA[2016-election]]></category>
            <category><![CDATA[hillary-clinton]]></category>
            <category><![CDATA[donald-trump]]></category>
            <category><![CDATA[politics]]></category>
            <dc:creator><![CDATA[Hemant Shinde]]></dc:creator>
            <pubDate>Wed, 28 Dec 2016 04:50:15 GMT</pubDate>
            <atom:updated>2017-01-07T21:09:35.298Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday, I read an article regarding the impact of the sitcom ‘Friends’ on the American culture. I mostly disagreed with it, but it triggered a thought on what if a popular serial could change the mindset of the people?</p><blockquote>Can serials change the course of a nation?</blockquote><p>To answer this question, we need to understand the circumstances which led to the 2016 election. There were two flawed candidates with high negative ratings. But why? Why were they flawed? Why were they having negative ratings?</p><p>For Trump, it was very clear from the beginning. His presidential campaign was all about one provocative statement after another. When you generalise ethnic groups with rapists and murderers, you are not making any new friends in those groups. Taking a hardliner stand on Islam was not going to endear him. Nor does it help when you are a known womaniser showing no respect for women in general and publicly obsessed with their physical appearance. All these qualities are quintessentially non-presidential.</p><p>How does a woman, with huge experience in politics, public policy and with a model family of 2+1 gets so much hate?</p><blockquote>The answer partly lies with House of Cards.</blockquote><p>People are often unaware of dirty underbelly of politics where the politicians have to pull all the tricks in the cards to remain in power all the while keeping a pretty, likeable face. No war was ever started to get the oil, it would always start to restore peace and people would buy it in normal circumstances. The media is usually hand-in-glove with the politicians and nobody really cares to look up the facts.</p><p>The same dirty underbelly of Clinton family was hidden well under the covers for the long time. People had forgotten the wife who supported the husband when he was charged with sexual abuse of an intern.</p><p>The house of cards rekindled those memories for the people who could remember it. Who would you compare the first family from house of cards? The Obamas? The Bushes? or The Clintons?</p><blockquote>“As to the political leanings of the tweeters, 17.19% are identified as being interested in democrat politics, 7.88% are interested in republican politics, and 2.76% are interested in libertarian issues. So it seems that democrats are generally more interested in the show than other parties.” (ref: <a href="http://www.medialifemagazine.com/whos-watching-house-of-cards-anyway/">here</a>)</blockquote><p>Clinton family seemed very apt for comparison and it often got compared even by the show-runners like <a href="https://www.buzzfeed.com/jimwaterson/you-might-think-that-but-we-couldnt-possibly-comment?utm_term=.voD4YLojp#.ceAB5y7pz">here</a>, <a href="http://newhampshirereview.com/hillary-clinton/house-of-cards-based-on-hillary-clinton-scandals/">here</a>, <a href="http://www.vox.com/2016/3/9/11184618/house-of-cards-review-netflix-season-4-clintons">here</a> and <a href="http://www.businessinsider.com/bill-clinton-says-house-of-cards-is-99-percent-real-2015-3">here</a>.</p><p>Claire is cold hearted ambitious woman. All of Hillary Clinton’s past decisions could be seen from this angle and it casts large shadow of doubt on most of her work. It fuels conspiracy on its own. Why would an independent, self respecting woman would live with a person who has been accused of multiple sexual harassment cases?</p><blockquote>Hillary would choose to ignore the morals for her gain.</blockquote><p>This was an important lesson derived from the comparison with Underwoods. From the lenses of Underwood family, the email scandal looks much bigger than what it is, Benghazi attack, Clinton foundation, her links with Saudis and middle eastern Royals, every shadow of doubt seems true and the available facts appear like to tip of an iceberg.</p><blockquote>Seeing is believing!</blockquote><p>I believe that in the absence of House of Cards, people would have been hard pressed to imagine such a nice lady who almost looks like your average grandma, talks decently, loves everybody, and seems to have made some mistakes with technology like every senior citizen as an evil monster with a cunning plan.</p><p>People of America watched a First Lady who is part of the conspiracies in a serial. They could easily map those to the one readily available for comparison and the one who was being accused of some. They could see the making of Mr. Underwood in Mr. Trump, thus levelling the field for him.</p><p>It’s up for debate whether the accusations are real or not, but the fact remains that people connected the dots and a serial may have just turned the page of history by turning this nail-biter towards Mr. Trump by levelling the field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f08130b98305" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>