---
title: "Best practices for writing code comments"
url: https://daily.dev/posts/best-practices-for-writing-code-comments-ylopuoese
source_url: https://stackoverflow.blog/2021/12/23/best-practices-for-writing-code-comments/
type: article
source: "Stack Overflow Blog"
published: 2021-12-23T14:49:05.185Z
updated: 2021-12-23T14:49:05.185Z
tags: ["general-programming"]
reading_time: 8
upvotes: 23
comments: 2
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Best practices for writing code comments

**[Stack Overflow Blog](https://daily.dev/sources/stackov)** · 8 min read · 23 upvotes · 2 comments

## Summary

Comments are important because they help programmers make sense of code. A bad comment is worse than no comment at all, but it's hard to measure the quality of comments. Comments should not duplicate the code and should not excuse unclear code. Comments that add no information have negative value because they add visual clutter.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://stackoverflow.blog/2021/12/23/best-practices-for-writing-code-comments/>

## Community discussion

Top comments from developers on daily.dev.

**@formyapp** · 0 upvotes

> Never knew that are best practices for comment. Glad I found this article. Everyone should read this article

**@xantosromero** · 0 upvotes

> Comments are very important on the code. Fabolous article, great job friend.

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#general-programming](https://daily.dev/tags/general-programming)

[View this post on daily.dev](https://daily.dev/posts/best-practices-for-writing-code-comments-ylopuoese)
