Best of C#April 2025

  1. 1
    Article
    Avatar of hnHacker News·1y

    Migrating away from Rust.

    The development of Architect of Ruin initially began in Rust with the Bevy game engine due to personal preferences and the positive community around Bevy. However, challenges such as collaboration difficulties, abstraction issues, rapid iteration needs, migration pain, and modding limitations prompted a switch to Unity and C#. The team conducted an experiment evaluating core features implementation, leading to a full port decision. The switch resulted in faster development, better collaboration, and improved maintainability.

  2. 2
    Article
    Avatar of techworld-with-milanTech World With Milan·1y

    Why C#?

    C#, a programming language developed by Microsoft, is known for its modern, multi-paradigm capabilities and has continuously evolved to include features like object-oriented programming, generics, lambdas, LINQ, and async/await. It benefits from a robust .NET ecosystem, excellent tooling like Visual Studio, and a vast library collection via NuGet. C# is suitable for developing cross-platform applications across web, mobile, desktop, and cloud environments, supported by extensive documentation and a vibrant community.

  3. 3
    Video
    Avatar of codemonkeyunityCode Monkey·1y

    The 10 BEST Game Dev Beginner Projects to Make!

    Beginners in game development are encouraged to create multiple small projects to gain experience quickly. Examples include making games like Flappy Bird, Snake, Breakout, and Asteroids. Each project helps build essential skills like handling inputs, managing collisions, and implementing simple AI. Focusing on clean code practices and gradually increasing complexity is recommended.

  4. 4
    Article
    Avatar of dotnet.NET Blog·1y

    Build a Model Context Protocol (MCP) server in C#

    Learn how to build a Model Context Protocol (MCP) server using C#. The MCP facilitates communication between AI models and applications. Using the MCP C# SDK, developers can create both servers and clients. The guide includes steps for setting up a server, defining tools, integrating with existing APIs or data, and publishing the server as a container image.

  5. 5
    Article
    Avatar of devblogsDevBlogs·1y

    Announcing Windows Community Toolkit v8.2

    Version 8.2 of the Windows Community Toolkit has been released, bringing updates such as Native AOT support, UWP support for .NET 9, and SwitchConverter improvements. The update also includes enhancements like AcrylicBrush for WinUI 3 and various bug fixes. Windows Community Toolkit Labs has introduced new experiments, including DependencyPropertyGenerator and OpacityMaskView, to further aid developers. Community contributions continue to play a significant role in these developments.

  6. 6
    Article
    Avatar of aspnetASP.NET Blog·1y

    .NET 10 Preview 3 is now available!

    The third preview release of .NET 10 introduces enhancements across the .NET runtime, SDK, libraries, C#, ASP.NET Core, Blazor, and .NET MAUI. Notable updates include AOT-safe constructors in libraries, improved telemetry support, new features for ML.NET, Blazor, MAUI, and more. Full release notes are available for a detailed overview.

  7. 7
    Article
    Avatar of csharpcornerC# Corner·1y

    🎨 Abstract Factory Pattern in C# 14

    The Abstract Factory Pattern allows developers to create families of related objects without specifying their concrete classes, which is valuable in applications supporting multiple themes, platforms, or environments. This pattern helps maintain decoupled, scalable, and maintainable code. Using C# 14, you'll have better architectural clarity and ease in implementing variations like light and dark UI themes. The pattern aligns well with enterprise software requirements and plays nicely with Dependency Injection frameworks.

  8. 8
    Video
    Avatar of nickchapsasNick Chapsas·1y

    The "in" keyword in C# is Awesome

    The 'in' keyword in C# allows structs to be passed by reference while making them read-only within the method for performance optimization. This avoids costly copying of large structs. However, if the struct isn't marked as readonly, hidden defensive copies may occur, reducing performance benefits. Combining 'in' with 'readonly struct' or read-only members maximizes performance gains.

  9. 9
    Article
    Avatar of jetbrainsJetBrains·1y

    The .NET Tools Blog

    C# offers a variety of data structures designed for different use cases. The choice of the right collection depends on factors such as the type of operations, performance considerations, and the structure of the data.

  10. 10
    Video
    Avatar of zoranhorvatZoran Horvat·1y

    How Fast is LINQ? The Benchmark Results May Surprise You!

    The post demonstrates the performance of LINQ against traditional for loops through a series of benchmarks. It reveals that LINQ is significantly faster, even outperforming optimized versions using ReadOnlySpan. The post explains LINQ's efficient implementation and its ability to handle complex operations more swiftly than manual code, highlighting LINQ's exceptional speed in .NET development.

  11. 11
    Article
    Avatar of syncfusionSyncfusion·1y

    What’s New in C# 14? Key Features and Updates You Need to Know

    C# 14 introduces significant new features aimed at enhancing development productivity and code readability. Key updates include implicit span conversions, nameof unbound generics, lambda parameter modifiers, the field keyword for property accessors, and the ability to have partial events and constructors. These additions are expected to make C# a more expressive and efficient language for developers.

  12. 12
    Video
    Avatar of nickchapsasNick Chapsas·1y

    The New Extension Members of C# are INSANE

    Nick introduces a new feature in .NET called extension members, which allows developers to add instance and static members to types using the new 'extension' keyword. This feature enhances existing extension methods by enabling extension properties and extending functionality without being limited to static methods. Nick demonstrates how to implement and use these new features through various examples and discusses the potential impact on how developers write C# code.

  13. 13
    Video
    Avatar of nickchapsasNick Chapsas·1y

    Don't use async void in C#

    Async void methods in C# should generally be avoided because they can't be properly awaited, leading to issues with error handling and control flow. The only appropriate use of async void is in event handlers, where tasks are not returned.

  14. 14
    Video
    Avatar of nickchapsasNick Chapsas·1y

    The LINQ trap in .NET

    Understanding the deferred execution in LINQ is crucial as it can cause unexpected data changes in .NET. LINQ methods like where, select, and take build a query rather than executing immediately. This allows adding conditions dynamically, but beware of data changes before execution, as they will reflect in the results. Knowing these rules makes LINQ a powerful tool.

  15. 15
    Article
    Avatar of infoworldInfoWorld·1y

    How to use guard clauses in C#

    Guard clauses in C# help improve code readability and maintainability by eliminating unnecessary nested constructs and branches. They are used to validate conditions or input parameters, stopping the execution of methods early if criteria are not met. This practice prevents runtime exceptions and ensures valid data processing. The post provides practical code examples and highlights the advantages of using guard clauses over traditional validation methods.