C# is introducing union types in .NET 11 Preview 2, a feature that allows variables to hold one of several distinct types. The addition addresses a long-standing gap in the language's type system.
Union types enable developers to explicitly declare that a value can be one of multiple specific types, improving type safety and reducing reliance on null checks or object casting.
The feature works through discriminated unions, where each type option is clearly defined. This approach has proven valuable in languages like TypeScript, Rust, and F#, where it helps catch errors at compile time rather than runtime.
Developers can now write more expressive code by using union types in method signatures and variable declarations. The compiler ensures values are handled according to their actual type, eliminating entire categories of bugs.
The implementation in C# brings the language closer to modern functional programming patterns while maintaining backward compatibility. The feature appears in .NET 11 Preview 2, with general availability expected later in the release cycle.
The yt-dlp project has announced limited and deprecated support for Bun, the JavaScript runtime. The change affects users relying on Bun to run the popular video downloader.
A new perspective on software development emphasizes writing code with future maintainers in mind. The approach prioritizes readability and clarity over clever optimizations.
A Rust implementation of PostgreSQL has reached a major milestone by passing 100% of the database system's regression test suite. The project demonstrates functional parity with the original C-based database.