Type-gymnastics Memes

Posts tagged with Type-gymnastics

This Is Peak Programming

This Is Peak Programming
Someone really woke up and decided to implement FizzBuzz using TypeScript's type system at compile time. Not in regular code, mind you—in the type system itself . They're encoding numbers in base 15, doing string manipulation with template literals, and recursively building types that somehow output "Fizz", "Buzz", or "FizzBuzz" based on divisibility rules. All of this happens before a single line of JavaScript even runs. The result? Absolutely zero runtime value, maximum engineering flex. It's like using a Formula 1 car to go grocery shopping—technically impressive, completely impractical, and you'll confuse everyone in the parking lot. But hey, at least your FizzBuzz bugs will be caught at compile time, which is more than most production codebases can say.

Typescript More Like Typeslop

Typescript More Like Typeslop
The TypeScript type safety power hierarchy, visualized through Thor's hammer-lifting scene. At the top, we have no-explicit-any looking all confident with its strict ESLint rule – "You can't defeat me" – thinking it's protecting your codebase from type chaos. Then comes the humble any type itself, and yeah, it absolutely can defeat that rule. Just slap any on your variables and watch your type safety evaporate faster than your motivation on a Monday morning. But wait – enter the final boss: Record<string, unknown> with its unholy alliance partner & { weirdKey?: T } . This monstrosity technically bypasses the no-explicit-any rule while achieving the same "I have no idea what's in this object" energy. It's the loophole that makes TypeScript devs simultaneously feel clever and dirty. You're not using any , you're just using a type-safe way to say "literally anything could be here" – which is basically any with extra steps and a superiority complex.