'TypeScript is exploding': JavaScript spin-off programming language going strong in 2019

A new analysis by RedMonk finds few signs that use of the JavaScript spin-off language is dropping off.

The best programming languages to learn in 2019: Top coding skills that pay you the most These are the languages that are in the highest demand and offer the highest salaries.

While programming languages come and go, there's fresh evidence that rapid growth in the use of TypeScript isn't tailing off.

Hot on the heels of TypeScript's strong showing in the RedMonk Programming Language Rankings, a new analysis by the firm argues that use of the JavaScript spin-off language 'is exploding'.

When RedMonk looked at the number of pull requests being made to code hosted in public GitHub repositories, it found the number of requests to TypeScript repos spiked in the past three years.

typescript1.jpg
Image: RedMonk

"Pull requests are an indirect measure of community activity and as such this chart is quite something," says RedMonk co-founder James Governor in his report.

This picture of growing usage is backed up by the star ratings awarded to TypeScript repositories on GitHub, with TypeScript repos sustaining a high star rating, while ratings declined for repos written in other popular newer languages, such as Apple's Swift and Java alternative Kotlin.

ts2.jpg
Image: RedMonk

TypeScript is a superset of JavaScript and in recent years more and more JavaScript developers appear to be adopting the language, drawn to features that help them build larger and more complex programs.

One key feature that TypeScript adds to JavaScript is optional static types and type checking.

"So what is driving TypeScript growth? One high level answer is that more strongly typed languages - in which you need to define the type of information in a variable up front - are having a renaissance," says Governor.

Type checking allows developers to spot a class of bugs that could otherwise slip through into software, by running checks ahead of the code being executed that verify various operations, such as whether the data being passed to and from functions is of the correct type. In statically typed languages, developers typically specify the type of a variable or a function parameter when they're declared, for example, using the keyword int to specify an integer, or str to specify a string of characters, to use two simple examples.

In contrast, dynamically typed languages like JavaScript don't require developers to specify a type for variables or function parameters.

SEE: 10 ways to prevent developer burnout (free PDF) (TechRepublic)

Using static typing not only helps spot certain bugs, but also allows better tooling to be built, which was one of the reasons TypeScript was chosen for the Angular web framework.

"It provides advanced autocompletion, navigation, and refactoring. Having such tools is almost a requirement for large projects," writes Viktor Savkin, co-founder of Angular consultancy Narwhal Technologies.

Moreover, as RedMonk's Governor points out, TypeScript is relatively easy for JavaScript developers to get started with, since it's possible to write a mix of regular JavaScript and TypeScript and to use many of the same web development tools. Also, since TypeScript compiles to JavaScript, TypeScript can be used as a replacement for JavaScript in many instances.

Governor cites a quote that TypeScript 'makes JavaScript twice as good', and argues that TypeScript is the latest example of how JavaScript continues to evolve to fit the needs of developers.

"From a Darwinian perspective it is precisely the ability of JavaScript to adopt to new niches as it evolves that makes its growth so sustainable. It is indeed the "fittest" language for a number of niches," he says, referencing the findings of an npm study that 61% of all JavaScript developers now report using TypeScript.

These new niches being colonized by JavaScript include code-configured infrastructure deployment, as demonstrated by the Atomist platform, and building server-side apps, says Governor.

TypeScript is even inspiring other languages, with Python creator Guido van Rossum recently telling an audience of developers that Python was learning lessons from TypeScript's optional type checking.

If you're interested in finding out more about TypeScript, check out TechRepublic's round-up of the best free resources for learning the language online.

Also see