Rich Harris, creator of Svelte, discusses the decision to remove TypeScript support from the Svelte project and use JS doc annotations instead. They explore the benefits of this approach and touch on the advantages of idiomatic JavaScript. The podcast also delves into the issue of tribalism in programming languages and the negative aspects of Twitter. DHH's critique of TypeScript and the Turbo JavaScript library are also discussed. The hosts mention an upcoming episode on JavaScript security with Ron Paris.
The divide between TypeScript and JavaScript is often more rooted in personal preference and experiences rather than objective analysis.
The controversy around removing TypeScript from libraries showcases the challenge of finding a consensus on its role in library development.
Encouraging respectful discourse and acknowledging the merits of both TypeScript and JavaScript can foster a healthier development community.
Deep dives
Removing types from your own code is misguided behavior
The dispute between TypeScript and JavaScript is rooted in the strong opinion people hold about type-safety in code. TypeScript converts have had the revelation of the benefits of types and find it challenging to go back to JavaScript without them. However, the argument often lacks nuance, leading to a black-and-white view. This binary mindset makes it difficult to have civil discussions about the merits of each approach. While TypeScript can be incredibly helpful for large codebases with multiple contributors, it is not without its drawbacks. TypeScript can sometimes be shackling, adding additional complexity and time spent resolving type issues. Additionally, many web developers have been writing JavaScript without types for years and have built large-scale websites successfully. The divide between TypeScript and JavaScript is often more rooted in personal preference and experiences rather than objective analysis.
The controversy of removing TypeScript from libraries
The recent controversy around removing TypeScript from libraries, such as the case with the Turbo library, showcases the passionate debates that arise within the developer community. Some argue that removing types from a library used by others is user-hostile, as it removes the benefits of type safety and autocompletion for users of the library. However, others point out that certain libraries, like Turbo, primarily function within HTML attributes and do not require extensive autocompletion or type checks. The removal of TypeScript from such libraries might be justified, as it reduces build complexity, bundle size, and maintenance efforts for library authors. These differing perspectives highlight the challenge of finding a consensus on the role of TypeScript in library development.
The need for more productive discourse on TypeScript and JavaScript
The debates surrounding TypeScript and JavaScript often devolve into polarized opinions and toxic online interactions. It is crucial for the developer community to encourage more productive and respectful discourse, where differing opinions can be discussed and understood. Instead of aiming for 'one size fits all' solutions, it is important to recognize that different projects and contexts might require different approaches. Holding space for diverse perspectives and acknowledging the merits of both TypeScript and JavaScript can foster a healthier community that celebrates innovation, collaboration, and open-mindedness.
The Benefits of Using TypeScript in Development
TypeScript has proven to be a successful tool for Microsoft, improving code quality and catching errors before runtime. While some developers may initially find it tedious to write type annotations, once they understand the advantages of TypeScript's type checking, they appreciate the time it saves in the long run. TypeScript's ability to provide detailed error messages and help identify areas of code that need refactoring or changes has proven to be invaluable. Additionally, TypeScript's ability to facilitate easier refactoring and catch errors during development can save developers substantial time in the long run.
The Importance of Generalizing Skills and Not Identifying Strictly with Tools
In the podcast episode, there is a discussion about the tendency for developers to strongly identify with a specific tool or language, such as TypeScript. This identification often leads to heated debates and tribalism within the development community. The hosts encourage developers to expand their expertise and not narrowly define themselves based on a specific tool. They emphasize the importance of generalizing skills and being open to different technologies, as the industry and preferred tools can shift over time. By adopting a more flexible and open-minded approach, developers can better adapt to changing technologies and engage in more constructive discussions within the community.
Love it or hate it, TypeScript is here to stay for the foreseeable future. But, what happens when widely adopted packages go completely Type free or remove TypeScript in favor of JS with type annotations? Join us to unpack these recent events with Rich Harris, creator of Svelte, as he walks us through the nuanced decision his team made for the Svelte project, and ofc, lots of laughs along the way.
Changelog++ members get a bonus 7 minutes at the end of this episode and zero ads. Join today!
Sponsors:
Convex – Convex is a better type of backend — the full-stack TypeScript development platform that lets you replace your database, server functions, and glue code. Get started at convex.dev
Fastly – Our bandwidth partner. Fastly powers fast, secure, and scalable digital experiences. Move beyond your content delivery network to their powerful edge cloud platform. Learn more at fastly.com
Fly.io – The home of Changelog.com — Deploy your apps and databases close to your users. In minutes you can run your Ruby, Go, Node, Deno, Python, or Elixir app (and databases!) all over the world. No ops required. Learn more at fly.io/changelog and check out the speedrun in their docs.