Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 3
    "50% of text is comments" is a good rough target regardless of language or kind of code. Keep in mind, good names can and should minimize the need for comments. Never explain with a comment what you can explain with clearer code. Don't think you should comment every line of code. NEVER saddle code with comments that mean the code can't be refactored without changing the comments. Remember that test code is also code. Comments should be about WHY the code does what it does. Not how. Talk about user stories whenever the code is ABOUT the user story. Commented Dec 16, 2017 at 18:42
  • If your user stories are of the form "Given state, when action, then result", that maps directly onto an "Arrange, Act, Assert" style test. If all that differentiates the text of the user story from the text of the test is some extra punctuation, you don't need comments. Commented Dec 19, 2017 at 10:38