Interview: Is TypeScript becoming the new standard?

by | 4 Feb 2021 | Web Expertise

Today, JavaScript and TypeScript are among the most popular languages in the development world. These two programming languages are mainly used to develop web applications, but recently, the popularity of TypeScript technology has been increasing among developers. Explanations with Thomas Delcros, senior developer at theTribe.

How would you define TypeScript?

TypeScript is an open source language created in 2012 by Microsoft, allowing static (optional) typing of data. The TypeScript code is transposed into JavaScript, which allows its execution by any JS engine (in a browser or a NodeJS server for example). TypeScript is often defined as a "syntactic extension" to JavaScript, in the sense that it increases the power of the code by providing static data typing.

The main reason for its development is that JavaScript can show some limitations when projects last and "grow" over time as there is more and more code to manage. It becomes more and more complicated to navigate the data flows as the amount of data flowing through an application increases.

The TypeScript language answers two problems that any team wishing to maintain a program faces, by adding new functionalities : 

  • How can I ensure that the data passing through my app is predictable? 
  • How can I be sure that my implementation evolves along with my data?

Why are developers using it more and more? And in your opinion, is it likely one day to surpass JavaScript? 

TypeScript is indeed a growing success with the JavaScript community for several reasons.

First of all, his learning is very incremental. Since all JavaScript code is valid TypeScript code, this allows developers who are familiar with JavaScript to configure the compiler in a permissive way, so that they are not blocked by all the strict TypeScript typing rules. This approach leads to easier adoption by developers, who will not feel they have to relearn everything.

The second reason is that beyond typing the code, TypeScript allows to document the code produced, and thus facilitate its readability and understanding. It will be easier for a developer to join an existing TypeScript project, because he will quickly be able to know what this function takes as a parameter and what it returns (without having to guess, which is often the case in JavaScript). ​

Finally, TypeScript's ecosystem is now very mature. Many development tools ( IDEs for example) integrate extensions for developing TypeScript applications, and will therefore offer a more advanced experience to developers (visual alerts in the code at invalid places, faster typing thanks to data inference). The growing community also provides ongoing support for problems that developers, novice or not, may face. External libraries are increasingly written in TypeScript, which allows them to be easily integrated into applications, keeping end-to-end typing (Typescript also supports `DefinitelyTyped`, which is an open-source project to type untyped libraries).

What are the benefits for start-ups to privilege TypeScript rather than JavaSript in their projects?

The advantage of TypeScript, as mentioned above, is therefore mostly for the developer.

The choice of TypeScript over JavaScript will allow to remove some software anomalies earlier in the development phase, and to secure the code, before going into production. In fact, thanks to stricter rules, the TypeScript language will make it easier to manage and anticipate special cases, which the team would not have thought of spontaneously, by forcing developers to take them into account so that the code produced is valid. This saves time in the development of features, and avoids integrating bugs without realizing it in a program.

TypeScript also proves to be very useful and powerful when it comes to code refactoring or refactoring. If a code module changes its behavior, the development team will be automatically alerted, wherever that module is used and implemented. The team will therefore be more serene and secure in the redesign, thus improving the maintainability of a project over time.

As mentioned above, the fact that the code is more readable and easier to understand makes it easy to board new developers to a project, and reduces the cost of entry (which can be quite huge on large-scale projects).

The advantage for a start-up will also be to be able to attract more experienced and rigorous developers within their company, and thus increase the quality of the applications produced and internal projects.

The image TypeScript enjoys in the wider JavaScript ecosystem is one of quality and robustness of programs. However, this increase in quality comes with a learning cost for teams of developers who are not already familiar with it. The interest of Typescript will therefore be less if the final objective of the application is a POC (Proof of Concept), or a short-term project.

Download the Tech Trends 2021 Guide
Florian Compain

Florian Compain

Chief Marketing Officer @theTribe

Why don't we talk?