General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
yapdog
Theo - t3․gg
comments
Comments by "yapdog" (@yapdog) on "Let's Talk About TypeScript's Worst Feature" video.
That's exactly what I'm saying. I have no idea what the problem is that he's illustrating.
31
Being a C coder, I really have no idea what the problem is that you're illustrating. I mean, of course User == 0. What am I missing???
8
@refinery__ If the goal is to check if SomeEnum.User has been set to something, that doesn't make any sense at all. Enums aren't objects/structs. They're constant values. Think of it like compiled code with #define USER 0. USER is a placeholder for 0, and you can't change the value of 0. So using an enum as an object is bad. I've seen the various examples posted by the YouTuber, but all of them lead back to that central conclusion: a misunderstanding of the purpose of enums, not that enums shouldn't be used.
4
@jpbastyr But enum is not a struct definition, so....
1