Live data from Hacker News

TypeScript 7

devblogs.microsoft.com

151–160 of 321 posts

Re: TypeScript 7

#151
Major ts pain point is scoping tsconfig settings for lib and types configurable for subsets of a project.

My project is a webapp, but I have node types in my ide tooling because of vite.config.ts, and playwright and unit tests. If I add a node api to a react component, tsc won't complain.

Current method to isolate dom lib from node lib requires project reference spaghetti, numerous tsconfig.json and tsbuildinfo output files, and avoiding emitting types with project references is cumbersome.

Re: TypeScript 7

#152
post #17

Earlier quoted context omitted.

I don't think ... serious people... argued that. That's a bit hyperbolic so I'm sure I'm wrong, but I have an ace: if you point me at very smart people who argued against types I'm gonna say that they weren't serious. I think it's not possible, if you have the relevant experience of working on both typed and untyped codebases of at least moderate complexity with at least one collaborator, to come away seriously belie…

I worked with people who would consider themselves serious, and are still in the industry and doing fine. A few have certainly gone on to be more prominent and get paid a lot more than I am—not that it's a perfect measure of seriousness. In the early days they would often say things like "but we have prop types, why use TypeScript", "why not use JSDoc" (this made no sense at the time), or "it's an exercise in needles…

Serious developers can make a serious argument that you can get quality production-level code with other ways besides explicit enforced type systems (eg. that if you have good enough test coverage such explicit type systems are a redundant waste of time).

Obviously "production quality" varies greatly from shop to shop, but I think there's more legitimacy to the idea than you're giving it.

Re: TypeScript 7

#153
post #104

Earlier quoted context omitted.

There's a lot of nuance to that statement. Most languages, including e.g. Java or Typescript, would not be strongly typed according to your definition, because their type system is "unsound": there are known cases where the type system does not protect you and the types are wrong. We generally still call these languages strongly typed. In Typescript this is by design. The most obvious is array variance. Typescript ma…

Okay, so I'm not crazy for thinking that declaring an empty, typed array as `const` and then writing/pushing to it is confusing/feels wrong. I didn't go to college for software engineering or anything so when I ran into that for the first time I assumed there must have been some good academic reason that was simply beyond me as to why it was done that way. It turns out that no, it's just as weird to those that do hav…

`const` in JS doesn't refer to the array being immutable, only that the variable referencing it stays the same (it can't be reassigned), so this is normal in JS.

Re: TypeScript 7

#154

the real story here is an incredible team that managed to simultaneously keep two separate codebases alive for the most advanced type system known to mankind (yeahhh yeahh Hindley-Milner eat your heart out). huge congrats to the team! looking forward to the Rust rewrite ;)

> for the most advanced type system known to mankind Honest question, what do you mean by this?

It means they really like TypeScript and they hope to influence some juniors into investing themselves into it

Re: TypeScript 7

#155
post #39

Earlier quoted context omitted.

Look at some of the typing present in MS COM back in the IE5/6 days and we can discuss more. I can honestly tell you - I'll take untyped languages any day of the week over that clusterfuck. Personally - I also think people really underestimate just how much the tooling around types has improved over the last 20 years. If I'm having to try to look up the difference between iBrowserInterface6 and iBrowserInterface5 and…

completely agree. but I felt like even then it was clear that types were a good idea and the implementations were not. For instance I started programming on Java 4 or 5 and the types were pretty bad---but still it was obviously the right way to go compared to JS or, god forbid, shell.

"even then it was clear that types were a good idea and the implementations were not"

I still feel this way about the state of the art. I want solid type support in my language ... but I do not feel TypeScript is the best possible implementation at all, and for many situations I feel implicitly typed (but still using all of VS Code's type features) Javascript is actually better than using TypeScript.

I eagerly await the day when someone actually gets a JS typing tool right and I prefer using it over raw Javascript.

Re: TypeScript 7

#156

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

people didn't argue against types, people argued against putting lipstick on a pig.

Re: TypeScript 7

#158

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

I don't recall anyone disliking types . Lots of people disliked static typing , or more directly static, explicit typing . For instance, I've been around many conversations over the years where people would say goofy things like they couldn't use Python because it's untyped. That's insane: Python is strongly typed. It's also dynamically typed, which is a different dimension. There are some genuinely untyped languages…

Last I tried, there's still often (not always) fighting with typing, mypy, pyright because of the dynamic nature you mention. I think the complaints about it are sometimes misinterpreted as "disliking types".

Re: TypeScript 7

#159
post #104

Earlier quoted context omitted.

There's a lot of nuance to that statement. Most languages, including e.g. Java or Typescript, would not be strongly typed according to your definition, because their type system is "unsound": there are known cases where the type system does not protect you and the types are wrong. We generally still call these languages strongly typed. In Typescript this is by design. The most obvious is array variance. Typescript ma…

Okay, so I'm not crazy for thinking that declaring an empty, typed array as `const` and then writing/pushing to it is confusing/feels wrong. I didn't go to college for software engineering or anything so when I ran into that for the first time I assumed there must have been some good academic reason that was simply beyond me as to why it was done that way. It turns out that no, it's just as weird to those that do hav…

I don't think that's what the comment you're replying to is saying

Re: TypeScript 7

#160

Remember when people would argue about how types weren't worth the effort? I love TypeScript, if nothing else for how it's been able to popularize types.

Now I'm just waiting for DependentTypeScript :-)
Post reply on HN