A few years ago I got “Jeep fever.” I began daydreaming about owning a Jeep, driving around with the top down, and going on trips into the mountains.
That’s when it happened.
Everywhere I went, I saw Jeeps. I passed countless Jeeps on the road. There were Jeeps in every parking lot. Practically everyone had a Jeep but me. Where did all these Jeeps come from?!
Logically, I had to assume there was relatively the same number of Jeeps on the road before I got “Jeep fever.” I just hadn’t noticed until then.
That’s kind of how I feel about TypeScript.
Now, I wouldn’t call it “TypeScript fever” just yet. I’m still on the fence on using it as a daily driver (more on that later). However, I can no longer ignore TypeScript’s momentum. Now that I’ve started to pay attention, holy type safety Batman, it’s everywhere!
TypeScript is So Hot Right Now
Everywhere I turn it seems TypeScript is getting more attention. More teams are switching to TypeScript. More open source projects are moving to TypeScript or at least supporting TypeScript. Here are just a few of the more recent announcements that caught my attention.
- Yarn 2.0 will be written in TypeScript.
- Vue.js 3.0 will be written in TypeScript.
- Kent C. Dodds says every new web app at PayPal starts with TypeScript.
- Ryan Dahl, the creator of Node.js, is now working on deno, a new server platform that uses TypeScript.
Where is TypeScript on the technology adoption curve? I think it’s somewhere around “OMG TYPESCRIPT ALL THE THINGS!”
TypeScript: The Good
I recently ran a poll on Twitter to get people’s opinion of TypeScript. The results are certainly not scientific, but I was surprised at the amount of positive sentiment towards TypeScript. Of the 188 people who responded, 64% currently use it and feel good about it.
The comments were even more interesting. Here are some highlights:
- Higher velocity
- Reduced defects
- Faster on-boarding
- Easier refactoring
“…a worthwhile investment.”
“Best thing we ever did…”
“I would not work somewhere that didn’t use TypeScript.”
For years, developers have argued that test coverage increases confidence in the code we write. TypeScript also increases confidence. That’s a good thing.
Due to the current industry buzz, it might be advantageous from a recruiting standpoint to advertise that your team is using TypeScript. A potential candidate might think, “Oooo! An opportunity to use TypeScript!”
TypeScript: The Bad
Adding types is not a trivial task. There’s a learning curve to effectively using TypeScript. I’ve read that TypeScript has helped some teams with on-boarding developers, but I’ve also read the opposite.
TypeScript: The Ugly
Type-checking only helps with one class of bugs that can occur in a codebase. Some would argue the classes of bugs where TypeScript does not help is much, much larger.
Type definitions are great… except when they’re not. When type definitions are maintained outside of projects, these definitions can get out of sync with the latest versions of packages, leading to unexpected behavior and a lot of frustration tracking down the issue.
Today, TypeScript is the hot new thing in web technology. For some teams, it appears to be making a positive impact on their productivity. Is it right for you? That’s for you and your team to decide.
I will continue to cautiously dip my toes in the TypeScript waters. I plan to keep experimenting and hope to hit that inflection point where I realize its value. I know it’s important. At least in the near future.
Learn More About TypeScript
Want to learn more about TypeScript? Check out some of these useful resources.
- Use TypeScript to Build a Node API with Express
- Build and Test a React Native App with TypeScript and OAuth 2.0
- Build a Basic CRUD App with Angular and Node