<?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 Yaathavarajan Krishnarajah on Medium]]></title>
        <description><![CDATA[Stories by Yaathavarajan Krishnarajah on Medium]]></description>
        <link>https://medium.com/@yathavarajan?source=rss-67342b507b3f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ccCtBm2fap5DSsvbIFOvOQ.jpeg</url>
            <title>Stories by Yaathavarajan Krishnarajah on Medium</title>
            <link>https://medium.com/@yathavarajan?source=rss-67342b507b3f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:42:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yathavarajan/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[C# 15 Introduces Union Types and Closed Hierarchies: A New Era of Type Safety]]></title>
            <link>https://medium.com/@yathavarajan/c-15-introduces-union-types-and-closed-hierarchies-a-new-era-of-type-safety-2f0ca7efe264?source=rss-67342b507b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f0ca7efe264</guid>
            <category><![CDATA[dotnet-core]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[dot-net-developers]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[csharp]]></category>
            <dc:creator><![CDATA[Yaathavarajan Krishnarajah]]></dc:creator>
            <pubDate>Sat, 28 Nov 2026 05:26:42 GMT</pubDate>
            <atom:updated>2026-11-28T05:26:42.650Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2lwVpG9weAQ5z5Kc" /></figure><p>For years, C# developers have used interfaces, abstract classes, inheritance, and third-party libraries to represent values that can have multiple possible types.</p><p>Although these approaches work, they have one important limitation: <strong>the compiler cannot always know every possible type a value can represent.</strong></p><p>Consider a method that returns either a successful result or an error. Or an API that can return a customer, a product, or a validation failure.</p><p>Traditionally, developers would use object, interfaces, abstract classes, or custom wrapper types to represent these scenarios.</p><p>C# 15 introduces two interesting language features that improve how we model these situations:</p><ul><li><strong>Union Types</strong> — Allow a value to represent one of a predefined set of types.</li><li><strong>Closed Hierarchies</strong> — Restrict class inheritance to a known set of direct descendants within the declaring assembly.</li></ul><p>Both features bring stronger type safety and exhaustive pattern matching into everyday C# development.</p><p>Let’s explore what they offer and why they matter.</p><h3>1. The Problem with Traditional C# Approaches</h3><p>Before exploring the new features, let’s understand the problem.</p><p>Imagine we are developing an application that processes different types of notifications.</p><p>A notification could be an email, an SMS, or a push notification.</p><p>We might start with an interface:</p><pre>public interface INotification;<br><br>public record EmailNotification(string Email)<br>    : INotification;<br>public record SmsNotification(string PhoneNumber)<br>    : INotification;<br>public record PushNotification(string DeviceId)<br>    : INotification;</pre><p>We can use the interface as a common return type:</p><pre>public INotification GetNotification()<br>{<br>    return new EmailNotification(&quot;user@example.com&quot;);<br>}</pre><p>This works perfectly well.</p><p>However, what happens when we process the notification?</p><pre>public string ProcessNotification(<br>    INotification notification)<br>{<br>    return notification switch<br>    {<br>        EmailNotification email =&gt;<br>            $&quot;Sending email to {email.Email}&quot;,<br><br>        SmsNotification sms =&gt;<br>            $&quot;Sending SMS to {sms.PhoneNumber}&quot;,<br><br>        PushNotification push =&gt;<br>            $&quot;Sending push notification to {push.DeviceId}&quot;,<br><br>        _ =&gt; &quot;Unknown notification&quot;<br>    };<br>}</pre><p>Notice the discard pattern (_).</p><p>Why do we need it?</p><p>Because an interface is open for implementation. Another developer can introduce a new notification type in another assembly.</p><p>The compiler cannot guarantee that we have handled every possible implementation.</p><p>Even if we control all the existing implementations, the compiler doesn’t know that the list is complete.</p><p>This is where C# 15 starts making a difference.</p><h3>2. Union Types in C# 15</h3><p>Union Types allow us to define a type that can hold exactly one value from a predefined set of types.</p><p>Unlike interfaces or abstract classes, the possible case types are explicitly declared.</p><p>Let’s revisit our notification example.</p><h4>Declaring a Union Type</h4><pre>public record EmailNotification(string Email);<br><br>public record SmsNotification(string PhoneNumber);<br><br>public record PushNotification(string DeviceId);<br><br>public union Notification(<br>    EmailNotification,<br>    SmsNotification,<br>    PushNotification<br>);</pre><p>That’s it!</p><p>The union keyword declares a new type that can represent an email, SMS, or push notification.</p><p>We don’t need a common interface or inheritance relationship between these types.</p><h4>Creating Union Values</h4><p>C# provides implicit conversions from each declared case type to the union type.</p><pre>Notification notification =<br>    new EmailNotification(&quot;user@example.com&quot;);</pre><p>We can also assign other supported types:</p><pre>Notification notification =<br>    new SmsNotification(&quot;+94771234567&quot;);</pre><p>Or:</p><pre>Notification notification =<br>    new PushNotification(&quot;device-123&quot;);</pre><p>The compiler ensures that only the declared case types can be converted into this union.</p><h4>Exhaustive Pattern Matching</h4><p>Now comes the interesting part.</p><p>We can process the notification using a switch expression:</p><pre>public string ProcessNotification(<br>    Notification notification)<br>{<br>    return notification switch<br>    {<br>        EmailNotification email =&gt;<br>            $&quot;Sending email to {email.Email}&quot;,<br><br>        SmsNotification sms =&gt;<br>            $&quot;Sending SMS to {sms.PhoneNumber}&quot;,<br><br>        PushNotification push =&gt;<br>            $&quot;Sending push notification to {push.DeviceId}&quot;<br>    };<br>}</pre><p>Notice something important.</p><p><strong>There is no default (</strong><strong>_) case!</strong></p><p>The compiler knows the complete set of possible types in the union and can verify that every case has been handled.</p><p>If we introduce another case into the union, the compiler can identify switch expressions that need updating.</p><p>This is one of the biggest advantages of union types: the compiler becomes an active participant in maintaining our business logic.</p><h3>3. Closed Hierarchies in C# 15</h3><p>Union types are useful when we want to combine existing types, even when they are unrelated.</p><p>But what if our types naturally belong to an inheritance hierarchy?</p><p>This is where Closed Hierarchies come in.</p><p>C# 15 introduces the closed modifier for classes.</p><p>A closed class restricts its direct derived classes to the same assembly in which the closed class is declared.</p><p>Let’s consider an order processing system.</p><p>An order can be in one of four states:</p><ul><li>Pending</li><li>Processing</li><li>Completed</li><li>Cancelled</li></ul><p>We can model these states using a closed hierarchy.</p><h4>Declaring a Closed Hierarchy</h4><pre>public closed record class OrderStatus;<br><br>public record class Pending : OrderStatus;<br><br>public record class Processing(int Progress)<br>    : OrderStatus;<br><br>public record class Completed(DateTime CompletedAt)<br>    : OrderStatus;<br><br>public record class Cancelled(string Reason)<br>    : OrderStatus;</pre><p>Here, OrderStatus is a closed class.</p><p>The compiler knows that its direct derived types are declared within the same assembly.</p><p>We cannot introduce another direct derived class in a different assembly.</p><p>For example, this declaration in another assembly would produce a compiler error:</p><pre>public record class Failed : OrderStatus;</pre><h4>Exhaustive Pattern Matching with Closed Hierarchies</h4><p>Now let’s process an order status:</p><pre>public string GetOrderDescription(<br>    OrderStatus status)<br>{<br>    return status switch<br>    {<br>        Pending =&gt;<br>            &quot;Order is waiting for processing&quot;,<br><br>        Processing(var progress) =&gt;<br>            $&quot;Order processing: {progress}%&quot;,<br><br>        Completed(var completedAt) =&gt;<br>            $&quot;Completed at {completedAt}&quot;,<br><br>        Cancelled(var reason) =&gt;<br>            $&quot;Cancelled: {reason}&quot;<br>    };<br>}</pre><p>Again, there is no need for a default case.</p><p>Because the compiler knows all the direct descendants of OrderStatus, it can determine whether our switch expression handles every possibility.</p><p>If we introduce another direct descendant, the compiler can identify switch expressions that need to be updated.</p><p>One important detail: closed hierarchies are not automatically transitive. If a derived class is not itself declared closed or sealed, it can still be extended elsewhere. To maintain exhaustiveness throughout a deeper hierarchy, intermediate classes must also be closed or sealed.</p><h3>4. Union Types vs. Closed Hierarchies</h3><p>Both features provide exhaustive pattern matching, but they solve slightly different problems.</p><p>Although they may look similar at first, their primary purposes are different.</p><h4>Union Types</h4><p>Union Types allow us to combine multiple types into a single type without requiring those types to share an inheritance relationship.</p><p>Key characteristics:</p><ul><li>Uses the union keyword.</li><li>Does not require inheritance.</li><li>Can combine unrelated types.</li><li>Explicitly defines all possible types a value can represent.</li><li>Supports exhaustive pattern matching.</li></ul><p><strong>When should you use it?</strong></p><p>Use Union Types when a value can represent one of several distinct possibilities, such as API responses, payment results, validation outcomes, or notification types.</p><h4>Closed Hierarchies</h4><p>Closed Hierarchies allow us to define a controlled inheritance structure where the compiler knows the permitted direct derived classes.</p><p>Key characteristics:</p><ul><li>Uses the closed modifier.</li><li>Requires an inheritance relationship.</li><li>Restricts direct derived classes to the declaring assembly.</li><li>Allows the compiler to reason about the known inheritance hierarchy.</li><li>Supports exhaustive pattern matching when the hierarchy is fully closed.</li></ul><p><strong>When should you use it?</strong></p><p>Use Closed Hierarchies when modeling a controlled set of related types, such as order statuses, workflow states, document lifecycles, or transaction states.</p><h4>The Key Difference</h4><p>Think about it this way:</p><ul><li><strong>Union Types</strong> answer: “What are all the possible types this value can represent?”</li><li><strong>Closed Hierarchies</strong> answer: “What are all the permitted derived types in this inheritance hierarchy?”</li></ul><p>Both approaches improve type safety, but the right choice depends on how your domain is modeled.</p><h3>5. Where Can We Use These Features?</h3><p>These features are particularly interesting for application and API design.</p><p>Here are a few practical scenarios.</p><h4>A. API Response Models</h4><p>An API endpoint might return a successful response, a validation failure, or a resource-not-found result.</p><p>Instead of returning object or relying on loosely defined response structures, we can represent the possible outcomes using a union.</p><pre>public record SuccessResponse(string Data);<br><br>public record ValidationError(string Message);<br><br>public record NotFoundError(string Resource);<br><br>public union ApiResult(<br>    SuccessResponse,<br>    ValidationError,<br>    NotFoundError<br>);</pre><p>The consuming code can then handle every possible result explicitly.</p><h4>B. Payment Processing</h4><p>A payment operation might result in:</p><ul><li>Payment successful</li><li>Payment declined</li><li>Insufficient funds</li><li>Payment pending</li></ul><p>These outcomes can be represented using a union type, making the possible results explicit.</p><h4>C. Workflow and State Management</h4><p>Closed hierarchies are useful for modeling workflows where the states are controlled by the application.</p><p>Examples include:</p><ul><li>Order processing</li><li>Background job execution</li><li>Document approval workflows</li><li>User account states</li><li>Transaction lifecycle management</li></ul><p>The compiler can help identify missing cases when the state model changes.</p><h3>6. Are Union Types a Replacement for Interfaces and Abstract Classes?</h3><p>Not at all.</p><p>These features solve different design problems.</p><p>Interfaces remain useful when we want to define shared behavior and allow multiple implementations.</p><p>Abstract classes remain useful when we want shared implementation, state, and inheritance.</p><p>Union types are useful when we want to explicitly define the possible types a value can represent.</p><p>Closed hierarchies are useful when we want to control inheritance and make the hierarchy known to the compiler.</p><p>The important thing is choosing the right abstraction for the problem.</p><h3>7. Final Thoughts</h3><p>C# 15’s Union Types and Closed Hierarchies are meaningful additions to the language.</p><p>They improve how developers model business concepts, represent multiple possible outcomes, and handle state transitions.</p><p>More importantly, they reduce the need for defensive default cases when the possible types are known.</p><p>For me, the biggest benefit is not simply writing less code. It is making our intentions explicit in the type system and allowing the compiler to help us maintain correctness as applications evolve.</p><p>As C# continues to evolve, features like these make strongly typed application design even more expressive.</p><p><strong>What do you think? Will you start using Union Types in your next .NET project?</strong></p><h3>References and Further Reading</h3><ol><li><a href="https://learn.microsoft.com/dotnet/csharp/whats-new/csharp-15/">What’s New in C# 15 — Microsoft Learn</a></li><li><a href="https://devblogs.microsoft.com/dotnet/csharp-15-union-types/">Explore Union Types in C# 15 — .NET Blog</a></li><li><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/proposals/csharp-15.0/unions">Union Types — C# Language Specification</a></li><li><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/proposals/csharp-15.0/closed-hierarchies">Closed Hierarchies — C# Language Specification</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f0ca7efe264" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kiro Agentic AI: A Simple Introduction to the Future of Coding]]></title>
            <link>https://medium.com/@yathavarajan/kiro-agentic-ai-a-simple-introduction-to-the-future-of-coding-ca3d220e9c0b?source=rss-67342b507b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca3d220e9c0b</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[future-of-coding]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[kiro]]></category>
            <dc:creator><![CDATA[Yaathavarajan Krishnarajah]]></dc:creator>
            <pubDate>Mon, 26 Jan 2026 03:06:45 GMT</pubDate>
            <atom:updated>2026-01-26T03:06:45.624Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*nI-CNWy05GU6_h4woLCzUg.jpeg" /></figure><p>Artificial Intelligence has already changed how we write code. Tools like GitHub Copilot help us autocomplete lines, fix syntax, and save time. But modern software development is much more than typing code.</p><p>What if an AI could <strong>understand your idea</strong>, <strong>plan the work</strong>, <strong>write the code</strong>, <strong>update tests</strong>, and <strong>keep everything organized</strong>?</p><p>That’s exactly what <strong>Kiro Agentic AI</strong> is trying to do.</p><h3>What Is Kiro Agentic AI?</h3><p>Kiro is an <strong>AI-powered development environment</strong> designed around the idea of <em>agentic AI</em>.</p><p>Instead of behaving like a simple chatbot or autocomplete tool, Kiro works more like a <strong>software assistant that can think in steps</strong>:</p><ul><li>Understand your requirement</li><li>Create a clear plan (specification)</li><li>Break work into tasks</li><li>Execute changes across the codebase</li><li>Ask for your approval when needed</li></ul><p>You don’t just tell Kiro <em>what to code</em> — you tell it <em>what you want to build</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*kU_zYnuQUKk1gM0GIoPqEQ.jpeg" /></figure><h3>From “Vibe Coding” to Spec-First Development</h3><p>Many developers today use AI in a fast but messy way — typing prompts like:</p><blockquote><em>“Add login feature”<br> “Fix this bug”</em></blockquote><p>This often works, but it can create:</p><ul><li>Inconsistent code</li><li>Missing tests</li><li>Poor documentation</li><li>Confusion later</li></ul><p>Kiro introduces <strong>spec-first development</strong>.</p><p>You describe your requirement in plain English, and Kiro generates:</p><ul><li>A clear specification</li><li>Acceptance criteria</li><li>Task breakdown</li></ul><p>This spec lives <strong>alongside your code</strong>, so everyone (humans and AI) knows what the system is supposed to do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*25UsvcIWftK97qXAXHe_ww.jpeg" /></figure><h3>How Kiro Works Like an AI Agent</h3><p>Kiro doesn’t stop after writing one file.</p><p>Once a spec is approved, it can:</p><ul><li>Modify multiple files</li><li>Add or update tests</li><li>Refactor existing code</li><li>Update documentation</li><li>Maintain project standards</li></ul><p>You can:</p><ul><li>Run it step-by-step, or</li><li>Let it work autonomously with checkpoints</li></ul><p>Think of it as a <strong>junior developer who never gets tired</strong>, but still asks for confirmation before doing risky changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*Fufofd8fwx47o9n3qwal2A.jpeg" /></figure><h3>Automation with Agent Hooks</h3><p>Kiro also supports something called <strong>agent hooks</strong>.</p><p>These are automatic actions triggered by events like:</p><ul><li>Saving a file</li><li>Making a commit</li><li>Opening a pull request</li></ul><p>For example:</p><ul><li>Auto-generate tests when code changes</li><li>Update documentation automatically</li><li>Run security or quality checks</li></ul><p>This reduces repetitive work and keeps projects clean without extra effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*wIpn7cZvPmFKOCxvg4tHXw.jpeg" /></figure><h3>Why Developers Are Excited About Kiro</h3><p>Kiro gained attention very quickly because it solves real pain points:</p><ul><li>Large codebases</li><li>Complex refactoring</li><li>Keeping code, tests, and docs in sync</li><li>Reducing mental load on developers</li></ul><p>Instead of fighting tools, developers can <strong>focus on thinking and design</strong>, while Kiro handles execution.</p><p>This is especially powerful for:</p><ul><li>Startups</li><li>Enterprise teams</li><li>Solo developers building big systems</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*4tdzVO0HJl93b_pivP3xHg.jpeg" /></figure><h3>What “Agentic AI” Really Means</h3><p>Agentic AI is not just about answering questions.</p><p>It means AI that can:</p><ul><li>Remember context</li><li>Plan multiple steps</li><li>Act independently</li><li>Collaborate with humans</li></ul><p>Kiro is part of a larger shift where AI becomes a <strong>partner in building software</strong>, not just a helper on the side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*KkHFDlj1gJc0Vi4UxAK_DA.jpeg" /></figure><h3>Final Thoughts</h3><p>Kiro Agentic AI represents a new way of developing software:</p><ul><li>Less chaos</li><li>More structure</li><li>Clear intent</li><li>Better collaboration between humans and AI</li></ul><p>It’s not about replacing developers — it’s about <strong>helping developers build better software with less stress</strong>.</p><p>As agentic AI tools evolve, Kiro shows us what the future of coding might look like:<br> <strong>intent-driven, structured, and intelligently automated.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca3d220e9c0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Deep Dive into Visual Studio 2026]]></title>
            <link>https://medium.com/@yathavarajan/a-deep-dive-into-visual-studio-2026-e9f43fcff892?source=rss-67342b507b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9f43fcff892</guid>
            <dc:creator><![CDATA[Yaathavarajan Krishnarajah]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 00:59:49 GMT</pubDate>
            <atom:updated>2025-11-14T00:59:49.218Z</atom:updated>
            <content:encoded><![CDATA[<p>Visual Studio has long been one of the most popular integrated development environments (IDEs) for developers worldwide. With the release of <strong>Visual Studio 2026 (VS 2026)</strong>, Microsoft aims to redefine how developers code, debug, and collaborate. In this article, we’ll explore what’s new, why it matters, and what to consider before upgrading.</p><h3>What’s New in Visual Studio 2026</h3><h3>AI-Powered Development</h3><p>VS 2026 is being marketed as an “AI-native IDE.” Microsoft has integrated advanced AI features directly into the development workflow:</p><ul><li><strong>AI-assisted coding:</strong> Suggestions and completions go beyond traditional IntelliSense, adapting to your coding style.</li><li><strong>Profiler Agent:</strong> Highlights performance bottlenecks, helping you optimize your code faster.</li><li><strong>Enhanced search:</strong> The IDE now offers smart “Did You Mean?” search and contextual suggestions across files.</li></ul><p><strong>Why it matters:</strong> These AI tools help reduce repetitive tasks and keep developers focused on building features rather than troubleshooting or navigating code.</p><h3>Performance and Productivity Improvements</h3><ul><li><strong>Faster solution load times</strong> and reduced UI hang times make working with large projects smoother.</li><li><strong>Improved debugging experience:</strong> Inline results and faster F5 workflow keep developers productive.</li><li><strong>Modern language support:</strong> Latest versions of C#, C++, and TypeScript are fully supported, with improved compilation speed.</li></ul><p><strong>Why it matters:</strong> Faster builds, quicker navigation, and reduced lag can save hours over the lifetime of a project, especially in large-scale applications.</p><h3>UI/UX Enhancements</h3><ul><li><strong>Refreshed interface:</strong> New Fluent UI design, updated icons, and cleaner dialogs improve accessibility and readability.</li><li><strong>Customizable themes:</strong> VS 2026 offers multiple new themes for personalizing your workspace.</li><li><strong>Decoupled installer:</strong> IDE upgrades are separated from build tools, reducing disruption to ongoing projects.</li></ul><p><strong>Why it matters:</strong> A modern, clean interface reduces cognitive load and allows developers to focus on their work. The decoupled installer also makes updates less risky.</p><h3>Expanded Language and Platform Support</h3><ul><li><strong>Full support</strong> for the latest C# and C++ standards.</li><li><strong>ARM64 and cross-platform improvements</strong> allow developers to target multiple devices and architectures efficiently.</li><li><strong>TypeScript and web development updates</strong> enable faster compilation and better debugging for modern web projects.</li></ul><p><strong>Why it matters:</strong> VS 2026 prepares developers for the future, supporting the latest programming standards and enabling work across multiple platforms.</p><h3>Inclusive Tooling</h3><ul><li><strong>Code coverage and profiling tools</strong> are now more widely available across different editions of Visual Studio.</li><li><strong>Extension compatibility</strong>: Most extensions from VS 2022 work seamlessly with VS 2026, making it easier to transition.</li></ul><p><strong>Why it matters:</strong> More developers can access powerful tools without relying on enterprise-only features, enhancing productivity across teams of any size.</p><h3>Considerations Before Upgrading</h3><ul><li><strong>Compatibility:</strong> Test extensions and existing projects in VS 2026 to ensure workflows are unaffected.</li><li><strong>System Requirements:</strong> Large-scale projects may require higher RAM and CPU specifications to achieve maximum performance.</li><li><strong>Learning Curve:</strong> The UI refresh and AI features may require adjustment for developers used to older versions.</li></ul><p>A side-by-side installation with your current IDE version is a safe way to test VS 2026 without disrupting ongoing projects.</p><h3>Final Verdict</h3><p>Visual Studio 2026 represents a <strong>significant leap forward</strong> for developers. With AI-powered features, performance improvements, modern UI, and broad language support, it aims to boost productivity and streamline development workflows.</p><p>For developers worldwide, VS 2026 isn’t just a version upgrade — it’s an opportunity to experience coding with smarter tools, faster workflows, and a more modern interface.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9f43fcff892" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Discriminated Unions in C# 14: Modeling Data the Smarter Way]]></title>
            <link>https://medium.com/@yathavarajan/discriminated-unions-in-c-14-modeling-data-the-smarter-way-6390e3d411c6?source=rss-67342b507b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6390e3d411c6</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[c14]]></category>
            <category><![CDATA[discriminated-union]]></category>
            <dc:creator><![CDATA[Yaathavarajan Krishnarajah]]></dc:creator>
            <pubDate>Mon, 05 May 2025 07:31:15 GMT</pubDate>
            <atom:updated>2025-11-13T12:03:51.343Z</atom:updated>
            <content:encoded><![CDATA[<p>Discriminated Unions — <strong>a long-requested feature — are finally coming to C#</strong> in version 14.</p><p><strong>Update (Nov 2025)</strong>:</p><p>As of now, they are still in the <strong>proposal stage</strong> and are not available in any released or public preview version of C#.<br> The example syntax in this article is based on the proposal and is meant for illustrative purposes only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HgF1NQG55_DSw9BMuYhnXA.png" /></figure><p>This powerful concept, borrowed from functional programming languages like F#, Rust, and Swift, enables developers to model data that can take <strong>one of several distinct and well-defined shapes</strong> — all in a safe, expressive, and concise way.</p><p>In this article, we’ll explore what Discriminated Unions are, why they matter, how they work in the preview, and how you can benefit from them even before full release.</p><h3>🤔 What Are Discriminated Unions?</h3><p>A <strong>Discriminated Union</strong> is a data structure that can hold <strong>one of several named cases</strong>, where each case can optionally carry its own specific data. Think of it like an enum on steroids—each &quot;variant&quot; can carry data relevant only to that case.</p><p>For example, if you’re modeling shapes:</p><pre>public union Shape<br>{<br>    case Circle(double Radius);<br>    case Rectangle(double Width, double Height);<br>    case Triangle(double Base, double Height);<br>}</pre><p>Here, Shape can be either a Circle, a Rectangle, or a Triangle, each with its own set of properties. The compiler knows all valid cases and can help you write safe and exhaustive logic when working with them.</p><h3>💡 Why Are They Useful?</h3><p>Imagine you’re dealing with API responses. You could have:</p><pre>public union ApiResponse<br>{<br>    case Success(string Message);<br>    case NotFound();<br>    case Error(string ErrorMessage);<br>}</pre><p>When processing this result, the C# compiler will force you to handle all defined cases, eliminating runtime surprises:</p><pre>string result = response switch<br>{<br>    ApiResponse.Success s =&gt; $&quot;Success: {s.Message}&quot;,<br>    ApiResponse.NotFound =&gt; &quot;Not Found&quot;,<br>    ApiResponse.Error e =&gt; $&quot;Error: {e.ErrorMessage}&quot;<br>};</pre><p>This is more powerful and safer than using inheritance, object, or even enum + switch.</p><h3>🚧 How We’ve Done It Until Now</h3><p>Before native support, C# developers had to simulate Discriminated Unions using inheritance and pattern matching:</p><pre>public abstract record Shape;<br>public record Circle(double Radius) : Shape;<br>public record Rectangle(double Width, double Height) : Shape;<br>public record Triangle(double Base, double Height) : Shape;<br><br>Shape shape = new Circle(5);<br><br>double area = shape switch<br>{<br>    Circle c =&gt; Math.PI * c.Radius * c.Radius,<br>    Rectangle r =&gt; r.Width * r.Height,<br>    Triangle t =&gt; 0.5 * t.Base * t.Height,<br>    _ =&gt; throw new NotImplementedException()<br>};</pre><p>While this works, it’s verbose and doesn’t enforce exhaustiveness checks by default — leaving room for subtle bugs.</p><h3>🚀 What’s New in the Preview?</h3><p>The C# 14 preview introduces a new union keyword and case syntax:</p><pre>public union Shape<br>{<br>    case Circle(double Radius);<br>    case Rectangle(double Width, double Height);<br>    case Triangle(double Base, double Height);<br>}</pre><p>Key features:</p><ul><li>✅ <strong>Exhaustive pattern matching</strong></li><li>✅ <strong>Cleaner syntax</strong> for variant data</li><li>✅ <strong>First-class compiler support</strong></li><li>✅ <strong>Improved modeling over inheritance and enum hacks</strong></li></ul><p>Note: As of May 2025, this feature is <strong>still in preview</strong> and not yet finalized in the stable C# release.</p><h3>⚖️ DUs vs Other Modeling Techniques</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*9HhTaWGjwQlar3leIpT0VQ.png" /></figure><h3>🔭 Looking Forward</h3><p>Discriminated Unions bring a much-needed boost to C#’s modeling capabilities. Whether you’re building compilers, APIs, domain models, or UI states, DUs allow you to describe your data <em>as it truly is</em> — not as a workaround.</p><p>This move further blurs the line between object-oriented and functional paradigms in C#, giving developers more power and clarity with less code.</p><h3>🧪 Try It Yourself</h3><p>As of writing, you can try Discriminated Unions in experimental builds or use pattern-matching records in .NET 6–8 as a stepping stone.</p><p>Want to play with real examples in C# today? You can simulate DUs with records and sealed hierarchies, gaining most of the benefits right now.</p><h3>📚 Resources</h3><ul><li><a href="https://github.com/dotnet/csharplang/discussions/2962">GitHub Proposal for Discriminated Unions</a></li><li><a href="https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching">Pattern Matching in C#</a></li><li><a href="https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/discriminated-unions">F# Discriminated Unions</a></li></ul><p><em>Discriminated Unions are not just a nice-to-have — they’re a leap forward in modeling real-world data with safety, elegance, and power. C# is evolving, and this is one upgrade that’s hard to ignore.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6390e3d411c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vibe Coding: The AI-Driven Future of Programming]]></title>
            <link>https://medium.com/@yathavarajan/vibe-coding-the-ai-driven-future-of-programming-4d810a53a0df?source=rss-67342b507b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d810a53a0df</guid>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[ai-driven-solutions]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[future-of-programming]]></category>
            <dc:creator><![CDATA[Yaathavarajan Krishnarajah]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 13:07:34 GMT</pubDate>
            <atom:updated>2025-04-02T13:07:34.575Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>The landscape of software development is evolving rapidly with the advent of artificial intelligence. A new trend, known as <strong>Vibe Coding</strong>, is emerging, where AI-assisted programming shifts the role of developers from manual coding to guiding, testing, and refining AI-generated source code.</p><h3>What is Vibe Coding?</h3><p>Vibe Coding (also referred to as <strong>vibecoding</strong>) is an AI-dependent programming technique where a developer provides a brief problem description or prompt to a large language model (LLM) optimized for coding. The AI then generates code, significantly altering the traditional coding workflow.</p><h3>Key Aspects of Vibe Coding:</h3><ol><li><strong>AI-Assisted Development</strong>: Large language models (LLMs) generate code based on natural language prompts, reducing the need for extensive manual coding.</li><li><strong>Developer as a Guide</strong>: Instead of writing every line of code, programmers now focus on prompt engineering, testing, and refining AI-generated solutions.</li><li><strong>Faster Prototyping</strong>: AI can generate functional prototypes in minutes, accelerating software development cycles.</li><li><strong>Lower Barrier to Entry</strong>: Even those without deep coding expertise can leverage AI tools to create functional software.</li><li><strong>Collaborative AI</strong>: Developers and AI models work together to iterate on code, enhancing creativity and efficiency.</li></ol><h3>How to Get Started with Vibe Coding</h3><ol><li><strong>Learn Prompt Engineering</strong> — Effective prompts lead to better AI-generated code. Understanding how to phrase problems clearly is key.</li><li><strong>Use AI Coding Assistants</strong> — Tools like GitHub Copilot, ChatGPT, and OpenAI Codex help generate and refine code.</li><li><strong>Validate AI-Generated Code</strong> — AI suggestions must be tested and optimized for performance, security, and maintainability.</li><li><strong>Refine and Iterate</strong> — AI provides a starting point, but human intervention is crucial for crafting high-quality, production-ready software.</li><li><strong>Enhance Creativity with AI</strong> — Use AI for brainstorming new approaches rather than just solving routine problems.</li></ol><h3>Why Vibe Coding Matters</h3><ul><li><strong>Boosts Productivity</strong> by reducing repetitive coding tasks.</li><li><strong>Democratizes Software Development</strong>, allowing more people to build applications without extensive training.</li><li><strong>Accelerates Innovation</strong> through rapid prototyping and AI-generated optimizations.</li><li><strong>Transforms the Developer’s Role</strong>, shifting focus from manual coding to strategic problem-solving and system design.</li></ul><h3>Possible Cons of Vibe Coding:</h3><ol><li><strong>Dependency on AI</strong>: Over-reliance on AI-generated code may lead to a reduced ability for developers to write code independently or problem-solve on their own.</li><li><strong>Quality Control</strong>: AI-generated code may not always follow best practices or meet performance and security standards, requiring careful testing and optimization.</li><li><strong>Loss of Skill Development</strong>: Relying too heavily on AI tools can hinder the development of fundamental coding skills, especially for beginners.</li><li><strong>Ethical Concerns</strong>: Issues related to copyright, intellectual property, and the potential impact of AI on human jobs have emerged as AI begins generating more code.</li><li><strong>Contextual Misunderstandings</strong>: AI models may struggle to fully understand complex requirements, leading to misaligned code or solutions that don’t completely address the user’s needs.</li></ol><h3>Conclusion</h3><p><strong>Vibe Coding</strong> represents a paradigm shift in programming, where AI plays a central role in software creation. By leveraging AI tools, developers can focus on higher-level problem-solving, creativity, and optimization rather than writing code from scratch. This approach is making coding more accessible and efficient, ushering in a new era of AI-driven software development.</p><p>However, as with any technological shift, there are challenges. While Vibe Coding democratizes development and accelerates innovation, it also comes with concerns such as dependency on AI, potential quality control issues, and ethical considerations around job displacement. Balancing the benefits of AI-driven coding with careful oversight and skill development will be key to ensuring that the future of programming is both innovative and sustainable.</p><p>Are you ready to embrace the future of coding? The <strong>vibe</strong> is here, and it’s powered by AI!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d810a53a0df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install and uninstall Windows services]]></title>
            <link>https://medium.com/@yathavarajan/install-and-uninstall-windows-services-60ccf56287fa?source=rss-67342b507b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/60ccf56287fa</guid>
            <dc:creator><![CDATA[Yaathavarajan Krishnarajah]]></dc:creator>
            <pubDate>Tue, 18 Mar 2025 07:01:19 GMT</pubDate>
            <atom:updated>2025-03-18T10:40:23.012Z</atom:updated>
            <content:encoded><![CDATA[<p>Windows services are essential background applications that run without user intervention, making them crucial for various system functionalities and custom applications. This article provides step-by-step guidance on installing and uninstalling Windows services using the Command Prompt.</p><h3>Opening the Command Prompt with Administrator Privileges</h3><p>To install or uninstall a Windows service, you need administrative privileges. Follow these steps to open Command Prompt with the required permissions:</p><ol><li>Press <strong>Win + S</strong> and type “Command Prompt.”</li><li>Right-click on <strong>Command Prompt</strong> and select <strong>Run as administrator</strong>.</li><li>Click <strong>Yes</strong> if prompted by the User Account Control (UAC).</li></ol><h3>Installing a Windows Service</h3><p>Once you have the Command Prompt open with administrative rights, follow these steps to install a Windows service:</p><h4>1. Prepare the Windows Service Install Command</h4><p>Use the following format to install the service:</p><pre>&quot;{PATH-TO-THE-EXE-FILE}/{EXE-FILE-NAME}.exe&quot; -displayname &quot;{WINDOWS-SERVICE-DISPLAY-NAME}&quot; -servicename &quot;{WINDOWS-SERVICE-SERVICE-NAME}&quot; -description &quot;{WINDOWS-SERVICE-DESCRIPTION}&quot; install</pre><p>Replace the placeholders with actual values:</p><ul><li><strong>{PATH-TO-THE-EXE-FILE}</strong>: The location of the executable file.</li><li><strong>{EXE-FILE-NAME}</strong>: The name of the executable file.</li><li><strong>{WINDOWS-SERVICE-DISPLAY-NAME}</strong>: The display name of the service in the Windows Services Manager.</li><li><strong>{WINDOWS-SERVICE-SERVICE-NAME}</strong>: The internal service name.</li><li><strong>{WINDOWS-SERVICE-DESCRIPTION}</strong>: A brief description of the service.</li></ul><h4>2. Enter the Install Command in Command Prompt</h4><p>Copy and paste the command into the Command Prompt window and press <strong>Enter</strong>.</p><h4>3. Verify the Service Installation</h4><p>Once installed, confirm the service installation:</p><ol><li>Press <strong>Win + R</strong>, type <strong>services.msc</strong>, and hit <strong>Enter</strong>.</li><li>Look for the service under the <strong>Name</strong> column.</li><li>Right-click the service and select <strong>Start</strong> to run it.</li></ol><h3>Uninstalling a Windows Service</h3><p>To remove a Windows service, follow these steps:</p><h4>1. Stop the Service (If Running)</h4><p>Before uninstalling, stop the service using the following command:</p><pre>sc stop &quot;{WINDOWS-SERVICE-SERVICE-NAME}&quot;</pre><h4>2. Uninstall the Windows Service</h4><p>Use the following command to uninstall the service:</p><pre>&quot;{PATH-TO-THE-EXE-FILE}/{EXE-FILE-NAME}.exe&quot; -servicename &quot;{WINDOWS-SERVICE-SERVICE-NAME}&quot; uninstall</pre><h4>3. Verify Service Removal</h4><ul><li>Open <strong>Services Manager</strong> (<strong>Win + R</strong>, type <strong>services.msc</strong>, press <strong>Enter</strong>).</li><li>Confirm that the service is no longer listed.</li></ul><h3>Conclusion</h3><p>Installing and uninstalling Windows services via Command Prompt is a straightforward process when done correctly. Ensure you have administrator rights and enter the commands carefully to avoid errors. Mastering this process will help you efficiently manage Windows services for system applications or custom-built solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60ccf56287fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keyed Service Dependency Injection in .NET 8: A Game Changer for Developers]]></title>
            <link>https://medium.com/@yathavarajan/keyed-service-dependency-injection-in-net-8-a-game-changer-for-developers-7981132c636f?source=rss-67342b507b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7981132c636f</guid>
            <dc:creator><![CDATA[Yaathavarajan Krishnarajah]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 08:40:17 GMT</pubDate>
            <atom:updated>2025-03-18T08:46:13.389Z</atom:updated>
            <content:encoded><![CDATA[<h3>Keyed Service Dependency Injection in .NET 8: A Game Changer for Developers</h3><p>Dependency Injection (DI) is a core feature of .NET8, providing a clean and maintainable way to manage dependencies. With the release of .NET 8, Microsoft has introduced <strong>Keyed Services</strong>, a powerful new feature that allows developers to register and resolve services using keys. This addition enhances flexibility, especially when dealing with multiple implementations of the same interface.</p><p>In this article, we will explore how <strong>Keyed Services</strong> work, their benefits, and how to integrate them into your .NET 8 applications.</p><h3>What Are Keyed Services?</h3><p>Keyed Services allow you to register multiple implementations of an interface and retrieve a specific instance based on a key. Before .NET 8, achieving this required workarounds such as named instances using factory patterns or manual service resolution. Now, .NET 8 provides built-in support, making it more streamlined and efficient.</p><h3>Why Use Keyed Services?</h3><ul><li><strong>Improved Maintainability</strong>: No need for custom factories or conditional logic.</li><li><strong>Better Performance</strong>: Reduces the complexity of service resolution.</li><li><strong>More Control</strong>: Easily retrieve a specific implementation based on a key.</li></ul><h3>Registering Keyed Services in .NET 8</h3><p>To demonstrate Keyed Services in action, let’s start by defining an interface and multiple implementations.</p><h3>Step 1: Define the Interface</h3><pre>public interface IPaymentProcessor<br>{<br>    void ProcessPayment(decimal amount);<br>}</pre><h3>Step 2: Implement the Interface</h3><pre>public class PayPalProcessor : IPaymentProcessor<br>{<br>    public void ProcessPayment(decimal amount)<br>    {<br>        Console.WriteLine($&quot;Processing ${amount} via PayPal.&quot;);<br>    }<br>}</pre><pre>public class StripeProcessor : IPaymentProcessor<br>{<br>    public void ProcessPayment(decimal amount)<br>    {<br>        Console.WriteLine($&quot;Processing ${amount} via Stripe.&quot;);<br>    }<br>}</pre><h3>Step 3: Register the Services Using Keys</h3><p>In your Program.cs or,Startup.cs register the services using keys:</p><pre>var builder = WebApplication.CreateBuilder(args);<br><br>builder.Services.AddKeyedSingleton&lt;IPaymentProcessor&gt;<br>(<br>  &quot;PayPal&quot;, <br>  new PayPalProcessor()<br>);<br>builder.Services.AddKeyedSingleton&lt;IPaymentProcessor&gt;(<br>  &quot;Stripe&quot;, <br>  new StripeProcessor()<br>);<br><br>var app = builder.Build();</pre><h3>Resolving Keyed Services</h3><p>Once registered, you can inject and resolve the specific implementation using the key.</p><h3>Injecting Keyed Services in a Controller</h3><pre>public class PaymentController<br>{<br>    private readonly IPaymentProcessor _paymentProcessor;<br><br>    public PaymentController<br>    (<br>      [FromKeyedServices(&quot;PayPal&quot;)] IPaymentProcessor paymentProcessor<br>    )<br>    {<br>        _paymentProcessor = paymentProcessor;<br>    }<br>    <br>    public void MakePayment()<br>    {<br>        _paymentProcessor.ProcessPayment(100);<br>    }<br>}</pre><p>Alternatively, you can resolve services dynamically usingIKeyedServiceProvider :</p><pre>public class PaymentService<br>{<br>    private readonly IKeyedServiceProvider _serviceProvider;<br><br>    public PaymentService(IKeyedServiceProvider serviceProvider)<br>    {<br>        _serviceProvider = serviceProvider;<br>    }<br><br>    public void Pay(string method, decimal amount)<br>    {<br>        var processor = _serviceProvider.GetKeyedService&lt;IPaymentProcessor&gt;<br>        (<br>          method<br>        );<br>        processor?.ProcessPayment(amount);<br>    }<br>}</pre><h3>When to Use Keyed Services?</h3><p>Keyed Services are useful when:</p><ul><li>You have multiple implementations of an interface and need to select one dynamically.</li><li>You want to avoid service locator patterns while keeping dependency injection clean.</li><li>You are implementing feature toggles or environment-based dependency resolution.</li></ul><h3>Conclusion</h3><p>Keyed Services in .NET 8 significantly simplify working with multiple service implementations. By leveraging this feature, developers can achieve cleaner, more maintainable, and efficient code without relying on custom factories or service locators. Start using <strong>Keyed Services</strong> today and make your .NET 8 applications even more powerful!</p><h3>Further Reading</h3><ul><li><a href="https://learn.microsoft.com/en-us/dotnet/core/">Official .NET 8 Documentation</a></li><li><a href="https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection">Dependency Injection in .NET</a></li></ul><p>What do you think about Keyed Services in .NET 8? Share your thoughts in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7981132c636f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>