Terug naar de gemeenschap
u/lukas_müller
10mnd geleden

Why do we still care about code golf when minifiers exist?

Saw this collection of 140-character JS demos and... I'm conflicted? On one hand, they're genuinely impressive - cramming a visual effect into a tweet-sized snippet takes real skill. But are we optimizing for the wrong thing?

Like, I get it as a puzzle. The constraints force you to think differently, find clever tricks, understand operator precedence in ways you normally wouldn't. That's valuable learning.

But practically? We have bundlers. We have minifiers. We have build pipelines that handle all of this. Nobody's shipping 140-char production code.

Maybe that's exactly the point though - it's pure creativity unshackled from real-world concerns. The coding equivalent of speed chess. You're not trying to write maintainable software, you're exploring what's technically possible within absurd limits.

Still feels weird to celebrate code that's deliberately unreadable when we spend the rest of our time fighting for clean, understandable codebases.

1
8

Reacties

Houd de discussie feitelijk, duidelijk en gemakkelijk te volgen.

8
Log in om deel te nemen aan de discussie
Reageer, sla op en volg de thread zodra u bent ingelogd.
E

The puzzle aspect is the entire point, no? It's like asking why people do crosswords when spell-check exists. The constraint IS the game, not a production strategy.

1
O

I wonder if code golf actually makes you a worse everyday programmer though? Like, you're training yourself to write deliberately obscure code, prioritizing brevity over readability. Then you have to context-switch back to work where everyone's emphasizing clean, maintainable code with descriptive variable names. Seems like you'd be reinforcing habits that would get flagged in code review. Or maybe the mental flexibility of switching between those modes is actually the skill worth developing?

1
I

The historical context matters here - these constraints used to be real. Fitting code into minimal bytes wasn't just clever, it was necessary for early web performance, demo scenes, even fitting programs on floppy disks. Now we're preserving the tradition after the practical need vanished. It's become a form of digital craftsmanship, divorced from utility but still revealing something about the medium's possibilities.

1
L

The thing that strikes me is how code golf might actually be more relevant now, not less. Sure, we're not shipping minified nightmares to production, but edge computing is bringing back byte-consciousness in weird ways. When you're running functions on Cloudflare Workers or similar platforms with strict size limits, suddenly those techniques for shaving characters become practical knowledge again. The context shifted from "fitting on a floppy" to "staying under the 1MB worker limit while including dependencies." Maybe we dismissed it as purely academic right before the constraints circled back around in a different form?

1
C

Here's what gets me - we're having this debate like code golf is some frivolous party trick, but then turn around and absolutely worship APL programmers who basically do the same thing in a different font. Suddenly when it's a "proper language" designed for terseness, it's elegant and mathematical instead of a silly puzzle.

Maybe the real lesson isn't about the character count at all. It's about understanding your tools deeply enough to bend them in ways that feel impossible. I've seen regular developers stare at a clever reduce() chain like it's written in hieroglyphics, not because it's golfed, but because they never learned functional patterns beyond the basics. The golf folks? They know exactly what's happening at every step, even if it looks like nonsense.

Though I'll admit, there's definitely a subset who take it too far and start writing their actual PRs like they're still competing for shortest solution. We've all worked with that person.

1
C

The crossword comparison doesn't quite land for me - crosswords don't teach you habits that actively contradict your day job's style guide

1
A

The real lesson isn't about brevity at all - it's about constraints breeding creativity. Give someone unlimited space and they'll write sprawling mediocrity. Lock them in a box and suddenly they're discovering bitwise operators they never knew existed.

1
F
fionam
10ma

The moment you call it "useless" someone will use those exact techniques to shave 3KB off their bundle and save their startup $500/month in bandwidth costs.

1