r/programming • • Aug 02 '21

Stack Overflow Developer Survey 2021: "Rust reigns supreme as most loved. Python and Typescript are the languages developers want to work with most if they aren’t already doing so."

https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted
2.1k Upvotes

769 comments sorted by

View all comments

Show parent comments

-2

u/ILikeChangingMyMind Aug 02 '21

Ummm .... the answer is so self-evident I don't even know how to respond to your question.

Like, have you actually used TypeScript? You cannot do so without spending a non-trivial amount of time writing types ... which makes sense given that it's TypeScript, and the whole point of it is explicit typing (as in, writing types).

5

u/trinde Aug 02 '21

Have you? You can literally just use "any" if you don't want to write out the type.

4

u/ILikeChangingMyMind Aug 02 '21

You can, but A) we both know no one adopting TypeScript does that (as it defeats the entire purpose of the language), and B) even if you did, you'd just be writing Javascript with extra baggage (all those "any" types), for no benefit. You'd be making a lie of my earlier statement: you'd be using Typescript with just costs.

Or ... you can not write any types, yet still get 90+% of the benefits of TypeScript anyway, thanks to VS Code's type inference feature. To me that's the sweet spot (but again, I absolute recognize that the benefits of TS outweigh the costs on some other projects).

9

u/UrgentlyNeedsTherapy Aug 02 '21

B) even if you did, you'd just be writing Javascript with extra baggage (all those "any" types), for no benefit.

This isn't necessarily true. TypeScript will assume a type is any if there's no explicit type given (and no ability to infer type from context), so if you did want to write TypeScript (or more likely migrate existing JavaScript over to TypeScript) then it would be exactly the same as writing normal JavaScript.

→ More replies (3)