It’s an ongoing battle. The ones who argue TypeScript is great and those who push back to good old vanilla JavaScript. Since 2012, we have had TS available when Microsoft introduced it. Later, larger companies like Google, Asana, Slack, and Airbnb became early adopters.
With Angular 2 adopting TypeScript, smaller companies, open source, and single developers also started to adopt TS.
When we look into the State of JS report today, we will see that more developers use TypeScript in daily development than vice versa. In fact, this is what I experience when working with other companies.
Still, there are a lot of voices that clearly prefer JavaScript.
For example, David Heinemeier Hansson announced dropping TypeScript from Turbo 81.
JavaScript was never about Quality.
This may disturb some readers but think briefly about the early days of JavaScript. In its early days, JavaScript was crafted as a lightweight tool for adding interactivity to web pages, not for building the complex, large-scale applications used today. Initially released in 1995, JavaScript quickly outgrew its original purpose as the web evolved.
Early language versions lacked features crucial for maintaining large codebases, such as static typing and modular architecture, leading to code quality and reliability challenges for expanding projects.
These limitations stemmed from viewing JavaScript as unsuitable for "serious" development. However, the advent of TypeScript and updates to JavaScript (ECMAScript 2015 onwards) have addressed many of these concerns, transforming JavaScript into a language capable of supporting sophisticated web applications and reflecting the web development community's adaptability and commitment to improvement.
🍪 When I was a younger developer, the .NET and the Java people smiled at me when I discussed building JavaScript frameworks. JS wasn’t considered a real programming language or environment for most people I met.
JavaScript, instead, was a language of Freedom.
It was fast and fun to develop in JavaScript (Let’s ignore Internet Explorer for a moment; it feels better). Very small teams or single developers loved to work with that freedom to deliver nice results quickly. That was the core idea of JavaScript.
The spirit of scripting something here and there was what early JS devs preferred. Today, we see a trend of going back to JavaScript again. Is that good or bad?
The Price Of Freedom: Quality.
Ho, wait, have you just written that you cannot create quality code with JavaScript? 🫢
Yes. ✅
At least in a team context, in a complex app environment with a scaling factor, JavaScript lacks specific attributes, which helps us meet specific qualities when facing real-world challenges.
Your teams and requirements will change, and everything will be fast-paced.
𝗢𝗻𝗹𝘆 𝗵𝗶𝗿𝗶𝗻𝗴 𝘁𝗵𝗲 "𝗯𝗲𝘀𝘁" 𝗱𝗲𝘃𝘀 𝗶𝘀 𝗮 𝗻𝗼𝘁 𝘃𝗶𝗮𝗯𝗹𝗲 𝘀𝘁𝗿𝗮𝘁𝗲𝗴𝘆 𝗮𝗻𝗱 𝗰𝗼𝗺𝗲𝘀 𝗰𝗹𝗼𝘀𝗲 𝘁𝗼 𝗳𝗮𝗹𝘀𝗲 𝗲𝗹𝗶𝘁𝗶𝘀𝗺 𝗼𝗿 𝗵𝗲𝗿𝗼𝗶𝘀𝗺.
Scalability, Resilience, Predictability, and Maintainability are some qualities that will suffer from loose typing. (No JSDoc, no TypeScript, etc.) It simply leads to a lack of confidence.
TypeScript helps you to meet Quality long-term.
We are already at the core of why I prefer TypeScript as both an engineer and an entrepreneur. TypeScript helps me to ensure long-term stability and builds a solid foundation for scalability. Other than plain JavaScript, since … it’s too loose to be a solid foundation.
As a Software Engineer, I am interested in everything that improves engineering, which helps me to make things more testable, easier to understand, and easier to work with.
Yes, TypeScript is adding more code, but when done right, this clearly helps colleagues understand and collaborate. More code doesn’t mean that development is taking longer.
It’s clearer, less error-prone, and more predictive.
Live-Discussion “Why We Prefer TypeScript.
With
on Wednesday, 28 February 2024, on LinkedIn and YouTube.Conclusion
Reflecting on decades of JavaScript development, I realize it's a language that propelled my career and holds a special place in my journey. Despite its solid core, JavaScript's lack of certain features once made scaling up projects and teams cumbersome.
In recent years, TypeScript has become my go-to, overcoming these scaling challenges with its emphasis on qualities like Scalability, Resilience, Predictability, and Maintainability—crucial for a stable business and diverse development teams. While JavaScript remains a powerful tool, TypeScript has streamlined our development process, allowing us to focus on delivering value and reducing complexity for all levels of developers.
Hope to see you on Wednesday,
Adrian
https://world.hey.com/dhh/turbo-8-is-dropping-typescript-70165c01
I have to say the key distinction here is that you need to actually learn Typescript. Treating it as javascript + JSDoc is where beginners get stuck on.
TS is very verbose for beginners, creating a lot of any-type traps. Learn the utility types, learn the react utility types. Learn how to create types from external libraries. Give namespaces a go. Learn the difference between type and interface. And try not to overuse generics.