---
title: "Discussion on \"Comments are useful. You just need to learn when to use them\" | Hashnode"
description: "Discussion on \"Comments are useful. You just need to learn when to use them\". Perhaps you may have heard some of the following statements:\n\n\"Code needs to be self-explanatory\"\n\"Comments are useless\"\n\"Don't write comments in your code\"\n\"Comments are a code-smell\" \n\"Comments are an anti-pattern\"\n\nThe thing is that writing commen..."
url: "https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Comments are useful. You just need to learn when to use them](https://blog.rodrigomd.dev/comments-arent-as-bad-as-people-tell-you?utm_source=hashnode&utm_medium=feed)

Perhaps you may have heard some of the following statements: "Code needs to be self-explanatory" "Comments are useless" "Don't write comments in your code" "Comments are a code-smell" "Comments are an anti-pattern" The thing is that writing commen...

Mar 22, 2021 · 7 min read · blog.rodrigomd.dev  
Updated Feb 16, 2022  
Read the article

-   [#coding](https://hashnode.com/tag/coding)
-   [#programming](https://hashnode.com/tag/programming)
-   [#best-practices](https://hashnode.com/tag/best-practices)
-   [#programming-tips](https://hashnode.com/tag/programming-tips)
-   [#clean-code](https://hashnode.com/tag/clean-code)

## Written by

[Rodrigo](https://hashnode.com/@rodrigomd)

@rodrigomd · Santiago, Chile

  
[View profile](https://hashnode.com/@rodrigomd)

Without pressure, there isn't action

I'm a Senior Software Engineer with 8+ years of experience. I love to apply design patterns, write clean code and do TDD while testing I'm interested in growing every day as a person and developer

## Responses 7

Markdown supported · ⌘↵ to post

[Avinash Dalvi](https://hashnode.com/@AvinashDalvi)

[Jun 5, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/60bbd44ee36d51141c95ba4a)

Insightful information [Rodrigo](https://hashnode.com/@rodrigomd) 👍🏻👍🏻👍🏻

[Rahul Banerjee](https://hashnode.com/@rahul2699)

[Mar 25, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605befd247b0d2243d4ad220)

Great Article!

[Siddharth Chandra](https://hashnode.com/@chandraji)

[Mar 24, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605adff178c4742436d4ea2f)

Awesome article, my thought before writing a comment is always to write the "WHY" of the function with minimal "WHAT" it does.

[Rodrigo](https://hashnode.com/@rodrigomd)

[Mar 24, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605adff178c4742436d4ea2f#reply-605b323578c4742436d4f5b5)

Thanks!. What you do it's an excellent approach

[Catalin Pit](https://hashnode.com/@Catalinpit)

[Mar 24, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605add2378c4742436d4e9af)

_"Occasionally you may find outdated comments in the code that can create confusion."_

Why is that happening? Because one might update the code and not the comments?

Nevertheless, amazing article. Well done! 👍

[Rodrigo](https://hashnode.com/@rodrigomd)

[Mar 24, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605add2378c4742436d4e9af#reply-605b327547b0d2243d4ac443)

You're right, that's the reason, I'll clarify that point in the article.

Thanks for the feedback Catalin :)

[Tarek Jellali](https://hashnode.com/@tarek-jellali)

[Mar 23, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605a7fa247b0d2243d4ab361)

Excellent article, well thought-out! I'd like to stress a lot about justifying choices or explaining why there must be a workaround by providing a Stack Overflow thread of a GitHub issue. This saved me countless times from trying to mess up something believing that I could make it better or fix it.

[Rodrigo](https://hashnode.com/@rodrigomd)

[Mar 24, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605a7fa247b0d2243d4ab361#reply-605b33f578c4742436d4f5ff)

You touched on an important point.

Sometimes, in our need to leave the code clean or optimal, we immediately change the original code for a better version, but sometimes, there is a reason behind that code and out of ignorance and not having a proper context, we end up changing it anyway.

Thank you, I'm glad you liked the article.

[Tarek Jellali](https://hashnode.com/@tarek-jellali)

[Mar 24, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/605a7fa247b0d2243d4ab361#reply-605b661e78c4742436d4fbe2)

[Rodrigo](https://hashnode.com/@rodrigomd) keep it up 🙌 !

[Maxi Contieri](https://hashnode.com/@mcsee)

[Mar 23, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/6059dc1b25962412b9818aba)

Amazing Article [Rodrigo](https://hashnode.com/@rodrigomd)!

[Rodrigo](https://hashnode.com/@rodrigomd)

[Mar 23, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/6059dc1b25962412b9818aba#reply-605a07045771a2129446c196)

Thanks, Maxi

[Edidiong Asikpo (Didi)](https://hashnode.com/@didicodes)

[Mar 23, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/6059a9045771a2129446b5e0)

I agree with you on this [Rodrigo](https://hashnode.com/@rodrigomd). Amazing article!

[Rodrigo](https://hashnode.com/@rodrigomd)

[Mar 23, 2021](https://hashnode.com/posts/comments-arent-as-bad-as-people-tell-you/60590b4625962412b98179c0/comment/6059a9045771a2129446b5e0#reply-605a06de5771a2129446c18b)

Thanks!
