6 Reasons Why You Should Learn TypeScript in 2021
Tags: javascript, typescript, beginners, webdev
Published: 2021-01-02 15:07:46

*This post was originally published at [kais.blog](https://kais.blog/p/6-reasons-why-you-should-learn-typescript-in-2021).*

**Let's move your learning forward together!** [Follow me on Twitter](https://twitter.com/intent/follow?screen_name=kais_blog) for your daily dose of developer tips. Thanks for reading my content!

---

Woah, please wait a second. You are expecting 6 reasons why you should learn TypeScript in 2021. But, did I mention that TypeScript is basically just JavaScript on steroids? So, before reading this post, you should take a look at [7 Reasons Why You Should Learn JavaScript in 2021](https://dev.to/kais_blog/7-reasons-why-you-should-learn-javascript-in-2021-7lg). If you already know about JavaScript, just keep on reading.

---

# TypeScript is JavaScript on steroids

Yeah, I've said it again. But it's true. TypeScript is a superset of JavaScript. This basically means it's a layer on top of JavaScript that adds many awesome features. So, if you know JavaScript or you'd like to learn it - you can transfer this knowledge to TypeScript. And vice versa. More or less every reason about [why you should learn JavaScript in 2021](https://dev.to/kais_blog/7-reasons-why-you-should-learn-javascript-in-2021-7lg), applies to TypeScript as well.

---

# TypeScript is loved by developers

Looking at [StackOverflow's Developer Survey 2020](https://insights.stackoverflow.com/survey/2020/#technology-most-loved-dreaded-and-wanted-languages-loved), you'll find that TypeScript is #2 of the most loved programming languages. The awesome syntax combined with JavaScript's huge ecosystem contributes to this. But, many things people hate about JavaScript don't apply to TypeScript. That makes for a really enjoyable developer experience.

---

# TypeScript helps avoid painful bugs

JavaScript is sometimes quirky. With TypeScript's type checking system, many bugs (or features?!) are avoidable. Countless errors have occurred because you were expecting a number but a string was passed. If you are using TypeScript, this is a thing of the past. TypeScript's type system is one of the most advanced type systems you'll ever come across. And with the usage of [utility types](https://dev.to/kais_blog/11-awesome-typescript-utility-types-you-should-know-4a8j) you can go even further.

---

# TypeScript needs less code

TypeScript's language features are awesome. You'll need less code to achieve the same or even better results. The type system lets you remove many type guard clauses in your code. Also, TypeScript adds many cool features such as optional chaining (`?.`) and nullish coalescing (`??`) before they are generally available. This means you can write the JavaScript of tomorrow today.

---

# TypeScript makes the switch easier

If you are coming from a traditional developer education, you probably have learned C# or Java. At least, those two are the dominating languages here in Germany's education system. Nevertheless, if your background involved more statically-typed languages, you'll feel much better using TypeScript instead of JavaScript. In my opinion, it felt even better than using C# and Java.

---

# TypeScript is completely optional

Everything in TypeScript is optional. You can still write dynamically-typed code if you want to. You don't have to use interfaces, the typing system or some other awesome new language feature. Yet, those features are always available at your fingertips. Maybe some part should be statically-typed, some other part should be dynamically-typed. With TypeScript, you can. Besides, the configuration file allows you to tell the compiler how it should behave. In the end, it's still JavaScript.

---

# Conclusion

TypeScript's popularity is on the rise. It takes the good parts of JavaScript and adds some awesome sprinkles on top. So, if you are learning a new programming language in 2021, why not try TypeScript? It might be overwhelming at first, but it's worth it in the long run. And remember, each reason [why you should learn JavaScript in 2021](https://dev.to/kais_blog/7-reasons-why-you-should-learn-javascript-in-2021-7lg) also applies to TypeScript.

---

**Let's move your learning forward together!** [Follow me on Twitter](https://twitter.com/intent/follow?screen_name=kais_blog) for your daily dose of developer tips. Thanks for reading my content!

*This post was originally published at [kais.blog](https://kais.blog/p/6-reasons-why-you-should-learn-typescript-in-2021).*

---

Cover Background Image by [@joshuaearle (unsplash.com)](https://unsplash.com/photos/C6duwascOEA)