• Why TypeScript Is Growing More Popular
  • Mary Branscombe
  • The Nuggets translation Project
  • Translator: loveky
  • Proofreader: Aladdin-ADD Germxu

Why TypeScript has become so popular?

Why is TypeScript so popular? Many major development frameworks rely on it, and it can improve developer productivity in the ever-changing world of JavaScript.

Recent Stack Overflow developer surveys and annual RedMonk programming language rankings show that TypeScript, the Microsoft open source project that combines advanced JavaScript features with static type checking and tools, is reaching new heights of popularity. By providing JavaScript with the most basic checking syntax, TypeScript allows developers to type check their code, which can expose bugs and improve the structure and documentation of large JavaScript code bases.

9.5% of the developers surveyed by Stack Overflow are using TypeScript, making it the ninth most popular programming language, ahead of Ruby and twice as popular as Perl. The respondents in the Stack Overflow survey were diverse and the two most widely used languages were JavaScript and SQL, indicating that the survey wasn’t just about front-end development. In fact, TypeScript programmers appear in all four job roles that participated in the Stack Overflow survey: Web developers, desktop developers, system administrators and DevOps, and data scientists.

RedMonk’s rankings combine Stack Overflow data with pull Requests on GitHub to try to understand what developers are thinking and what they are using. TypeScript is also gaining popularity among developers, climbing to no. 17 from no. 26. Some of this is due to TypeScript’s growing popularity on Stack Overflow, but it’s mainly due to the growing number of developers participating on GitHub.

Indeed, In its 2016 annual review, GitHub ranks TypeScript as the 15th most popular language on GitHub among the 316 programming languages used for project development (based on the number of pull Requests and compared to the previous year’s Pull Requests) 250% growth).

In another survey of developers, TypeScript has the highest usage (21%) among the many “alternative” styles of JavaScript and the highest level of attention (39%) among users who haven’t yet. The survey was done in an unusual way — it oddly mixes translators with package managers like NPM and Bower — but the developers who participated in the survey and use TypeScript frequently also use ECMAScript 2015, NativeScript, Angular, especially Angular2.

Stephen O ‘Grady of RedMonk points out that “there seems to be reason to believe Angular” has played a role in TypeScript’s growing popularity. While Angular2 is just one of many projects that use TypeScript (Asana and Dojo already do, as do internal projects at Adobe, Google, Palantir, SitePen, and eBay), But it’s probably best known for Googlers like Rob Wormald promoting TypeScript along with Angular.

More than just Angular2

“There’s no question that our partnership with the Angular team has helped promote TypeScript,” TypeScript core member Anders Hejlsberg told New Stack. “But even so, I think the really important point is that this is a vote of confidence that represents significant confidence in the strength of the industry.”

He points out that this vote of confidence affects more than Just Angular. “There are a lot of other frameworks that use TypeScript. Aurelia, Ionic, NativeScript all use TypeScript in one way or another. The Ember framework and the recent release of Glimmer are written in TypeScript. “

“We’re seeing a lot of votes of confidence from people who are experienced in the industry. I think that’s probably something everyone in a big company notices” — Anders Hejlsberg

This vote of confidence also presents an opportunity for users of the framework. “We’ve done a lot to become an important part of the React ecosystem. We support JSX and all the advanced features of the type system that you might want to use when refactoring or browsing JSX code. We’re also working with the vue.js community to better support the various patterns used in the framework.” Hejlsberg said.

Providing support for the new framework is an important means of maintaining popularity among developers. “We’re always looking at the framework space. We know it’s a constantly changing ecosystem. It’s constantly changing, and you have to be ready and make sure everything works.”

The same is true for toolchains, especially as ECMAScript modules become more popular. “A lot of people write modern style JavaScript applications using modules, and when you use ECMAScript 6 modules, you need to use a packaging tool like Webpack or rollup.js to package your code so it can run in a browser. We want to make sure TypeScript works with these tools to make sure we’re integrated into the tool chain, “Hejlsberg says.

React is a library launched by Facebook. Angular is a framework derived from Google. There’s a lot of analysis comparing them. In general, Angular is in the lead, and vue.js is getting a lot of attention. Angular is popular among TypeScript users, with 41% preferring the 2.x version and 18% preferring older versions. With the recent release of Angular 4 and the growing popularity of TypeScript, we expect the JavaScript wars to continue (Lawrence Hecht).

The number of libraries with TypeScript type definitions is also growing steadily. DefinitelyTyped, a repository that maintains TypeScript type definitions, now contains more than 3,000 frameworks and libraries. This process is greatly accelerated by publishing the declaration file as an NPM package under the @type namespace.

“That means there is now a way to predict which frameworks support types — we can provide those types automatically. When we find that you refer to a particular framework, we can help you find the type definition so you don’t have to look for it yourself.” In fact, Hejlsberg claims, “For some developers, whether or not a framework has a type definition has become a deciding factor in their choice of framework.”

“The way TypeScript is usually adopted — whether it’s corporate, entrepreneurial, or individual developers — is that you try it out on a project and find out it’s great, and then you start recommending it to others. That’s how it spreads in your sphere of influence.” – Anders Hejlsberg

Increased attention seems to be one reason for user growth. “We haven’t done any promotion, it’s all community driven. It’s actually growing steadily, and we’re starting to notice it growing faster now.” Hejlsberg said.

Hejlsberg points out that TypeScript is still the third most popular language in Stack Overflow surveys after Rust and Smalltalk (ahead of Swift and Go) and the sixth most talk-hungry language, Ahead of C# and Swift. “I think it says a lot that we’ve really solved the real problem,” Hejlsberg said.

Microsoft’s reach

It’s easy to see TypeScript’s success as the result of Microsoft introducing JavaScript to enterprise developers already in the Microsoft world through familiar tools.

“We have a large developer ecosystem around C#, C++, and Visual Basic. A lot of companies that use Microsoft tools also have a need for the front end, and when we started to improve the front end, they sat down, took notice, and started using it.” Hejlsberg admits.

However, while much of TypeScript development is done in Visual Studio, as much is done using Visual Studio Code, Microsoft’s open source, cross-platform IDE. “It was a community that we didn’t have a lot of connection to. In the case of Visual Studio Code, half of our users were from non-Windows systems, so suddenly we were connected to a developer community that we hadn’t had much contact with before.”

Open Source Fast Track

The TypeScript team recently announced that it would release every two months instead of every quarter, and Heljsberg called for making release dates more predictable rather than delayed to add a new feature. This is what the ECMAScript Committee is doing.

The new release pace will also align with Visual Studio Code, partly because Visual Studio Code is developed in TypeScript, but more importantly because tools are a big part of TypeScript’s appeal.

While TypeScript’s support for multiple editors and ides is important, Hejlsberg points to Visual Studio Code as another factor helping the language gain popularity.

In fact, even if you’re just developing JavaScript, you can get better coding features from TypeScript, he explains. “Both Visual Studio Code and Visual Studio use TypeScript language services as their JavaScript language services. Since TypeScript is a superset of JavaScript, that means JavaScript is a subset of TypeScript, just TypeScript without type annotations.” He points out.

In Visual Studio Code, opening a JavaScript file triggers TypeScript parsers, scanners, lexers, and type parsers to provide statement completion and Code navigation in JavaScript Code. “Even without type annotations, we can infer a lot about the structure of a project from the modules you use and the classes you declare,” Hejlsberg said. “The amazing thing is that we can automatically import type information for the framework you reference, and then we can give you great statement completion.”

What makes this fast publishing pace possible is that all pull requests must be tested before being merged, which ensures the quality of the master branch code and the popularity of TypeScript, meaning that any problems can be found quickly.

“We’re an open source project and we do a lot of work on GitHub. We don’t merge any pull requests unless we can pass our 55,000 tests, we have to provide test code if we add new features, and we have to provide regression tests if we fix bugs. This means that our Master branch has always maintained high code quality.” He said.

JavaScript: Powerful but complex

Beyond any single factor, the real reason behind TypeScript’s popularity is probably the increasing complexity and power of JavaScript development today.

“Our industry and the use of JavaScript have changed dramatically.” Hejlsberg pointed out. Everyone uses Windows and browsers, and that’s how you use JavaScript. Now the world has become very diverse. There are all kinds of different devices — phones, tablets, and node running JavaScript on the back end.” JavaScript has also broken out of the browser. You can build Native apps using JavaScript by using NativeScript, React Native, or Cordova.”

“Yes, it’s more complex, but it’s also infinitely capable.” Hejlsberg said of JavaScript. “Using JavaScript, you can use the same language and tools developed so many kinds of applications. For me, this is the very reason to push all this: you can develop the diversity of different types of application as well as you can from the evolution of the ecosystem of reusability. It not only becomes more complex, and more powerful.”

TNS analystLawrence HechtContributed to the writing of this report.


The Nuggets Translation Project is a community that translates quality Internet technical articles from English sharing articles on nuggets. Android, iOS, React, front end, back end, product, design, etc. Keep an eye on the Nuggets Translation project for more quality translations.