4 ms·
They're only a code smell in languages that treat them poorly. Most modern languages have enums as just a matter of course for the language. I'm using Dart rat
by chris37879 5y ago
They're only a code smell in languages that treat them poorly.
Most modern languages have enums as just a matter of course for the language. I'm using Dart rather a lot these days for Flutter, and I absolutely love their enums. I can extend one and use it like a pseudo type union, or for a thing like `Environment.development`, I can extend that so that any `Environment` variable automatically has properties like `apiUri` or `name` or whatever other thing that changes per environment, but the set of them is still well known ahead of time.