Skip to content

Commit c11ece4

Browse files
committed
docs: clarify that I see comments & summaries as useful + that its focus should be on the why and not the what
1 parent 00d5ccc commit c11ece4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ This means that comments in code are used only when necessary: if the informatio
120120

121121
Basically, this allows better [signal-to-noise ratio](https://en.wikipedia.org/wiki/Signal-to-noise_ratio): rather than having all members with redundant summaries, only the essential is there. In other words, if you see a "green stain" in the code (or in whatever colour you have configured in your IDE) you know it's something important and that you'd better read it. On the contrary, having all with redundant comments or summaries (set aside the out-of-date docs issue) trains your brain to just ignore it, so it's easier for that relevant info to go unnoticed.
122122

123+
> [!NOTE]
124+
> Just to be clear: this doesn't mean that I see written docs such as comments or summaries as wasteful. The issue is with summaries that say exactly what the method name already says (or if it adds new information to the name, I prefer to just improve the name with that info).
125+
126+
> [!IMPORTANT]
127+
> Comments should talk about the _why_, not _what_ the code is doing. The latter is a responsibility of the code itself. If I find myself trying to explain some aspect on what the code does, that's a symptom that it needs to be refactored to better convey its intent.
128+
123129
### Tools
124130

125131
#### PlantUML

0 commit comments

Comments
 (0)