Stringly-Typed to Strongly-Typed with TypeScript
summary
Argues that TypeScript shifts common stringly-typed failures into compile-time errors by using literal and union types, branded types for distinguishing semantic strings (absolute vs relative paths), and discriminated unions plus type guards for exhaustive control flow. Shows concrete rewrites: template strings → TSX for checked bindings, positional params → named options objects, env parsing centralized in a single config. Result is fewer runtime surprises, earlier failures during builds, and far less brittle refactoring across code that still uses strings.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 0:12Who am I
- 1:13Who are you
- 2:41What is this talk about
- 4:01What is StringlyTyped
- 5:45StringlyTyped Errors
- 9:46Static Checks
- 11:53Dynamic Languages
- 15:28Common Ground
- 16:25Types
- 19:13TypeScript
- 22:50Type Systems
- 26:17Type Systems in TypeScript
- 27:50StringlyTyped Examples
- 32:11Absolute Paths
- 37:12Conflicting Definitions
- 39:17Single Source of Truth
- 40:02Brittle Control Flow
- 41:09No More Strings
- 41:55Enumeration
- 42:44Discrimination Union
- 43:52Conclusion
