Member-only story

Should you use TypeScript if you know JavaScript well?

quisi.do
2 min readJan 7, 2020

--

In August 2019, reddit user zzstormriderzz asked this question.

Having read “You don’t know JavaScript,” by Kyle Simpson, zzstormriderzz felt that people who know JavaScript “inside and out” would not need to use TypeScript. They believed that “TypeScript is for people who want to avoid unexpected behavior in JavaScript” because “they don’t know that those behaviors are actually expected.”

I have used JavaScript daily since 2003. I prefer TypeScript. I think of TypeScript as having some unit tests built in. If I change an interface, not only will transpilation test that change to make sure all my code supports it, but my editor will run these “tests” locally and highlight the exact characters that are causing the “tests” to fail as I type.

The former is unbelievably useful for large code bases where an interface change resonates across countless files, and you are bound to forget to account for one — your comprehension of the JavaScript language does not help you here.

The latter is useful at all times. In my opinion, it speeds up development by essentially telling you what code you have to write next. It’s not a huge improvement, but it keeps you on track and wards off context shifting, such as a coworker interrupting you to ask a question. Where was I? TypeScript tells you…

--

--

quisi.do
quisi.do

Responses (1)