D20Tek.Functional Migration Guide: Option → Optional

Why the Change? The Option<T> class served as a good starting point for building a functional class that manages having a value or not, but its naming doesn’t align well with .NET conventions because it already has the concept of Option for defining application settings. Therefore, we’ve introduced a new Optional<T> type that’s cleaner, more … Continue reading D20Tek.Functional Migration Guide: Option → Optional

Introduction to Immutability with Records in C#

With C# 9.0, Microsoft introduced the record keyword, a powerful new addition that makes it easier to work with immutable data. Records are designed to simplify the creation of classes that are primarily intended to store data, and they offer a more concise and expressive way to model data compared to traditional classes. If you've … Continue reading Introduction to Immutability with Records in C#

Basic C# Immutability with Tuples

In software development, one of the common challenges is returning multiple values from a method. Traditionally, we’ve handled this by using techniques like out parameters, creating custom classes or structs, or working with arrays and lists. However, with the introduction of tuples in C#, particularly since C# 7.0, there's a more elegant and straightforward way … Continue reading Basic C# Immutability with Tuples

Why Should I Care about Mutable vs. Immutable Types

In C#, classes and objects can be categorized as mutable or immutable based on whether their state can be changed after they are created. Understanding the distinction between mutable and immutable types is crucial for designing robust, maintainable, and performant applications. Mutable Classes Mutable classes are those whose state or data can be modified after … Continue reading Why Should I Care about Mutable vs. Immutable Types

Why Should I Care About Functional Programming in C#?

Functional programming (FP) is a programming paradigm that emphasizes immutability, first-class functions, and expressions over statements. While C# is primarily an object-oriented language, it has incorporated many functional programming features over time, particularly since C# 3.0 and with further enhancements in later versions. Here's why you should care about functional programming when working with C#: … Continue reading Why Should I Care About Functional Programming in C#?