Hacker News new | ask | show | jobs
by timdaub 1984 days ago
Surprisingly, many get upset about this particular line while the reason I added it was simply to be honest in my argument.

As you can already infer from the headline of that post, I tried writing a statement that is about how Typescript is weakening the JavaScript ecosystem.

2 comments

I don't see the argument that it's weakening the JavaScript ecosystem. If anything it enriches it as you have (generally) safer more robust code to work with.
TypeScript is reaching GHC level of configuration flags, builds using it manage to even be slower than many native toolchains, and the team seems to just keep going with crazy type systems ideas, I already lost track of them.

Really, I hope that in a couple of years browsers would just allow for WebIDL integration and that is it.

It's quite common to see a similar concern raised about contemporary versions of the Swift language design (language-nerd lunatics taking over the asylum).
Yep, and Kotlin is just getting whole the Scala refugees.
If you're using VS Code or WebStorm/IntelliJ (and doubtless any other editor which has its own internal copy of TypeScript and uses its language service) you can write JavaScript and still get most of the benefits of using TypeScript without buying into the tooling - it's my preferred way to make use of it.

e.g. for VS Code, stick a jsconfig.json in your project's root:

    {
      "compilerOptions": {
        "checkJs": true,
        "target": "es2020"
      }
    }
If you want TypeScript to know about the types in your project, or help it with stuff it can't figure out on its own you can add them using JSDoc comments:

https://www.typescriptlang.org/docs/handbook/jsdoc-supported...

The best thing is if TypeScript is being silly about your working code (its type definitions for the DOM can be particularly painful to work with), you can just ignore it :)