Not a problem, ignore the edgelording, you’ll be fine.
A lot of people don’t understand that readability is about how fast someone can correctly understand that whole class/file/etc afterwards. Sometimes using enums improves that, sometimes not.
For enums specifically, it is good to be aware what you do with them. Often it directly maps to a decision. E.g. enum ExportType with values JSON/XML/CSV - instead of passing an enum value to a big function with 3 different paths, you could have 3 classes that have a common interface, and pass one of those to the function to use. That is nicer sometimes, other times not.
Another thing is that enums are often used to have a small INT DB column, which is not supposed to represent a number (like for math and stuff) but different options. In that case, yeah enum is perfect to describe in code what those numbers actually mean.
But yeah, it all comes down to: After you write it, look at your code and see if it makes sense quickly - if not, adjust.
Glances nervously at my own code using more and more enums now-a-days.
Not a problem, ignore the edgelording, you’ll be fine.
A lot of people don’t understand that readability is about how fast someone can correctly understand that whole class/file/etc afterwards. Sometimes using enums improves that, sometimes not.
For enums specifically, it is good to be aware what you do with them. Often it directly maps to a decision. E.g. enum ExportType with values JSON/XML/CSV - instead of passing an enum value to a big function with 3 different paths, you could have 3 classes that have a common interface, and pass one of those to the function to use. That is nicer sometimes, other times not.
Another thing is that enums are often used to have a small INT DB column, which is not supposed to represent a number (like for math and stuff) but different options. In that case, yeah enum is perfect to describe in code what those numbers actually mean.
But yeah, it all comes down to: After you write it, look at your code and see if it makes sense quickly - if not, adjust.