Press "Enter" to skip to content

The TypeScript Takeover

Image by Narong on Adobe Stock

In the Octoverse, an annual report published by GitHub that reports on developer statistics, ranked TypeScript as the most used language between 2023 and 2024, surpassing Python, JavaScript, and Java. The rise of TypeScript comes as no surprise when we look deeper into why this happened and the effects of switching to TypeScript on the overall developer experience. 

TypeScript, developed and maintained by Microsoft, is an open-source programming language based on JavaScript, with a few key changes, including strict type definitions, interfaces, and enhanced syntax. JavaScript is dynamically typed, meaning the type of each variable is determined at runtime, allowing for flexibility but risk of type-related errors, which only show up during execution. TypeScript, on the other hand, follows a stricter, statically typed system similar to Java, C#, and Go, all of which ranked among the top 10 most used languages in the Octoverse. 

But why are so many developers switching to TypeScript instead of staying on JavaScript? The real answer comes in debugging the code you write. JavaScript allows operations on different value types, such as booleans, integers, or floats. As a result, type mistakes don’t appear as errors until runtime. For this reason, JavaScript requires more scrutinized testing. It’s clear why some people might be switching to TypeScript, which catches these errors during development instead of showing up when you run the code. It’s easier to debug, and it’s also easier to make sure users don’t encounter bugs in the production deployment. 

Here is an example code using TypeScript, referenced from the TypeScript docs:

Error, as shown in the IDE (integrated development environment):

It’s no surprise that in a report published by YC (Y-Combinator), 60-70% of startups in the YC X25 batch used TypeScript for their AI agent development. TypeScript allows developers to flourish by eliminating the need for excessive debugging, which takes time away from new feature development.

TypeScript’s rise is also connected to how apps are built with modern frameworks. For example, many code repositories on GitHub using React are built using Typescript. Popular Node-based frameworks like Angular, Astro, and even React state in their documentation that TypeScript is recommended. In fact, TypeScript is the first choice presented when building a Node file structure for React with ‘npm’. These frameworks strongly recommend  TypeScript because it reduces the uncertainty of introducing bugs in production code due to strict type safety when building large-scale apps.

TypeScript’s popularity makes sense when you think about what developers actually deal with every day. They frequently encounter bugs caused by mismatched data types, missing values, and unpredictable behavior in large JavaScript codebases. As apps become more complex, small mistakes in JavaScript can escalate into large bugs that require significant time and effort to fix. TypeScript helps by catching those mistakes before you even run the code, which saves a lot of time. It integrates smoothly with popular tools like React and Angular, so switching to it doesn’t feel like learning a brand new language. The number of companies switching to TypeScript and the number of startups built using TypeScript are growing daily. It’s not taking over because it’s fancy, it’s taking over because it just makes life easier for the developers and makes user experiences more friendly and stable.

Be First to Comment

Leave a Reply

Discover more from The Outspoken

Subscribe now to keep reading and get access to the full archive.

Continue reading