On my seemingly unending job search, I’ve started to notice a trend that more companies are switching to Typescript over traditional Javascript. This seemed like a good opportunity to go over the basics and talk about the differences between the two. This post is banking on the fact that you have some knowledge of Javascript!

First things first…

  1. Typescript is not a different framework from Javascript, its a super set of Javascript! Think of it like Javascript on steroids. It offers more functionality, more specificity, and perhaps most important, more concise error handling. What does this mean? It means that if you’re dealing with larger applications, Typescript will be give you more information as to where the issue lies. Typescript needs to be able to compile before running, whereas Javascript does not. If there’s an error, you’re going to know about it!

2. Typescript takes what is considered a “loosely-typed language” and shores. it up very nicely. What does this mean? It means you have to define certain things that you don’t in typically JS. JS is happy to do some conversions under the hood for you, in order to make for a more flexible experience. Typescript, however, has no interest in those aspirations. If you’re passing in props, you’d better assign it a property type. We call this “static typing”. What is it? A string, an integer, a boolean? These things need to be defined, as if you drop an integer into a field that requires a string, its going to be trouble.

3. Typescript is going to give you a more robust experience in your IDE as well. As a user of VSCode, I’ve found that handling errors can be a bit difficult, as oftentimes you are not told explicitly the error that you’re dealing with, merely a location. Typescript is good at bridging that gap by offering more detailing in your errors. The language reads a bit more plainly and will guide you on your path to bug free coding.

4. If you’re familiar with Babel, you know that Babel can be a big help in converting JS code into code thats usable across many different iterations of its platform. Typescript has that compiler built in, so code you write in Typescript will automagically become available in older browsers.

This was a quick 1–2 on Typescript! I feel that at the end of the day the biggest thing to note is Typescript is another stopgap measure to make sure your code runs cleanly. If it forces specificity that will reduce problems in the future. It also gives you more information about where your errors lie, which can save time in debugging, and combing through code. Easy breezy!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store