Rob Pike's 5 Rules of Programming
3 hours ago
- #programming
- #best-practices
- #optimization
- Rule 1: Bottlenecks are unpredictable; avoid premature speed hacks without proof.
- Rule 2: Measure performance before optimizing; focus only on critical bottlenecks.
- Rule 3: Simple algorithms are better for small 'n'; avoid complexity unless necessary.
- Rule 4: Fancy algorithms are bug-prone and harder to implement; prefer simplicity.
- Rule 5: Data structures are central; good organization makes algorithms obvious.
- Premature optimization is the root of all evil (Tony Hoare).
- When in doubt, use brute force (Ken Thompson).
- KISS philosophy underlies Rules 3 and 4.
- Fred Brooks emphasized Rule 5 in 'The Mythical Man-Month'.