DEV Community

Cover image for I’ve Got 99 Problems but Learning TypeScript Ain’t One
Void⚡
Void⚡

Posted on

I’ve Got 99 Problems but Learning TypeScript Ain’t One

Why have all JavaScript developers not moved to TypeScript?

I asked this question on Twitter last week and got ~100 replies.

To all JavaScript developers who have not moved to TypeScript — Why?

Sharing my learnings from the responses, as it gives insight into what keeps developers from migrating to new tech. Even when the alternative is better.

Let’s get into it.

TL;DR

Conquering JavaScript first 👨‍🏫️

A lot of newbies and beginners gave the “I am still learning JS” response.

Understandably they don’t want to take up more than they can chew at the moment.

Most of them are interested in trying it out in future, whereas some were looking for guidance on if they should.

Vanilla JavaScript works 👌

Developers already working with JS, had a pressing question → “What’s the need?”.

They don’t plan to migrate due to having a large codebase written in JavaScript, ease of debugging, or simply because they are comfortable with JS as it gets the job done.

Their motto: “If it works, don’t touch it”.

Sorry, too soon 🕒

Some experienced JS developers have learned TypeScript in plans, but think the right time has not come yet.

Unlike developers who are not willing to migrate, these devs see value in TypeScript. Just that they didn’t get the right project yet, which justifies the learning curve.

Also, they are hoping that tooling (like support for running TS code natively in the browser) will improve in the future.

Well, it depends 🧐

Some developers have spent time learning TypeScript, but don't use it for every project.

As per them, it’s suited when:

  • Working in a team
  • Writing production apps
  • Codebase is huge

They said "For personal projects and simple apps, TypeScript is an overkill".

ECMA is getting there 🏁

Lastly, a few responses were about ECMA 6 already supporting enough modernity to write clean code in JS.

These devs suggest, if you understand JavaScript well enough with tooling built around it, you don’t need TypeScript.

Also, they are hopeful that useful features in TypeScript will eventually be included in native JavaScript so why bother with 2 learning curves.

Wrapping up 📝

Share in comments your motivation to move or not move to TypeScript?

If you liked this post, you can follow me for more of these.

Latest comments (44)

Collapse
 
vercte profile image
Vercte

I'm interested in learning TypeScript but the tooling and setup just feels like too much to handle; It's also confusing compiling in the first place.

Collapse
 
goodevilgenius profile image
Dan Jones

When I can do:

<script type="application/typescript">
  // ....
</script>
Enter fullscreen mode Exit fullscreen mode

Without any transpiling, I'll consider it.

Collapse
 
eecolor profile image
EECOLOR

@codewithvoid Interesting no one mentioned the cost of TypeScript.

Some time ago I wrote an article: We’re not writing our code in TypeScript, why?

Even when the alternative is better.

This is a tricky statement. I'm sure you could defend that position for a specific definition of the word 'beter'. But when including certain factors using TypeScript is not better.

Collapse
 
chandola22 profile image
chandola22

Language is common. The more you know, the better lewdle

Collapse
 
ismailghedamsi profile image
ismailghedamsi

I know it's a newbie mentality but I don't like the syntax and the fact that I have to install types separately in a react app

Collapse
 
mellen profile image
Matt Ellen

Type notation isn't particularly useful.

Collapse
 
h_sifat profile image
Muhammad Sifat Hossain

I haven't conquered JS yet but all of my projects are written in TypeScript. Long live Types. I can't explain how much it helps me to avoid silly and subtle bugs.

Collapse
 
jjstrat3 profile image
Jay

I could see legitimate use cases for Typescript with a Node app or API that is going be consumed by other teams within an organization, but I’ve flatly said no to a couple developers that I manage that we will not be using it in our main React-based web app. No one thus far has been able to make a compelling case as to why it would be useful enough from a cost/benefit perspective for build user interfaces when we control the structure of the data. Conversely, I’ve been involved in several projects over the years where using TypeScript was a net negative for developer productivity.

Collapse
 
leob profile image
leob

Using it on a new project now, and once you get the hang of it it just starts feeling "natural", it does not feel like a hassle/restrictive/cumbersome, you start seeing the benefits, and at some point you won't want to go back to JS - that's my personal experience. More or less learned it "on the job" gradually picking it up, not that hard.

Collapse
 
liz_flem profile image
Liz Flemmings

Typescript is not difficult to learn. Whether you use it will depend on your project. If your project is tiny, such as 2–5 pages, use JS; nevertheless, if it is large, I would suggest typescript.

I used to question why I should learn Typescript when JavaScript can do anything. I was reading through TypeScript's documentation around two months ago, and my head was racing with all the different concepts like generics and interface.

A great tool for open source projects is typescript. And how you use it is up to you. Nobody is pressuring you.

By the way, I'm currently working on a piece explaining Typescript's main concepts with some excellent examples. You may adhere to me for that (Shameless Plugin)

Collapse
 
aungmyatmoe profile image
Aung Myat Moe

Typescript is safe for runtime?
LoL

Collapse
 
tareque2742 profile image
TaReQuE HaSaN 🇵🇸

any suggestion where to learn typescript?

Collapse
 
fyodorio profile image
Fyodor

When you TypeScript you work. When you JavaScript you play. Experience matters.

Collapse
 
kgilpin profile image
Kevin Gilpin

What I like about TS is that it’s easy to adopt slowly. I didn’t have to learn any of the fancy features to get started - in fact I still haven’t learned a lot of it. Just adding basic types and classes and function type signatures has made the code more robust, quicker and easier to write and maintain, and it makes the code editor smarter as well. If I find the type system frustrating me in some way I can fall back to unknown and any - I’m not a perfectionist in that way :-)

Collapse
 
j471n profile image
Jatin Sharma

When I see the title, I remembered this line from a song-

I got 99 problems Honday oday ch plus tere nakhray ney tin so

Translation:

I got 99 problems, they are bases plus your acts are 300 (shot towards a girl).

Collapse
 
codewithvoid profile image
Void⚡

Haha yes it's inspired from a Jayz song.