Skip Navigation

Go Enums Suck

www.zarl.dev /articles/enums
7
Hacker News @lemmy.smeargle.fans bot @lemmy.smeargle.fans
BOT
Go Enums Suck

You're viewing a single thread.

7 comments
  • 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.

7 comments