| > > Also, this approach does not suffer the problems described by the article.
>
> This argument doesn't hold water, unless you're taking a philosophical stance. Respectfully, philosophy has nothing to do with this. The argument that the other person made does, in fact, hold significant water. There are extremely long discussions about it on the Typescript GH repo. . > The argument is that most TypeScript features don't actually spit out JavaScript code and this one does. No, it isn't. . > then "extra" JavaScript code is still being generated I never said extra code was a problem. I have no problem with this. What I said was that I found the code emitted by the enumeration stack to be problematic. You seem to have inferred cause (incorrectly.) . > Why should we care who generates the code? Do you believe that I think a compiler should not generate code? I never said anything of that form. Genuinely, it's difficult to hold a discussion with people who read so deeply between the lines that they come to bizarre conclusions, then think those conclusions belong to the person on the other end of the wire. . > This argument only works when we're comparing to writing a string literal union type and no other supporting code for that type. You're not talking about the same argument that I am. . > but more clearly communicates intent/semantics to your fellow TypeScript devs (including future-you). I write documentation. |
The article listed literally one reason to not use enums, and that reason is because it requires to compiler to produce JavaScript code. So, if that's not what you're talking about, then I have no idea what "problems described by the article" you could possibly be talking about.
With all of your complaining about my response, you still didn't explain it.