Vincent Vauban’s Post

🚀 CLEAN CODE REMINDER: COMMENTS THAT COUNT “Comment the why, not the obvious what—getters, setters, constructors don’t need notes.” When code is self-explanatory, extra comments add noise. Save comments for intent, trade-offs, and surprising decisions: ✅ Explain why a rule exists, a constraint, or a workaround. ✅ Capture domain knowledge, edge cases, and assumptions. ❌ Don’t narrate trivial code (e.g., getters/setters/constructors). Keep it crisp. Let code show the what. Use comments to preserve the why. ✍️ #CleanCode #Java #SpringBoot #Readability #CodeQuality #SoftwareEngineering #DevBestPractices #Refactoring #Comments #Maintainability

  • Comment the why, not the obvious what—getters, setters, constructors don’t need notes.

You could even assert with an error comment to make sure your "world" isn't collapsing. And it defines intend too, and clarify your assumption.

To view or add a comment, sign in

Explore content categories