What is TypeScript?

Douglas Roark
3 min readAug 10, 2021

Typescript in the simplest terms is an extension or superset of Javascript and adds optional static typing, classes, and interfaces to the language. The language is designed for large application development and compiles to readable, standards-based Javascript. With a large-scale Javascript project, using TypeScript could result in more power without writing additional code. All the code you write in Javascript is also valid TypeScript code. Additionally, your TypeScript code is transformed into JavaScript by the TypeScript compiler or Babel.

With TypeScript, there are great advantages while working with an IDE. The IDE is informed in real-time by the TypeScript compiler because of its type information. This allows you to safely refactoring things like names across your whole codebase. Errors are reported directly in the IDE as you code for an extremely user-friendly experience so you can catch errors as they happen.

This can be easy and also tough to learn and write at the same time. The easy part is working with your run-of-the-mill things in TypeScript because as long as you are somewhat knowledgeable with the variables, functions, and everything you are using to write it can be simple and the code will start to flow and will be no problem at all. What can really turn out to be a tough part with TypeScript is when you are dabbling with new things you are not familiar with and or if you are trying to take advantage of a library you maybe be importing to implement in your code. Now firstly, the dabbling with new things is only going to be as difficult for as long as it takes you to pick up and learn new things and it's just as simple as that. Secondly, the importing libraries to implement in your code could prove to just basically be a toss-up on how difficult it will be. It all comes down to if they have built out the library to be TypeScript ready and if not just how familiar you may be with the library you are using. I suggest just doing your due diligence with a little research and that can go a long way to mitigate headaches that may arise.

Also through code completion, you will be offered inline suggestions for what you may want to write from whatever libraries are available to you. This can be an amazing time saver and helpful for those who know what they want to write but may have names of things slip their mind from time to time. I suggest using this feature with a bit of wariness, at least in my experience is the best way to learn and keep your coding skills sharp is just by coding. So make sure you never get too comfortable and start to let your skills rust by taking shortcuts all the time.

Knowing JavaScript is a must for learning TypeScript. TypeScript shares syntax and runtime behavior, so everything you know in JavaSript applies in TypeScript, and learning JavaScript has massively more options out there than TypeScript. If you already know your JavaSript and think you already have a well-rounded knowledge of it, then the official TypeScript website has some amazingly fleshed out and easy-to-read docs that with help you to learn or solve most problems you may be having while learning it. So definitely head over there for all the information your heart may desire and get to coding!

--

--