JS Party: JavaScript, CSS, Web Development · Changelog Media

Don’t ever use these TypeScript features

September 5, 2024·49 min·4 clips
Nick Nisi explains why he never uses TypeScript enums, calling them opaque and unnecessary.
Nick and Chris open with a Star Trek The Next Generation analogy to introduce RSPAC, a new JavaScript bundler written in Rust that positions itself as a next-generation replacement for existing JavaScript-native bundlers. The parallel is that TNG improved substantially on the original series by starting season two, and RSPAC's Rust implementation offers speed improvements over JavaScript-native bundlers like Webpack and even over recent alternatives. The main segment covers TypeScript anti-patterns. The first category is TypeScript features that exist for historical or compatibility reasons but undermine type safety: the any type is flagged as a category-1 anti-pattern because it disables TypeScript's entire reason for existing; enums are described as having confusing runtime behavior that differs from how they appear at the type level, with const enums preferred for most use cases; and decorators in their legacy form are described as unstable and best avoided in favor of the newer TC39-standardized version. The second category is features that add complexity without commensurate benefit: namespaces, which predate modules and should not be used in modern TypeScript; triple-slash reference directives, which are an older way of declaring dependencies replaced by imports; and certain patterns around class inheritance that replicate problems from Java-style OOP that TypeScript was never intended to enforce. Chris and Nick also discuss the maintenance burden: features that work when first written but create invisible coupling that makes refactoring painful later. Both hosts are experienced TypeScript users who emphasize that the goal is not avoiding TypeScript but using the parts of it that deliver type-safety benefits without the footguns. The tone is practical and opinionated. The audience is TypeScript developers and JavaScript engineers weighing adoption of TypeScript in new or existing projects.

As heard by us

A relaxed JS Party discussion turns language rankings and tooling friction into practical developer questions.

This single-episode review follows a casual Node.js docket as it opens into a sharper conversation about how developers read language popularity and tooling signals.

Read the full review in PlayNext →

Why you'd press play

You want to know what programming-language rankings miss and where AI can actually save time in everyday developer work.

Read the full recommendation in PlayNext →
Listen to the show on