May I suggest 「these」 instead?
I'm adding this to my ascii "vocab"
Father was a vet, and he made me respect antibiotics. Including, IF you take them THEN finish the entire course as directed. DO NOT stop taking them because you feel better.
I think we gotta normalize being sick, and sitting at home watching Netflix.
- I love getting pissed at the pub
- I hate getting pissed at home doing nothing
- I love the taste of non-alcoholic beer
edit: to say nothing as well of the anti-war protests that are happening in the streets of Moscow and across Russia. If they continue and grow they will pose a risk to regime stability.
Mechanically, a const dictionary, or a string union might achieve the same.
But semantically, an enum (sometimes) reads better.
Usually it's just
enum Method {
Get = "GET"
// ...
}
I usually always put doc comments on enums and their variants.Regarding why numeric ones are (only sometimes) more useful than string values: bit flags comes to mind, faster comparison of numbers than strings (not always tho... unless this is a misconception, but I don't believe so), you mentioned smaller bundle size already.
As for "auto" enums: the fact they're numbers now is an implementation detail. They could be unique Symbols in a future versions of typescript. You can do that manually now too, but I'm talking about the automatic (without assignment) syntax.
Regarding article: I... Half-agree. But I'd not completely disregard/avoid enums. At the very least, they can be useful to help model some behaviours/states in more readable, accessible, and coherent way (Other comments went into a more in-depth defence of enums, thought).
enum Method {
Get = "method/GET"
// ...
}
The string value can be very helpful for the reader - be it a human or log ingestorI don't think this is so hard. The pandemic is waking people to the reality of their own mortality.
Suppose you're working a job in a big, highly dysfunctional organization. Most of us who have been there know that these jobs often pay well -- but in trade, you're selling your precious hours to execute a random series of essentially meaningless events (and under pressure to get it done).
Now add a pandemic. You were probably already having a quiet existential crisis, feeling that the insanity of your work environment is no way to let your life pass by. You want your life to mean something, but it isn't fulfilling. Now, people you know are passing away much sooner than expected. Thoughts about the eventuality of your own death are really tipping the scales.
Do you just bury your nose and keep going on? Or find out what else is out there?