Re:Hegel – An advanced static type checker for JavaScript
by krapp on Wednesday October 12, 2022 @07:29PM
(#33185154)
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.
[ Parent
| on HN ]
Re:Hegel – An advanced static type checker for JavaScript
by kamilafsar on Wednesday October 12, 2022 @07:38PM
(#33185241)
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.
Re:Hegel – An advanced static type checker for JavaScript
by solardev on Wednesday October 12, 2022 @07:59PM
(#33185416)
...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.