Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
I've been getting a lot of mixed input on this lately and I'm curious to gauge the public opinion on it.
For key identifiers in key/value pairs (eg. days of the week, high/med/low, etc), is it preferable with semantic string naming wherever possible, or are int enums usually preferred for being more clean and robust?
I suppose it's a case of "it depends". I tend to use stringed keys myself since they are more readable but I do think it's a hassle with asserting case insensitivity and how the keys can be accessed as properties - "sometimes, probably".
People often comment on it when they see it, and it turns into this weird mutual "why strings?" vs. "why ints?".
question