Hacker News new | ask | show | jobs
by zwbetz 1978 days ago
I mostly agree with the author on "I avoid the new and shiny." ... The post links to another named "TypeScript is weakening the JavaScript ecosystem". In that post, the author says "My context is that I've not looked into TypeScript yet. That means I have no idea how it works.". I am all for reading a good critique, but how can you adequately critique a technology if you don't know how to use it?
2 comments

I think it could be a good critique. It's a good point in general (just think about Grunt, Gulp, Broccoli, webpack and the like), but I don't see TypeScript as the "new and shiny" anymore.

Although there are alternatives (Flow, for example), to me it seems like the community has picked TS as the way forward, so in my opinion TS is a very low risk technology with real benefits, so I wouldn't hesitate adding it to a project's tech stack.

It's here to stay and a big chunk of JavaScript developers enjoy using TypeScript.

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.

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 :)