TypeScript 101 Introduction πŸ˜ƒ

TypeScript 101 Introduction πŸ˜ƒ

A brief introduction on Typescript, answering the most common questions before to dive in with the 101 series.

Β·

3 min read

Hi Everyone as you read from the title of this article this is the first of many that will introduce you in the types world with TypeScript, the road is long and difficult but you will get there eventually.

Let's dive in and find out what a h.. is TypeScript, shall we?

What is TypeScript??

Typescript is a programming language and for who don't know was developed and maintained by Microsoft. It is not a new programming language, it is a language building up on JavaScript that adds new features and advantages to it, it makes writing JavaScript code easier and more powerfull.

Typescript is known as Superset of JavaScript that as everyone says takes JavaScript to the next level adding an additional layer on top of it called the Typescript type system.

The downside πŸ‘ŽπŸ» of TypeScript is that it is not compiled by any of the web browser so the code that we write in TypeScript it will be Transcompiled to javascipt and then compiled to the browser, also add a little bit more code to write that at the start can be a bit tedious.

Transcompiled or transpiller basically means that our TypeScript code will be translated in Javascript.

Why Shoul I Use it

So why should I use it if everything would be translated in javascript anyway?

Well there are many reason why you would prefer to use Typescript,

  1. It is perfect for large applications,

  2. It is super easy to spot bugs and type errors,

  3. It add a sort of documentation to your code making it easy to read for yourself and other developers,

  4. Gives you an idea of how programming laguages like C, C++ and Java works with the built in type system.

  5. It is nice to have on your Resume for future employments.

How will improve my coding skill

Well this is just my opinion but I believe that writing an application in TypeScript even if it is a small app will eventually level up your types skill writing cleaner code and will also help you one day if you decide to learn C++ or C# for maybe Game development or just in general😁

How difficult is to learn

Learning TypeScript at the beginnig is quite frustrating, it will definetely slowing you down but the reason why you are learning it, it is not to write code faster but to write it better. You will be adding types definition to pretty much everything and this will take time of course but when you get the hang of it you will see how rewarding will be in the long run.

Remeber though to add the "Strict mode" to make things even more difficult, the more difficult is at the beginning the more easier and faster you will see the benefit of it.

It is like everything in life the harder is the road a the start the easier will be at the end.

When should I use it

Use Typescript as much as you can at the start, but then I would use it only for large applications where it is not only you to work on the project.

Conclusion

Learning Typescript is not like learning a new programming language, there is not new syntax involved or if there is it is minimal. The hard part is getting used to defines types for everything, but if you have a good JavaScript knowledge it is just a matter of practice. Let's say one day you want to move to game development you will have to learn c++ or c# and knowing TypeScript will be a big advantage Because they are base types programming languages.

I Guess as brief first introduction it's all, with the next posts we will be having a look closly at all the features that this language as to offer, and you will see the benefit of using it.

The way is long so stay tuned 😎