Stop Writing Bad Comments: A Guide to Meaningful Code Documentation
Most code comments state the what instead of the why. If your comment just repeats what the code clearly shows, it is noise. Clean code should tell a story, and comments should only fill in the missing context.
The Golden Rule
- Write code that is easy to read.
- Use comments only when code cannot explain the intent.
- Delete outdated comments immediately.
Top comments (0)