DEV Community

Discussion on: Is TypeScript worth it?

 
ionline247 profile image
Matthew Bramer

Not too sure, as I was working on another project; being productive. 😉

Thread Thread
 
xcs profile image
XCS • Edited

I think a lot of people think swithing to TypeScript can be done overnight with the press of a button. People forget that you still need to learn a new programming language. But once you do, it's always worth using it for projects larger than single file scripts, especially when there are multiple people working on the same project.

Thread Thread
 
ionline247 profile image
Matthew Bramer

I've been writing JS for over a decade. Still haven't needed typescript and the latest, large project I worked on, Typescript would have been a major inhibitor to velocity. Not bc itself, but due to the team's seniority.

Thread Thread
 
jwp profile image
John Peters • Edited

When compilers first came out all the folks who wrote assembly language said "We been writing assembly forever, we don't need no stinking "language".

When C++ came out many C people refused to use it.

When Java came out, non-OOP people saw no value.

When Functional programming styles were introduced in C# via the static extension methods, many established C# shops refused to use them. Why? "They chew up memory"

When LINQ came out, many didn't use it for years. Once they figured it out, they can't live without it.

When RXjs came out, many said it's too complex I'll stick with events.

When REST came out, SOAP people were skeptical.

When LESS and SASS came out, the expert CSS folks didn't need or want to adopt it.

When React came out, Angular people panned it.

When JavaScript came out OOP folks laughed at it's design. Some refused to use it (choosing server side for rendering). Once client side MVC was introduced, JavaScript became ubiquitous.

Each new generation of "things" ultimately won adopters. Most were successful, some were not (Silverlight). This means that each company adopts different "things" and if we want to work there we must learn what they have.

Typescript is only a inhibitor to velocity when the people using it have to learn it. After that, it can be argued to be faster than JavaScript due to auto-completion and catching type error before run time.

Typescript is a wonderful fit for OOP crowd as it is no different than other languages such as C# and Java in concept. Angular and React support it and many companies want Typescript people right now. Yes there is now a fractured Typescript vs JavaScript world. Why not know both?

Thread Thread
 
jwp profile image
John Peters

You are right, any new thing used in any project is ultimately a minimum of 6 months to get fluent and feel comfortable. We often say it take 1.5 years to become a real Subject Matter Expert. Most of this is easy "if you have the time". On the other hand, it's a guaranteed toxic environment when there's no time.

Thread Thread
 
ionline247 profile image
Matthew Bramer

A lot of what you said is subjective.

Typescript is great for devs that don't really want to learn JS and stick with an OOP paradigm. That's what I've seen from my experience and those devs will flourish. The question of: Why not both? Because type checking and the cost benefit is not worth it at all. The tooling that exists already is good enough and easy to implement. Why not learn JS and move away from the C#/Java-esque syntax?

I do see value in a JSDocs mashup with Typescript being of value. That way there's less C# in the JS written and you get some feedback from the type checker. That's a solid implementation imo.

medium.com/@trukrs/type-safe-javas...