Is there a place for TypeScript in your programmer career?

Personally, I'm a big fan of TypeScript. I talked about it in a number of my previous posts. I truly enjoy the development experience, code hints, type-safety and all other benefits of this statically-typed JavaScript remix. With that said, TS (obviously) isn't perfect. Of course, it has some disadvantages, related both to itself, and the general group of statically-typed programming languages that it represents. Anyway, that's a whole different story. Instead, in this post, I'd like to take a bit closer look at what TS might give you as a rising (learning) programmer, aiming to self-develop, learn, try out different things and broaden your horizons.

Learning things

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.

Web development

The amount of new information, when learning likes of C++ made me thinking - how much I really learned throughout the last 3-4 years? I learned JavaScript to pretty high extend, tried some frameworks, Node.js, some raw front-end & back-end... and TypeScript. Yeah, that was the one and only thing that was somewhat different from all other JS-related stuff. But, only in a small degree. So, was it worth it?

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.

Static typing

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 beginning of one's programming journey is very important - maybe all paths will lead you to the same place, but the paths themselves will be completely different. What I mean by that is that one who chooses JavaScript as his first language will process a bit differently than the one who chose e.g. C++. And, for the first group, TypeScript might be the blessing, that allows them to learn new languages like Java or C++ much, much easier!

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.

Possibilities

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++.

Java and C++ are both very popular and well-established languages, with more than 2 decades of development each. But, also, they're very different from each other, as well as from JavaScript. Both have a different purposes in mind and work differently.

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!

Interested?

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!