Skip to content

Commit 010e10f

Browse files
committed
📜 Docs: update comments convention
1 parent 8d1c169 commit 010e10f

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

docs/contribute/convention-guide.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@ These rules are not set in stone, and there may be exceptions. If you'd like to
1212

1313
## Comments
1414

15-
### Don’t use comments
15+
### Don’t overuse comments
1616

17-
Unless:
17+
Comments are helpful if:
1818

19-
1. The code itself is ambiguous
20-
2. The ambiguity can't be explained in tests or docs
21-
3. You’re writing a shared util that is ambiguous and used by different areas of the codebase. In this case, creating a docstring comment is acceptable.
19+
1. The code itself is ambiguous or complicated
20+
2. You’re writing a shared util that is ambiguous and used by different areas of the codebase.
2221

23-
Instead of using comments:
22+
While comments can be helpful to explain complexity, strive for simplicity by:
2423

25-
1. Write code that is self-explanatory
26-
2. Write tests that explain the code
27-
3. Create a diagram/doc in this repo. You can then create a comment that links to the diagram/doc.
24+
1. Writing code that is self-explanatory
25+
2. Writing tests that explain the code
26+
3. Creating a diagram/doc in this repo. You can then create a comment that links to the diagram/doc.
2827

2928
### Why this rule exists
3029

0 commit comments

Comments
 (0)