Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Compare the lines of code (on Github, say) written in straight Javascript and the lines of code written in Typescript.

I do not think the demand is quite as huge as you think it is.




Every TypeScript project is going to have at least an equivalent amount of JavaScript code sitting in the repo from the output of the TypeScript compiler.


most people don't version control the output of their compiled build though.


This is like saying compare the lines using generators or proxies vs the lines using type annotations.

Just because a feature is not widely adopted it doesn't mean that is not useful to the people using it, especially when the feature is used to mitigate the entire "cannot find property of undefined" type of errors.


In the linked article, the author spends 1 sentence dealing with objections:

> I can understand if JavaScript developers are afraid of TypeScript taking over their language. However, this proposal will be as far as things will go w.r.t. adding TypeScript features to JavaScript

And in the next few sections it includes someone who wants to build on the proposal including using type hints to optimize code. I just think there's literally no way to guarantee that "this will be as far as things will go". Yes languages evolve and add new things all the time. But GP's point is that the language seems to be going toward what people want it to be coming from other languages.

I agree, stop trying to make JS something it's not.


> And in the next few sections it includes someone who wants to build on the proposal including using type hints to optimize code.

This changes literally nothing about the JS language. JS engines already attempt to determine the types of things to optimize the code they generate. Type annotations would just allow them to make more aggressive optimizations.


> This changes literally nothing about the JS language.

Besides adding a bunch of new syntax, of which JS already has far too much.


> Just because a feature is not widely adopted it doesn't mean that is not useful to the people using it

But it does mean there likely isn't a "huge demand", which was the original claim.

You're attempting to move the goalposts here.


I'm not sure that's a useful metric.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: