All Aboard the TypeScript Train?
Tags: beginners, javascript, flatironschool, typescript
Published: 2019-05-31 18:18:45

---
title: All Aboard the TypeScript Train?
published: true
tags: beginner,javascript,flatiron-school,typescript
canonical_url: https://medium.com/@katiecarrel/all-aboard-the-typescript-train-9e46786de979
---

> “If you know JavaScript, you already know TypeScript” — Anders Hejlsberg

![](https://cdn-images-1.medium.com/max/660/1*pc4MAgzgiPnN-DN4YdKd9w.jpeg)<figcaption><a href="https://www.reddit.com/r/ProgrammerHumor/comments/ax9r6f/typescript_be_like/">https://www.reddit.com/r/ProgrammerHumor/comments/ax9r6f/typescript_be_like/</a></figcaption>

As a fledgling developer taking flight for the first time I have found it incredibly easy to get fatigued from finding different framework or tech that I would like to dip my toes into. Part of my learning process is figuring out where to divide and invest my available time into picking up technologies not necessarily covered in the Flatiron School curriculum. As we have been tackling JavaScript in Module 3 I have been spending some time looking into industry trends with regards to JS and keep seeing “TypeScript” come up time after time. So what is TypeScript and should I devote time in my student developer journey towards it? (Spoiler alert: All signs point towards yes).

### JavaScript Shortcomings

![](https://cdn-images-1.medium.com/max/1024/1*tdGYsK2KbWh1mUQsd6h_HA.jpeg)<figcaption>Accurate representation of my experience with JavaScript</figcaption>

![](https://cdn-images-1.medium.com/max/1024/1*mFa28sxMUSRtrsfPcA_xjw.png)<figcaption><a href="https://github.blog/2018-11-15-state-of-the-octoverse-top-programming-languages/">https://github.blog/2018-11-15-state-of-the-octoverse-top-programming-languages/</a></figcaption>

Javascript is undoubtably incredibly popular. Github’s “State of the Octoverse report” which provides trends and insights into Github activity has consistently had JavaScript ranked as the number one most commonly used language in Github projects. However, this juggernaut popularity hasn’t stopped JavaScript from simultaneously being The Worst™️ to learn and use.

Working with JavaScript can sometimes feel like dealing with an unruly toddler in that sometimes it acts out and behaves in ways that just baffles you. For reference — [Gary Bernhardt’s infamous “Wat” talk](https://www.destroyallsoftware.com/talks/wat). JavaScript is a weakly typed language which often seems to translates to “loose rules which produce wild code killing errors”! JavaScript code can also fail silently and tracking down the culprit can be painstakingly time consuming.

It seems that a large opinion in the developer community is that JavaScript has so many of these delightful little quirks that additional tools such as transpilers or frameworks are needed to help developers actually use the language without tearing their hair out. That sounds about right to me considering the first version of the language that would become JavaScript was written in [10 days](https://thenewstack.io/brendan-eich-on-creating-javascript-in-10-days-and-what-hed-do-differently-today/).

Quirks and dead horse beating memes aside, JavaScript is a dominant programming language that is used in an estimated [95.1% of all websites](https://w3techs.com/technologies/details/cp-javascript/all/all) and is likely to hold that distinction for a while. As such, it’s important to learn the language and find tools that help the language work with you rather than against.

### What is TypeScript and why should I use it?

TypeScript was developed in 2012 by a Microsoft team helmed by Anders Hejlsberg (also the lead architect of C#). This open source tool is available on GitHub and is lauded as “JavaScript that scales”. TypeScript is the solution to some of the most frustrating shortcomings of JavaScript. It is a superset of JavaScript that compiles to JavaScript meaning that it is not a new language all together (like some of it’s competitors) just an extension of JavaScript that is better suited for application scale JavaScript development. TypeScript builds on the foundation of JavaScript and fills in the cracks of a weakly typed language like Javascript. The TypeScript compiler and compiled code can be used on any browser, host or OS. TypeScript is great for catching bugs early and assisting JavaScript developers become more efficient.

- The TypeScript transpiler has an error-checking feature which helps to highlight errors before the script is run and supports source level debugging.

![](https://cdn-images-1.medium.com/max/1024/1*oeKgDE1ubBXbNo2oBVirWg.png)<figcaption><a href="https://medium.freecodecamp.org/typescript-javascript-with-super-powers-a333b0fcabc9">https://medium.freecodecamp.org/typescript-javascript-with-super-powers-a333b0fcabc9</a></figcaption>

- IDE support
- Optional type inferencing and static typing
- Ease of coding, compiling and refactoring
- Open source with a robust community (76,000+ questions on StackOverflow)
- [Growing industry adoption](https://www.typescriptlang.org/community/friends.html)

### Example TypeScript to JavaScript

![](https://cdn-images-1.medium.com/max/1024/1*PpMKPBiMdgkJnr87hZLFng.png)<figcaption><a href="https://www.tutorialspoint.com/typescript/typescript_quick_guide.htm">https://www.tutorialspoint.com/typescript/typescript_quick_guide.htm</a></figcaption>

### Compile and Execute in Four Steps

![](https://cdn-images-1.medium.com/max/1024/1*uQFfkSgV7JdwzTsnwZ2hTQ.png)<figcaption><a href="https://www.tutorialspoint.com/typescript/typescript_quick_guide.htm">https://www.tutorialspoint.com/typescript/typescript_quick_guide.htm</a></figcaption>

### TypeScript Takeover?

As previously mentioned, Github posts an annual “State of the Octoverse” which reports which programming languages are being most used on the website and thus are highly reflective of industry trends based on developers. TypeScript has been listed as the third fastest growing language based on survey respondents in 2018.

A particularly interesting and recent industry signifier is that Jest (a facebook developed JavaScript testing tool) is [reportedly migrating from using Flow](https://github.com/facebook/jest/pull/7554#issuecomment-454358729) to TypeScript in their next release. Why is this significant? Flow is a facebook developed static type checker and direct competitor to TypeScript. In the conversation of rising TypeScript popularity Flow was always inevitably mentioned. It would appear that Facebook saw the writing on the wall in terms of industry tide and are looking to jump ship to the superior product.

- [46% of npm survey respondents reported using TypeScript](https://blog.npmjs.org/post/180868064080/this-year-in-javascript-2018-in-review-and-npms)
- [TypeScript at Lyft](https://eng.lyft.com/typescript-at-lyft-64f0702346ea)
- [TypeScript at Slack](https://slack.engineering/typescript-at-slack-a81307fa288d)
- Vue 3 is being written in TypeScript
- Babel supports TypeScript

### References

Overview from the creator: [https://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript](https://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript)

TypeScript documentation: [https://www.typescriptlang.org/docs/home.html](https://www.typescriptlang.org/docs/home.html)

Experiment with Typescript: [http://www.typescriptlang.org/Playground/](http://www.typescriptlang.org/Playground/)

Quick TypeScript overview: [https://learnxinyminutes.com/docs/typescript/](https://learnxinyminutes.com/docs/typescript/)

TypeScript in 2019: [https://medium.com/@jtomaszewski/why-typescript-is-the-best-way-to-write-front-end-in-2019-feb855f9b164](https://medium.com/@jtomaszewski/why-typescript-is-the-best-way-to-write-front-end-in-2019-feb855f9b164)