3 ms·
I'm not convinced by Enums having methods. For those of you using other languages that support this, do you find them useful?
by pbowyer 5y ago
I'm not convinced by Enums having methods. For those of you using other languages that support this, do you find them useful?
- tyingq 5y agoBorrowed from java...
- jspaetzel 5y agoI've found a couple odd instances where it'd be nice. But also utility classes work just fine too.
- Semaphor 5y agoEnums with methods are essentially a compiler supported way of having several static readonly instances on a class with a private constructor. It’s not always useful, but it can be nice, sometimes. I’ve had a few times working with C# where I’d have liked those.