"value":"\n <p>I often hear that code should be \"self-documenting\".<\/p>\n\n<p>Instead of writing a comment, you should create a function or class with that name instead.<\/p>\n\n<p>Whilst I agree with this, I think that code comments shouldn't describe what the code is doing - they should explain why the code is needed and provide any additional context to the person reading it.<\/p>\n\n<p>If a comment just says <code>Returns true<\/code> or <code>Sends an email<\/code>, that can be understood by reading the code, so isn't providing any extra value or context. They can also become outdated as the code changes.<\/p>\n\n<p>If a line of code is needed to fix a certain state or situation, or if a piece of code isn't particularly readable and isn't obvious what it does, those are good times to add comments.<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>I often hear that code should be \"self-documenting\".<\/p>\n\n<p>Instead of writing a comment, you should create a function or class with that name instead.<\/p>\n\n<p>Whilst I agree with this, I think that code comments shouldn't describe what the code is doing - they should explain why the code is needed and provide any additional context to the person reading it.<\/p>\n\n<p>If a comment just says <code>Returns true<\/code> or <code>Sends an email<\/code>, that can be understood by reading the code, so isn't providing any extra value or context. They can also become outdated as the code changes.<\/p>\n\n<p>If a line of code is needed to fix a certain state or situation, or if a piece of code isn't particularly readable and isn't obvious what it does, those are good times to add comments.<\/p>\n\n ",