Type Gymnastics
ELI5 — The Vibe Check
Type gymnastics is contorting TypeScript's type system to do things it wasn't really designed for. Five levels of conditional types to infer a string literal. It's fun, it's impressive, and it's unmaintainable.
Real Talk
Type gymnastics refers to advanced type-level programming in TypeScript (or similar languages) that pushes the type system to its expressive limits. While valuable in library code for strong APIs, in application code it frequently indicates over-engineering. Common patterns: deep template literal manipulation, recursive conditional types, and type inference chains.
When You'll Hear This
"Stop the type gymnastics — just use as here." / "Libraries need type gymnastics. Your app doesn't."
Related Terms
Template Literal Type
Template literal types let TypeScript understand string patterns at the type level.
Type Theater
Type theater is writing elaborate TypeScript types that impress your teammates but don't actually prevent bugs.
TypeScript
TypeScript is JavaScript with a strict parent watching over it.