In the web development space, trends follow each other and are not always alike. When the shortcomings of a well-established stack become too inconvenient, alternatives appear and sometimes pass from the status of novelty to that of an unavoidable trend, before being inexorably replaced in their turn.
Among these trends, TypeScript is certainly one of those technologies that raise the most questions.
In short: YES, you should learn TypeScript when you are a JS developer!
Now, let’s get to the explanations…
TypeScript: What it is and why should I care?
TypeScript is a programming language whose first public version (0.8) was released in October 2012 after two years of internal development at Microsoft.
By default, TypeScript compiles to ECMAScript 5 (JS version from 2009, the current standard supported by modern browsers) but can also target ECMAScript 3 (1999 version supported by all browsers) or ECMAScript 2015 (version 6, not supported by the Internet Explorer).
What are the benefits of learning TypeScript?
TypeScript is a language whose mastery is increasingly sought after by companies. This growing popularity is easily explained by the considerable advantages that TypeScript brings.
TypeScript makes development easier and improves the developer experience
If a value of a certain type is assigned to a variable (or as an argument of a function) defined as being of another type, an error will be generated during compilation and the program cannot be executed.
There are many different types, the most common of which in programming are: Number ( int for integer, float for decimal), a Character string ( string ), Table ( array ), Boolean ( boolean )… Some do not exist in TypeScript, but this language offers other advanced types such as Any & Unknown, Void, or Never. You can read more about these types in the TypeScript documentation.
TypeScript will make you a better developer
Although optional, the static typing of variables and functions supported by TypeScript allows you to define specific data structures early in your app development. This imposes a framework and rules that will have to be respected and thus pushes for a more coherent design of the application as a whole while limiting the risks of breaking by making significant changes in the code.
Learning TypeScript is also a great way to nurture yourself with programming concepts you may not have known before. Beyond types, TypeScript also uses other notions:
Already present in other statically typed programming languages such as C++ or Java, becoming familiar with these concepts will make it easier for you to tackle other languages in the future if you wish.
TypeScript is easy to learn and has an active community
TypeScript is used and supported by the most advanced tech companies such as Microsoft, Google, Airbnb, Shopify, Adobe, and Mozilla. Since these companies are obviously used to deploying huge, extremely complex applications on a very large scale, one can only be convinced of TypeScript’s ability to guarantee scalability, optimal reliability, and performance.
The adoption of TypeScript by these technology leaders has helped popularize this language and federated a large and very active open source community that publishes a large number of educational resources and tools.
GitHub Octoverse also places TypeScript in 5th position among the languages with the fastest growth between 2018 and 2019 (161%) ahead of Python (151%) and Go (147%).
For corporate projects, Microsoft has even published a guide to switching to TypeScript discreetly without anyone noticing, and therefore without having to convince your colleagues.
TypeScript does not fix all problems
Its power and especially its reliability are thus proportional to the rigor with which the developers will use it. Its use also does not dispense with setting up unit testing and functional testing.
Is it relevant to learn TypeScript in order to have a better CV?
As we’ve seen; many companies have moved to TypeScript, including the biggest tech leaders. This skill is increasingly demanded by job offers. For example, about 1100 job postings on Indeed France referred to TypeScript in September 2020, almost as many as those referring to Node.js (about 1200). Learning TypeScript today is also an opportunity not to be missed: it is still early enough to be in the “ early majority ” and acquire a skill on your CV that will continue to be valued.
Get Exclusive Online Business Guides and Tips That I Only Share With Email Subscribers