Should I learn Javascript before learning Typescript?
Lebogang Mabala / Nov 22, 2021
Javascript is known as the language of the web. With over 97% of the web built on Javascript, it is natural for people to think that they should learn it if they want to start with web development.
Outline#
Decision Fatigue#
As many of us have realised, there is a lot of decision fatigue when entering web development, especially as a beginner. With so many frameworks and libraries to choose from, it can sometimes be daunting to start.
What should I learn?#
Should you learn Javascript before Typescript? The quick answer is no. However, like most things in life, it depends. Before I ventured into web development, I had experience using Java and C#, two statically-typed languages. The fun began when I started using Javascript. I almost instantly had problems because I was approaching it with a Java mindset. Classes in Javascript were not as commonly used in their current form.
null
undefined
A lot of my previous google searches about the language were primarily out of frustration. Mainly because of the freedom and somewhat lack of structure, opposite to what I was used to. Along came Typescript, with some structure and a little bit of consistency. I know I haven't answered the question, but I will get to that in a moment. There are things you need to consider before making this decision.
Javascript Considerations#
- You're following a tutorial that primarily uses Javascript
- You are used to dynamically-typed languages
- Looking to move quickly (easier to get started)
- No compilation needed depending on setup
Typescript Considerations#
- You are indirectly learning Javascript, with some benefits
- Willing to spend a little more time dealing with typing issues
- Experience with statically-typed languages (not equivalent, but it helps)
- You already have Javascript anxiety
- Willing to deal with some support issues from some npm packages (This is fast becoming a none-factor)
Conclusion#
If you are not in a hurry and are willing to deal with the pain points of learning Typescript (recommended), then Typescript is the way to go. Looking to hack up something quick from a good tutorial online that does not support Typescript? Learn Javascript, the skills are transferable to the former. The community is headed towards more Typescript adoption and a lot of new projects are Typescript first.
Resources#
Suppose you want to learn some typescript from scratch. Check out my Typescript Essentials on youtube.