Paul Hadfield’s Post

TypeScript with any scattered through it isn't TypeScript. It's JavaScript with slower builds and false confidence. The pattern is everywhere: any to silence an error you don't understand, ! to stop the compiler complaining about a value that might be null, a direct as SomeType cast on data you haven't actually validated. Each one is a small lie you're telling the type system. Enough of them and the type system stops being useful – it's just friction. Strict TypeScript is a different experience. When you can't use any, you have to model the problem properly. When you can't suppress nullability, you have to decide what happens when the value is absent. The discipline the compiler imposes is the same discipline good API design requires, and the class of errors it eliminates – null dereferences, wrong shape assumptions, missed union cases – are disproportionately the ones that reach production undetected. Most teams "use TypeScript" but don't actually use TypeScript. The difference shows up in PRs, in runtime exceptions, and in how confidently new engineers can move through an unfamiliar codebase. What's the tell in a codebase that the team has given up on the type system? #TypeScript #SoftwareEngineering #WebDevelopment

To view or add a comment, sign in

Explore content categories