|
|
|
|
|
by fifticon
1609 days ago
|
|
I cannot agree regarding enums.
I want enums exactly as they are.
In particular, I insist on decoupling their names and their values.
I want to rename/update their names, without affecting their representing value. I want them to work with both integers and strings (as they do).
Their raw values may appear in external data, for reasons that are none of your business, and thus must be preserved, maintained and under control.
The enum as it exists was created by people who know what they are talking about when they talk about enums.
People are free to go in their corner and play with their union types and crayons, but they should not confuse them with enums. There is nothing wrong with union types, apart from them being union types but not enums.
The language with the best enums is java - enums in java are so great, that I often regret the hoops I have to jump through with enums in C# (you might well say, enums in java are overengineered). |
|