First, let's talk about why you should be even interested in learning new things and how to do this. To answer the first one, naturally, knowing more allows you to do more and thus have a better life. But, what about learning, especially in the programming industry? I'm not really talking about things like coding camps, books, courses and etc., rather, about the more general approach to getting into new fields. I think that, even outside of programming, there are two edge cases that you might embrace when learning anything for that matter, depending on your personal preference - learn only a few things but well or only some parts of many different ones. Naturally, the best option would be to find the middle-ground, but it's really not that simple. I had some thoughts about this and similar stuff, while, in my free time, I was discovering the world of software engineering, i.e. stuff different than JS, that was completely unknown to me. As I was focused on JS for almost 4 years, building this "walled garden" for myself, I just wanted to try something fresh - something diverse.
Some people might tell you that you will never fully learn any programming language, even in 4 years for that matter. And, you know what? - I think that's completely true. Languages are constantly evolving, changing ("the only constant is change") and, even if one does not, the programming industry in its current state, even if significantly limited by capabilities of the given language, is still too big for one person to handle in 2, 4, or even more years of practice. But, quite frankly, that fact only further confirms my theory. Don't try to master something to complete perfection - it's impossible. You should have at least some level of diversity in your programming portfolio, and learn things that cab be different from your main "point of interest". But still, too much isn't good either and so, as I said earlier, finding the middle ground is the best and the hardest solution.
Generally, I can say that I've made quite a few good choices over my "short programming career" by now. I've chosen JS as my first language, not knowing practically anything and not guided by any tutorial and now JS is, arguably, one of the most popular and demanded programming languages out there, competing only with the likes of Python. The same goes for Vue - my framework of choice, since around 3 years now - nowadays the 2nd most popular JS framework. The most recent choice of mine? - TypeScript, which, quite frankly, exploded in popularity at the beginning of this year (2018/2019). Yet, this choice was a bit different...
I was interested in TypeScript for quite some time. Mainly because of the static typing that made me curious. Still, I didn't really want to learn it - because of time, rewrites, new things, anti-microsoftism and etc. The only thing that convinced me to go with TypeScript was the development experience and editor support it provides. In this way - I tried it, I used it, I started to like it and my private opinion flipped upside-down. Rewrites were almost completely painless, time only saved with great tooling, and anti-microsoftism was proven wrong with all OSS goodness that Microsoft has done in recent times. But, most importantly - I learned something new.
Slowly, but successfully, I'm getting to the point here - does learning TypeScript gives you anything more, beyond improving your web development comfort? The answer is yes - and it comes in the form of static typing.
The technique of static typing is often used in many different programming languages. It also requires a deeper understanding of types and some inner language-related concepts that can often be omitted in the learning process of beginning JS developers, because of language dynamically-typed nature.
With everything that was previously said, I'd like to make a quick rundown of how the knowledge of TypeScript helped me catch up with two new languages in my portfolio - Java, and C++.
Firstly I focused on C++, as it was the more complex one, with low-level concepts such as pointers and other stuff. Then, Java came in. It's a sure thing that I didn't mean to spend the same amount of time with any of these languages, as I did with JS (at least for now). I just had some free time and wanted to learn some new concepts to be a better programmer. Also, I planned to learn these to later learn and play with their "modern counterparts", in form of Rust and Kotlin.
Beyond new concepts, learning a new programming language doesn't require much more. If you've already practiced the art of problem-solving and ways of writing fine code, may require as little as just a mind-switch in terms of syntax. But, going straight from dynamically to statically-typed language could be quite a headache. Types might just seem unintuitive at start to those coming from the dynamic background, effectively making the process of learning them (and thus a lot of different languages too) much harder.
TypeScript helps to solve this issue by providing a static type system over something that's already known to dynamic-typed-languages-only programmers. This allows for a smooth transition from a language like JS, through TS, up to a completely new world of possibilities!
If you're a web developer, struggling with the choice of whether to embrace TypeScript or not - I hope that this article helped you make your mind. The use of TypeScript can lead to a lot of other benefits, development experience and type-safety aside. That's why I really encourage you to try it out. And, for those of you who already use it - good for you!
Also, keep learning and broadening your horizons. And, while doing that, remember to find the right balance. Some diversity is always good - sure thing! But, like everything in life - too much isn't good either.
So, what do you think of this article? Let me know in the comment & reaction section below! Also, if you like it, consider sharing this article, and following me on Twitter, on my Facebook page, or through my weekly newsletter for more content like this one. As always, thank you for reading this one, and have a great day!