Earlier quoted context omitted.
> TS catches me writing numerous bugs a day I see this sentiment a lot but I honestly can't think of any non-trivial bugs that TS has caught for me. 99% of the bugs it catches I would see 1 second later when my page hot reloads and crashes.
That’s the beauty though, isn’t it. Most bugs are trivial. I appreciate typescript getting the trivial bugs right more often than I’d trust myself to do so.
TypeScript is now officially 10 years old
111–120 of 207 posts
Re: TypeScript is now officially 10 years old
#112I wish Flow, Facebook’s TypeScript, was more popular, as I think it has some better properties. But yeah, the tooling is kind of bad and it is all written in OCaml, while TypeScript is in TypeScript…
Native bundlers like esbuild, swc etc. are mainstream now but they came much later.
Re: TypeScript is now officially 10 years old
#113Earlier quoted context omitted.
Cringing at compile time safety or what?
No, cringing at some "helpful" popup appearing right over the previous line of code. If anything, they could've made it appear under the current line; code's still written top to bottom so it's less likely for "suggested relevant info" to obscure the actual relevant info.
Re: TypeScript is now officially 10 years old
#114Earlier quoted context omitted.
I don't understand what you are referring to - the TypeScript compiler has 0 (non-dev) dependencies: https://github.com/microsoft/TypeScript/blob/main/package.js... .
Yes, it also comes delivered as several near-identical builds for different contexts, each of which is nearly non-extensible. Have you seen the kind of monkey patching Volar (Vue tooling) does to enable type checking of TypeScript embedded in Vue templates? Meanwhile, native JSX support lol
It is amazing that the whole langserver stacking that volar does is possible at all - I don't believe there is any equivalent prior art that worked as well as it does. Despite all the complexity the end user experience is pretty good. If someone had mentioned to me this kind of cross language type-checking can work as nicely before I used volar I would have been super skeptical.
Sure it has its caveats. But it is also completely possible to use vue in pure typescript.
I don't fault them for having native jsx support, React was just too popular in the target user base. I do hope that someday js+ts gets kotlin style builders, but until I'll gladly use volar.
Re: TypeScript is now officially 10 years old
#115Earlier quoted context omitted.
> In practice, it arbitrarily invalidates completely sensible JavaScript idioms. Such as?
For one, try redefining a property as a getter/setter pair in a subclass. Also, try implementing a function that takes keyword arguments, some of which are required, and some of which have default values. I'll wait. When you're back I might've remembered some more.
This is actually a completely invalid pattern in JavaScript, and it's really good that TypeScript errors for it.
Class fields are created with a define property step in the constructor, so they would shadow the getter/setter in the subclass.
The super class needs to have a getter/setter pair itself to be overrideable.
The upcoming `accessor` keyword will help by makes getter/setter pairs automatically.
As for required args and defaults, TypeScript doesn't really change anything over JavaScript except adding type warnings: https://www.typescriptlang.org/play?#code/MYewdgzgLgBAZiEMC8...
Re: TypeScript is now officially 10 years old
#116Earlier quoted context omitted.
> In practice, it arbitrarily invalidates completely sensible JavaScript idioms. Such as?
One of the first things that made a bad impression on me was back in the day when classes were still used in the js world. I was not pleased when it told me I have have to do this.blahBlah = value in the constructor because it didn't quite catch, and maybe still doesn't, that Object.defineProperties(this, { bla: { value: ... } blah: {get, set} }) is completely legit That said, I do prefer ts to vanilla. It's less wor…
Object.defineProperties
when there is a clearer and shorter way?Or am I misunderstanding something?
Re: TypeScript is now officially 10 years old
#117Typescript was my stepping stone into the world of Rust. Even before Deno made it easy, it was straightforward enough to configure a simple tsconfig and just run tsc. Much like cargo, there is a lot to be said for "it just works" tooling - especially for beginners or even new programmers. It is probably fair to say it is one of the most influential and impactful languages of all time. There's even the future possibil…
Re: TypeScript is now officially 10 years old
#118 sed s/vanilla/pure/g
(my wish for what we call javascript itself)Re: TypeScript is now officially 10 years old
#119Earlier quoted context omitted.
That’s not true. You can import JS directly into TS or use ts-ignore annotations.
Quoted post unavailable.
Re: TypeScript is now officially 10 years old
#120I wish Flow, Facebook’s TypeScript, was more popular, as I think it has some better properties. But yeah, the tooling is kind of bad and it is all written in OCaml, while TypeScript is in TypeScript…
I always felt the decision to write flow in ocaml was ahead of its time. Flow compiler is much faster than TS. Native bundlers like esbuild, swc etc. are mainstream now but they came much later.
Just like MS eventually did with C# too. After the C#-compiler was reimplemented in C# (Roslyn), that’s when the language was truly allowed to develop. And it also made it much easier to make C# a truly cross-platform language.
When the language-designers don’t have to use their own language, they have objectively much less motivation to improve upon the language or it’s tooling than if they do.
The Flow-team didn’t use Flow to write Flow and that shows in its lack of development, its lack of tooling, its lack of contributors and ultimately in its lack of adoption.