Alternatives to Enums – Part 2: Advanced Enums Implementing Polymorphic Behavior with Custom Types

    Alternatives to Enums – Part 2: Advanced Enums Implementing Polymorphic Behavior with Custom Types

    Mar 17, 2025
    Categories: C#

    Learn how to create enums in C# that support polymorphic behavior by using custom types instead of integers. Explore the trade-offs between compile-time safety, extensibility, and performance while implementing behavior-rich enumerations with private nested classes.

    Read
    Alternatives to Enums - Part 1: Strongly Typed Strings

    Alternatives to Enums - Part 1: Strongly Typed Strings

    Mar 10, 2025
    Categories: C#

    Enums in C# lack extensibility, making them difficult to expand in libraries. Strongly typed strings offer a flexible alternative, allowing new values without breaking existing code while improving readability and maintainability.

    Read
    Improving .NET Performance: Allocating Small Objects on the Stack in .NET 9 and Beyond

    Improving .NET Performance: Allocating Small Objects on the Stack in .NET 9 and Beyond

    Mar 4, 2025
    Categories: C#

    A view of the new performance gains in .NET 9, where objects of boxed value types, can be allocated on the stack, reducing GC workload and improving execution speed.

    Read
    Beyond MonoBehaviour: Running Code in Unity's Game Loop Using Non-MonoBehaviour C# Classes

    Beyond MonoBehaviour: Running Code in Unity's Game Loop Using Non-MonoBehaviour C# Classes

    Feb 24, 2025
    Categories: Unity

    Three ways to run code in Unity's game loop from non-MonoBehaviour C# classes, including early and late fixed updates, a singleton manager, and Unity's new Awaitable feature.

    Read
    Controlling Nested Class Instantiation in C#

    Controlling Nested Class Instantiation in C#

    Feb 17, 2025
    Categories: C#

    Restrict nested class instantiation within your assembly. C# solutions using delegates, factories, and static abstract members.

    Read
    How to Ask Programming Questions: The Importance of Defining Data Over Code

    How to Ask Programming Questions: The Importance of Defining Data Over Code

    Feb 10, 2025
    Categories: General

    The importance of data over code when asking programming questions and solving problems. How a well-formed question should always start and end with a clear definition of the data, rather than focusing solely on code implementation

    Read
Follow me: