Hacker News new | ask | show | jobs
by danpeddle 1137 days ago
I do wish we were in the timeline where we got a super powered jsdoc, instead of TS.

Something like that would be my guess for what’s next, once this current trend has run its course.

3 comments

We already have that! And it’s TypeScript. You can and probably do use 98% (made up number but close enough to reality I don’t need to quantify it) of the benefits of TS while authoring JS code if you bother annotating types in JSDoc.

You can also get the same type checking benefits outside of the editor (eg in CI) with very minimal tooling effort. That’s what Svelte is doing.

Granted I work on JS projects which embraced this from the opposite direction (gradual typing where nothing is enforced statically), and it’s strictly worse than just using the tools how they work best (you’d be hard pressed to make an incremental decision about anything without knowingly preserving bugs or increasing the incremental scope).

Anyway, the alternate timeline you seek already exists. It’s just so optional that you could easily miss it.

Typescript is one of the most popular languages in the world at this point and continuing to grow (see Stack Overflow developer survey for the last 3 years). It covers the majority of the mature ecosystem on npm by now. Characterizing it as a trend is beyond incorrect. For all intents and purposes, JS is now statically typed.
TypeScript would have to become more popular than JavaScript for your last part to become true. And it's nowhere near of getting there (outside of SV/hip development world).

https://trends.google.com/trends/explore?q=%2Fm%2F0n50hxv,%2... (last 12 months worldwide)

Last datapoint: TypeScript - 10, JavaScript - 82

I don't think that's a fair metric. Many people using TS (myself included) will typically use "JavaScript" in search queries because the answer is usually the same. The only time I search for "typescript" is if I have a problem with the type checking, which isn't very often.

That said, I think you're right that JS is still quite popular.

I think that’s literally Flow: https://flow.org/en/docs/types/comments/