Live data from Hacker News

Ten Years of TypeScript

devblogs.microsoft.com

91–100 of 147 posts

Re: Ten Years of TypeScript

#91

TypeScript is the best thing to happen to web dev, and it keeps getting better. My only gripe is that sometimes in a codebase that is heavy on inferred types I need to restart the TS server occasionally. Nonetheless, unless there is a specific requirement that TS isn't the right choice for, it's the language I reach to for everything.

Do you have interests beyond the JS world? TypeScript being the best thing to happen to web dev sounds a bit hyperbolic.

The vast majority of web apps have JS on the front end. It's not even close.

Re: Ten Years of TypeScript

#92
post #83
post #58

I've spent the last two years working with TypeScript solely. Coming from ~20 years with PHP and using Kotlin and Dart for some years as well, I feel that I'm doing something wrong. I absolutely loathe working with TypeScript. The community is the most fragmented I've ever experienced, the silly amount of package managers, builders... TypeScript just doesn't fit with me.

That is the same as saying you hate Kotlin because Android annoys you. Or blaming JavaScript for the browser DOM. Please correctly blame the ecosystem that you dislike, instead of thoughtlessly using a language as a label for an ecosystem.

It’s my impression GP doesn’t have a clear picture of where TypeScript ends and the rest of the tooling ecosystem begins. Which is totally understandable, especially given how pervasive TypeScript is and how it nearly totally overlaps with the rest. I think you and I have similar perspectives on the details, but you could be kinder expressing them.

Re: Ten Years of TypeScript

#93
post #72

Typescript as a language isn't too bad but the ecosystem is an absolute dumpster fire. NPM is terribly fragmented, costs a fortune in effort to maintain dependencies, security updates etc... Every Typescript/JS project I work on is full of a dangerous amount of third party dependencies - it can be hundreds if not thousands in a single repo - many of them fragile in their own special way. Language packages management…

Typescript as a language is better than "isn't too bad", it's great! I love the syntax for unions and how normal things like "if" will narrow types. But I agree that it's a shame that the JS ecosystem is such a mess. Granted, dealing with it is essentially Typescript's purpose, but I would love for it to be a full fledged language on its own, divorced from JS. How cool would it be if you could write normal backend ap…

I wished Flow or ReScript would have won.

TypeScript is too C#-ish for my taste.

Well, still better than nothing, I guess.

Re: Ten Years of TypeScript

#94

Honest question: why did TypeScript succeed while ActionScript 3.0, another ECMAScript-superset language with typing and OOP (and predates TS by a few years), is all but a distant memory? Is it more than just Adobe being a terrible steward of its tech? With that said, TS is definitely a blessing; I recently had the privilege of migrating to it after having written a hobby project in plain JS, and the difference in us…

IMO the flash runtimes leaked memory and that made them bad for long-running applications.

I remember writing a long-running digital display app and the memory would balloon to the point where we would use a product (mdx/mdm?) to restart the flash player periodically.

Re: Ten Years of TypeScript

#95
post #66

> "Align with current and future ECMAScript proposals." But they admitted namespaces, enums, and interfaces into the language (the latter becoming more and more confusing as type aliases got more expressive), > "Avoid adding expression-level syntax." Is "as", "is", or "satisfies" expression-level? > "Use a consistent, fully erasable, structural type system." But the enums!

> But they admitted namespaces, enums

And decorators. But this was very early on and they won’t ever do it again unless there’s a drastic change on principle and probably a reorg of global proportion. They categorically reject anything with runtime implications now, and to the point of decorators are actively working to align them with the standard as it’s approaching stability.

> and interfaces into the language (the latter becoming more and more confusing as type aliases got more expressive) […] Is "as", "is", or "satisfies" expression-level?

No. All of this is completely separate from the runtime and on a standards course to be treated effectively as comments.

> But the enums!

I’m one of the minority who actually likes TS enums, but I strongly suspect they’ll be deprecated, alongside namespaces, as soon as there’s general consensus around types as comments. The TypeScript team considers these mistakes and would very much like to be able to drop them. I’d welcome that too even though I quite like enums.

The fact is TS has considerable backwards compatibility expectations, and aligning their mistakes with their goals is great on principle but something which would require thousands upon thousands of hours of labor for people to accommodate.

You can snipe all you want, but if you think it’s that easy to resolve maybe I can direct you to https://github.com/microsoft/TypeScript/pulls

I’m not affiliated with the team in any way but I’m almost totally certain they’d welcome a contribution that gets them closer to their stated principles where historical designs are entrenched, without breaking workflows for thousands of people and interrupting releases for millions.

Re: Ten Years of TypeScript

#96
post #64

I've always been a big proponent of TypeScript, but does anyone else feel like the type system has gotten a bit too flexible? I recently had to fix some errors when upgrading packages on an old project, and it was not at all clear what was wrong by just reading the compiler output. For some errors, there were like 5-10 lines of confusing info/context, it felt like trying to understand the errors reported in template-…

It’s always been too flexible. That’s its raison d’être.

Re: Ten Years of TypeScript

#97

TypeScript has lots of great features and a few bizarrely bad ones. It’s great in spite of itself. The main misfeature is their dogmatic refusal to rewrite import paths (citing the “Preserve runtime behavior of all JavaScript code” principle mentioned in this article). Here’s a good summary of the problems this causes: https://github.com/microsoft/TypeScript/issues/42151 I’m curious, how many people are using TSC onl…

They're beginning to yield on file suffixes, and even have module resolution tracked on the 4.9 iteration plan. I agree it’d be better for them to focus on type checking but gratefully that’s what they seem to be moving towards with their types as comments proposal.

Re: Ten Years of TypeScript

#98
post #83

Earlier quoted context omitted.

That is the same as saying you hate Kotlin because Android annoys you. Or blaming JavaScript for the browser DOM. Please correctly blame the ecosystem that you dislike, instead of thoughtlessly using a language as a label for an ecosystem.

It’s my impression GP doesn’t have a clear picture of where TypeScript ends and the rest of the tooling ecosystem begins. Which is totally understandable, especially given how pervasive TypeScript is and how it nearly totally overlaps with the rest. I think you and I have similar perspectives on the details, but you could be kinder expressing them.

I assumed repox prefers bluntness, due to their writing style. I was careful with the words and tone that I chose. Checking comment history, repox wrote that they are a Dane (which I didn't know). My experience of friends from other nearby countries is that their style of interaction can be seen as rude by many people. In particular my stereotype is that Americans often prefer a more gentle approach.

I think you are assuming I am not being respectful. However I believe that a blunt reply is definitely showing respect to them in this situation. I do need to be careful not to make comments that are personal attacks (or that could be mistaken for), which I certainly was not trying to do.

(To quote you: "you’re making the claim, you defend it. Otherwise the assumption is just, like, your opinion man." ;)

Hopefully repox can reply, although they don't often comment, so I would guess they are unlikely to check replies. Anyways, definitely off topic!

Re: Ten Years of TypeScript

#100

Earlier quoted context omitted.

Yes, that part was nonsense. Typescript maps one to one for supported features. However there was comment there that ts doesn't generate code by itself unless downgrading to historic versions, which is not true. It would be nice if not only type system but all ts would be erasable, ie. so you can write ts to js transpiler by replacing ts code by spaces and the remaining part would be valid, runnable js. With enums, m…

I agree that the typescript team should consider using the compiler to extend javascript rather than just supplement it with types. Like you said, there are technically parts of typescript that don't have a direct corollary in js (enums/namespaces), so why not take it a step further and add some of the features that js is missing? The only example where they've really taken that next step is with experimental decorat…

The article explains their stance on adding runtime features.
Post reply on HN