Rob Pike's 5 Rules of Programming

Timeless coding rules drop, internet starts a quote war and calls them “obvious”

TLDR: Rob Pike’s five simple programming rules—measure first, keep it simple, and let data lead—sparked big buzz. Commenters duked it out over who coined “premature optimization,” split between “timeless wisdom” and “meh, obvious,” while others shared classic quote links and joked about adding the rules to their AI playbooks.

Rob Pike rolls out five back-to-basics rules—measure before speeding things up, keep it simple, and let your data choices lead the way—and the internet immediately turns it into a vibe check. One camp swoons over the “keep it simple” gospel and Rule #5’s “data first” mantra. The other camp shrugs: “Obvious. Why are we hyping this?” Cue drama.

The spiciest skirmish? A citation cage match over who said “premature optimization is the root of all evil.” One commenter swears it’s Donald Knuth, another fires back with Tony Hoare receipts and drops a link. Meanwhile, the classics crowd flexes with Alan Perlis’s zingers, sharing a link to his legendary “Epigrams in Programming” greatest hits playlist at Yale: Perlis quotes. It’s like proverb TikTok, but for engineers.

There’s also wholesome chaos: someone quips they’ve added the rules to their “AGENTS.md,” as if pinning grandpa’s life advice to a robot’s fridge. And yes, Ken Thompson’s “When in doubt, use brute force” gets cheers from the “just ship it” brigade. Love it or eye-roll it, Pike’s list triggered a perfect storm: nostalgia, nitpicking, and meme-ready wisdom. The code might be simple; the comments are not.

Key Points

  • Rule 1: Don’t guess performance hotspots; bottlenecks appear in unexpected places.
  • Rule 2: Measure before optimizing; only tune when one part dominates runtime.
  • Rule 3: Prefer simple algorithms when n is small; fancy algorithms have large constants and n is usually small.
  • Rule 4: Complex algorithms are buggier and harder to implement; favor simplicity in algorithms and data structures.
  • Rule 5: Data dominates; choosing the right data structures often makes algorithms self-evident.

Hottest takes

"I believe the 'premature evil' quote is by Knuth, not Hoare?!" — kleiba
"Obvious. Why the elevation of the obvious?" — bsenftner
"Added to AGENTS.md :)" — tobwen
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.