Hacker News new | ask | show | jobs
by likeclockwork 1373 days ago
That boundary is why I have a hard time taking TypeScript seriously. A type system that doesn't participate in code generation is what.. just for linting and documentation basically? Is that what we are become? Is that all people think a type system is good for?

Worse there is one value that is both a user-definable TypeScript type and a JS value.

1 comments

> That boundary is why I have a hard time taking TypeScript seriously. A type system that doesn't participate in code generation is what

How is being able to check code correctness at compile-time even close to "just linting and documentation basically"? This has to be a bad faith argument

> Worse there is one value that is both a user-definable TypeScript type and a JS value.

What does this even mean? I don't think you understand TypeScript.

It's just fancy documentation. It doesn't contribute to behavior at all. Typescript can describe polymorphism, lamely, but it can't drive it.
> It doesn't contribute to behavior at all

I agree that TypeScript, in and of itself, doesn't change the way the code executes. This is self-evident.

But the idea that that makes it simply "fancy documentation" is hilarious. I have never seen documentation that can tell you at compile-time how your code will behave, it's fundamentally stupid to argue that static type checking is in any way comparable with documentation