u/MercyHealMePlsin r/typescript • Recommends
On “What's up with all the enum hate lately?”
…. However in that case I'd personally still just use an object.
const defaultNames = {
max: 'Max',
julia: 'Julia',
}
let name: string = defaultNames.max;
// and later...
name = 'Sara';
I don't want you to think that I absolutely hate enums. I just never use them because they don't benefit me. I recently saw a link to this video by Theo from T3 where he explains why he doesn't like enums, that's how I got aware of the fact that I'm actually not the only one avoiding them. I think he has usually really good takes on most things and has some interesting opinions, but I think the point he's making about enums specifically isn't really that well thought through. That's…