DEV Community

Discussion on: To comment or not to comment?

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Write as few comments as possible. The code should be readable on its own. Use good symbol names and structures.

Reserve comments for things that are not expressed in code well, and keep them minimal. Unlike code, there is nothing checking that comments are correct, thus tend to get stale. Thus focus on information that won't likely get stale.