• canpolat@programming.dev
    link
    fedilink
    English
    arrow-up
    5
    ·
    8 months ago

    I mainly develop in C#, and I agree that having to write so much boiler plate for type safety is really boring. C# is not perfect either (it doesn’t have discriminated unions, etc.) but at least it gives type safety out of the box.

    However, in general, I think enums are widely misused. I see a lot of cases where they should have been classes with a factory, but ended up being enums with a lot of static functions and switch statements.