Google Testing Blog: Less Is More: Principles for Simple Comments
You’re staring at a wall of code resembling a Gordian knot of Klingon. What’s making it worse? A sea of code comments so long that you’d need a bathroom break just to read them all! Let’s fix that. Adopt the mindset of someone unfamiliar with the project to ensure simplicity. One approach is to separate the process of writing your comments from reviewing them; proofreading your comments without code context in mind helps ensure they are clear and concise for future readers. Use self-contained comments to clearly convey intent without relying on the surrounding code for context. If you need to read the code to understand the comment, you’ve got it backwards! Not self-contained; requires reading the code Suggested alternative // Respond to flashing lights in // rearview mirror. // Pull over for police and/or yield to // emergency vehicles. while flashing_lights_in_rearview_mirror() { if !move_to_slower_lane() { stop_on_shoulder(); } } Include only essential information in t
Google Testing Blog: Less Is More: Principles for Simple Comments Testing Blog Less Is More: Principles for Simple Comments Wednesday, August 21, 2024 Google Labels: Code Health , David Bendory , TotT    Labels  TotT 113 GTAC 61 James Whittaker 42 Misko Hevery 32 Code Health 31 Anthony Vallone 27 Patrick Copeland 23 Jobs 18 Andrew Trenk 13 C++ 11 Patrik Höglund 8 JavaScript 7 Allen Hutchison 6 George Pirocanac 6 Zhanyong Wan 6 Harry Robinson 5 Java 5 Julian Harty 5 Adam Bender 4 Alberto Savoia 4 Ben Yu 4 Erik Kuefler 4 Philip Zembrod 4 Shyam Seshadri 4 Chrome 3
Explore this link on the map →related reading
- Google Testing Blog: Code Healthtesting.googleblog.com
- Stevey's Google Platforms Rant · GitHubgist.github.com
- llm-wiki · GitHubgist.github.com
- https://danluu.comdanluu.com
- Google Testing Blog: Communicate Design Tradeoffs Visuallytesting.googleblog.com
- GitHub · Change is constant. GitHub keeps you ahead. · GitHubgithub.com
- Impeccable: The missing upgrade to Anthropic's impeccable skillimpeccable.style
- Google Testing Blog: Code Health: Too Many Comments on Your Code Reviews?testing.googleblog.com
- GitHub - multica-ai/andrej-karpathy-skills: A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls. · GitHubgithub.com
- Paul Buchheit: Communicating with codepaulbuchheit.blogspot.com
- rams - Expert Design Reviews on Every PRrams.ai
- GitHub - ByteByteGoHq/system-design-101: Explain complex systems using visuals and simple terms. Help you prepare for system design interviews. · GitHubgithub.com