Get the latest tech news

An ode to TypeScript enums


Pouring one out for a fallen friend

So the TypeScript team made it possible to ban those features with the new compiler flag and make it easy for folks to ensure their TS code is directly runnable. Over last few years, prominent TypeScript content creators have been making the case against enums on social media, blog posts and short video essays. They tend to be built up by library authors to have an iterable/indexable mapping around when validating unknown values or to enumerate in a UI e.g. in error messages or to build a<select> dropdown.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of ode

ode

Photo of TypeScript enums

TypeScript enums

Related news:

News photo

TypeScript enums: use cases and alternatives

News photo

An Ode to My 5-Year-Old Samsung Galaxy S10e

News photo

Ode to a world-saving idea: attribution error and cognitive empathy (2021)