Hacker News new | ask | show | jobs
by krapp 1353 days ago
I feel like if you're going to use Typescript, you should accept that you're really just using Javascript with extra steps. If you want to use a language with enums, use one - there are many - but none of them are Javascript.
2 comments

...I think that's the point of Typescript, no? Being able to write in almost-Javascript with one extra step (that most IDEs take care of automatically anyway) is still nicer than having to learn an entirely different language and toolchain that then compiles down to JS in the end.

For web dev, having a single language everywhere is really nice.

One of the benefits of these extra steps is being able to use enums.

Using enums is not really that different from using type aliases. It’s a nicer way to write string/number values.