Could TypeScript replace JavaScript? Use of programming language spin-off soars

New research shows Microsoft TypeScript's popularity is rocketing and that nearly all JavaScript developers are worried about open-source security.
Written by Liam Tung, Contributing Writer

There's now more evidence that Microsoft's language for scaled-up JavaScript, TypeScript, is becoming an essential for developers building for the internet. 

Developer analyst firm RedMonk last month noted that TypeScript, Microsoft's seven-year-old superset of the world's most popular programming language, JavaScript, is now the 12th most popular language based on GitHub projects and developer chatter on Stack Overflow. 

The reason for this rise can be found in the latest survey of 33,000 developers from 156 countries who use npm, a hugely popular Node.js JavaScript package manager that's traditionally used to build website features. 

SEE: How to build a successful developer career (free PDF)

But, with the rise of PWAs or progressive web apps, JavaScript is increasingly used to build native mobile and desktop apps, as opposed to, say, C or C++, the languages traditionally used to build native Win32 apps.    

As per npm developers, a big surprise in last year's survey was that 46 percent of respondents said they used TypeScript. Today, the proportion of developers who use Microsoft's open-source take on JavaScript has ballooned to 62 percent. About 15 percent of them use other developers' libraries, which is attributed to the popular Angular framework, and "90 percent [use] TypeScript". 

"Overall, 36 percent of npm users are writing TypeScript some or most of the time. That a third of the users in the JavaScript community are writing a totally new flavor of JavaScript should make everyone sit up and take notice," npm developers write.

In other words, TypeScript should be on the list of languages to understand. As RedMonk noted in March, the growing number of projects helps explain why TypeScript's "trajectory is significant and sustainable" and won't just fade away like many other languages. 

Microsoft's hit with TypeScript comes as its open-source cross-platform code editor Visual Studio Code, or VS Code, finds a sweet spot with developers across the world, rising from being used by 500,000 developers in 2016 to 4.5 million in 2019.   

Serverless computing is also popular among JavaScript developers. Serverless doesn't actually mean no servers, but rather that developers don't need to deal with host-related duties, including patching and operating-system issues. 

In Amazon's cloud service, AWS, serverless computing is developed under the Lambda brand, while in Microsoft's world it's called Azure Functions. Google and IBM call it 'Cloud Functions' under their company names. 

"We were surprised to discover that fully 33 percent of developers are using the still relatively new 'serverless' technique, also known as Cloud Functions or Lambdas," say npm developers. 

The organization also found that npm and JavaScript are increasingly being used to build native apps. Nearly all – 97 percent of respondents – are building apps that live in the browser, while 77 percent of developers are using it for server-side code.

However, npm also found that 46 percent are using it to write code for native apps that run on mobile and desktop systems. 

"JavaScript has broken out of the browser and become a general-purpose programming language, put to all the same uses as other programming languages. In particular, JavaScript has become a major force in the mobile app development world," npm concludes, noting that Slack is writing in JavaScript.  

JavaScript developers are also worried about the state of open-source code security after multiple incidents where malicious code was discovered in software libraries widely used by developers for nefarious activities like Bitcoin picket-pocketing.


The survey also shows that JavaScript developers are worried about the state of open-source code security.

Image: npm

More on Microsoft's TypeScript and programming languages

Editorial standards