# Code Tells You How, Comments Tell You Why

**URL:** <https://discourse.codinghorror.com/t/code-tells-you-how-comments-tell-you-why/662>\
**Category:** blog\
**Created:** [December 18, 2006, 12:00am UTC](https://discourse.codinghorror.com/t/code-tells-you-how-comments-tell-you-why/662 "2006-12-18T00:00:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![codinghorror](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/codinghorror/32/36371_2.png) [@codinghorror](https://discourse.codinghorror.com/u/codinghorror)\
**Post date:** [December 19, 2006, 12:00am UTC](https://discourse.codinghorror.com/t/code-tells-you-how-comments-tell-you-why/662/4 "2006-12-19T00:00:00Z")

</div>

Sometimes when I’m writing code, I think “I should comment this”

Right. The first and proper response to that feeling is to _roll up your sleeves and refactor the code_. After you’ve refactored, if you still feel a comment is necessary, then by all means add one. Never comment before you’ve attempted to refactor away the comment first.

---

_[View the full topic](https://discourse.codinghorror.com/t/code-tells-you-how-comments-tell-you-why/662)._
