Live data from Hacker News

TypeScript 5.0

devblogs.microsoft.com

331–332 of 332 posts

Re: TypeScript 5.0

#331

Earlier quoted context omitted.

It’s hard to imagine if you weren’t in the React community at the time, but I feel like most people were pushing Flow at the time and choosing TS was quite controversial. I think it was the combination of Flow being from Facebook, and the “no build step/its just JS with annotations” thing which people made a big deal out of, but I never saw as a big differentiator. I had a hard time convincing a couple of places I wo…

> I think it was the combination of Flow being from Facebook, and the “no build step/its just JS with annotations” thing which people made a big deal out of, but I never saw as a big differentiator. I put quite some time into evaluating Flow vs Typescript around 2016, and preferred Flow mostly because its type checking was more correct, and its bugs more straightforward. Typescript would happily compile all sorts of…

This is true. I think TS arguably took a more pragmatic approach which allowed you to adapt existing codebases and coding styles more easily, at the expense (initially) of type safety. Obviously there have been many improvements since then

Re: TypeScript 5.0

#332

Earlier quoted context omitted.

Do you mean pass in a type? type NonEmptyArray = [T, ...T[]];

I mean if I have a NonEmptyArray say xs, and I then xs.map(x=>2*x), will the result of this expression be a NonEmptyArray ?

No, unfortunately it will just be number[] as the return type.
Post reply on HN