DEV Community

Discussion on: TypeScript vs JavaScript🤔

Collapse
 
josunlp profile image
Jonas Pfalzgraf

For me, the whole concept of TypeScript feel so much more like working productively than JS. This might change with the recent developments in ES2022 and ES2023, since many of TypeScript's loved structures (sadly not the Type System) find their way into common JS syntax.

Collapse
 
peerreynders profile image
peerreynders

the whole concept of TypeScript feel so much more like working productively than JS

That's only half the story, the perspective of the application developer.

"Publishing an extensible package with good TS support is hellish."

Collapse
 
josunlp profile image
Jonas Pfalzgraf

If you write your package in TS it's just super easy.

Thread Thread
 
peerreynders profile image
peerreynders

So writing Redux from scratch in TS would be easy?

Perhaps try it yourself and then maintain it long term to see if you can say that with a straight face.

Even maintainers of libraries written from scratch in TS report that types significantly increase their maintenance burden.


Learning and Using TypeScript as an App Dev and a Library Maintainer

Thread Thread
 
josunlp profile image
Jonas Pfalzgraf

The big problem most of the time is, that most developer's dont do a complete rework of the code. They built a js to TS support. Typescript uses different Development patterns then JS. So if you try and work your types alongside with your js code, yes its super messie and hard to maintain. For example Angular and Vue did that big step with a major release and rewrote the entire framework in TS

Thread Thread
 
peerreynders profile image
peerreynders

Typescript uses different Development patterns then JS.

If that were true, we could have had a much better language to begin with … like ReScript.

Unless of course your idea of better is "web development with C#".

"TypeScript began its life as an attempt to bring traditional object-oriented types to JavaScript so that the programmers at Microsoft could bring traditional object-oriented programs to the web."

[TypeScript for Functional Programmers]

Collapse
 
josunlp profile image
Jonas Pfalzgraf

And yes, from the perspective of a package developer