A JavaScript toolset that added typing and new features in the language We’ve been enamored with TypeScript for some time now and we’ve built the technology into our daily schedule. Among beginners, there are still many doubts about what TypeScript means in practice and what are its differences with JavaScript.Those who are already more adapted to it, however, may not know details, or curiosities, relevant about the TS trajectory within the job market.Today’s content will approach a more technical conversation to try to answer some questions and understand, after all, what TypeScript impacts on our code.
The complete map for you to boost your evolution
2012
Saying that TypeScript is a language can serve to generalize its adoption and simplify the reference, however, it can be a small mistake of definition. According to Microsoft, TS is a superset — superset — of JavaScript that adds new features to the language, such as typing. That is, a set of tools built and built on top of JavaScript. It was developed by a development team within Microsoft and its first release was in 2012.It took a while to be adopted by the market, but in 2018 the technology was already disputing the podium among the most loved languages within the web development ecosystem, occupying the fourth place.
Impulse
A few things can justify the language impulse, which turns eight now in October. The definitive point to become a reference happened in 2016, when Angular, Google’s framework, decided to adopt TypeScript as the official language. This event can be illustrated in this graph from Stack Overflow — look at the growth in the number of community questions over the last four years. In 2020 TypeScript ranks second among the most loved languages, according to this survey.
Ryan Cavanaugh
According to Ryan Cavanaugh, the current lead engineer of the team that maintains TypeScript at Microsoft, in this interview for Stack Overflow, the initiative came about because some teams within the company, such as TFS and Office, wanted to create large applications using JavaScript.At the time these teams were used to statically typed languages such as C++, C# and Java.“They wanted to have this static typing available for scalability and tooling.” Rather than creating a new language from scratch, however, they decided to take JavaScript and add static typing to it for immediate use. I recommend that you carefully read Ryan’s interview for details about Microsoft’s internal decisions when developing TypeScript.
Insecurities behind the news
Beauty, TypeScript met an internal need at Microsoft and was adopted by Angular, but even so, many developers felt a certain fear to try out the new functions of the language.With the market increasingly adopting the use of TypeScript, it is normal to come with a baggage of insecurities, both for those who start programming in JavaScript and for those who are already in the development front. After all, aren’t we killing JavaScript’s advantages of being so dynamic and turning it into Java, which is static? Does the addition of these types help or hurt the creation of our project? Well, I think the most honest answer is: it depends.
Nothing is that simple around here
It’s not very feasible to say with complete guarantee that the types inserted by TypeScript in JavaScript will help you, or harm you. It’s not that simple because everything depends on relevant variables, for example: the time available for your team’s preparation and the scale that the project can take. According to the team’s own engineer, Ryan Cavanaugh, in that interview, “if static typing isn’t the right choice for you, either for your programming style or the problem you’re working on, just skip it. It’s OK. It’s ok. I won’t be offended.”
Optimize your knowledge
However, there are important considerations. We advocate using TypeScript when working in some situations where the code is open source, to avoid a hundred problems, and for projects that need to scale, to optimize large production processes.The best way to understand TypeScript is to see it as an evolution that can help you a lot in reaching new layers of productivity and creation in your development.You can check, in detail, our view on the subject in this Masterclass by Diego Fernandes, and also know, in practice, the TypeScript functions.