Learning to Love Type Systems
summary
Claims that types reduce bugs by constraining domains with concrete examples: a divide-by-two function failing on null/undefined, fixed by annotating x:number so it is total at compile time; a fetchUser that becomes Promise<Either<Error,User>> so failures are values not thrown exceptions; querySelector wrapped in an Option to eliminate undefined. Demonstrations run in the console, tests show many inputs that previously errored now produce typed results, and TypeScript 2.8 conditional types plus Either/Option wrappers make functions total are the practical tools shown.
AI-written summary · about
chapters (4)
related talks
30mSwipe Left, Uncaught TypeError Learning to Love Type Systems
01h 01mDeconstructing TypeScript’s Type System
24mTypeScript for JavaScripties
21mBeyond Type Checking Building Bulletproof TypseScript Applications
21mThe long-tail of type safety
11mThe Joy of Typescript
38mUnderstanding TypeScript's Structural Type System
31mTypeScript for JavaScripties
