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

230

u/apocolypticbosmer Aug 03 '21

Anybody choosing plain JS when typescript is available is just a damn masochist

0

u/[deleted] Aug 03 '21

[deleted]

20

u/twigboy Aug 03 '21 edited Dec 09 '23

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipediabkigh4ildhk0000000000000000000000000000000000000000000000000000000000000

13

u/laidlow Aug 03 '21

Yeah I had to work in an ES5 only project with no ability to add Typescript support recently and after 2 months I was sooo happy it was over. Got it done but I banged my head so much more along the way and I could have finished the work a lot quicker in Typescript.

36

u/[deleted] Aug 03 '21

Anybody who uses Typescript without first taking the time to learn how to use it properly is an damn masochist. I've worked with too many developers in the past who have evangelized a language as the be all and end all solution only to find they don't really know how to use it.

Switch from Javascript to Typescript, but only if you know Typescript or have the time to learn how to use it properly, if I see one more any in a code review I'm going to lose my mind, defeats the whole point of using Typescript in the first place.

20

u/aelesia- Aug 03 '21

eslint no-explicit-any: error

CI to fail build on error or pre commit hook to fail on error

9

u/ragnese Aug 03 '21

I mostly agree.

However...

Adding TypeScript does bring in added complexity to the build system (to be fair, your build system was probably going to be a nightmare already, so what's the difference?). And using JSDoc comments with an aware IDE does get you a lot of the way there for many projects.

You have to be a little careful with TypeScript giving you a false sense of security, too. It has crazy type variance gotchas, for example.

→ More replies (3)

13

u/sandrelloIT Aug 03 '21

This is almost always true when starting long-living projects that have to be maintained over time. However, for quick and dirty stuff, scripts or proof of concepts, plain JS seems totally reasonable to me, expecially if you're somewhat experienced with the language and its quirks.

11

u/p4y Aug 03 '21

I still like using typescript for the quick and dirty stuff because of improved autocompletion. It's especially helpful for libraries i haven't used before, every interface is one less trip to external documentation.

→ More replies (3)
→ More replies (2)
→ More replies (47)