Skip to content

Commit 16f1feb

Browse files
committed
update docusaurus
1 parent d1cd7fb commit 16f1feb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

website/src/pages/index.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,10 +1070,12 @@ const { fontSizes } = useTheme();
10701070
10711071
### Comments
10721072
1073-
In general, try to avoid comments by writing expressive code and naming things what they are.
1073+
Favor expressive code over comments by using meaningful names and clear logic. Comments should primarily explain "why," not "what" or "how."
10741074
1075-
Use comments when you need to add context or explain choices that cannot be expressed through code (e.g., config files).
1076-
As a rule of thumb, try to explain "why" in comments, not "how" and "what".
1075+
Use comments when:
1076+
1077+
- Context or reasoning isn't obvious from the code (e.g., config files, workarounds).
1078+
- You need to reference related issues, PRs, or future improvements.
10771079
10781080
```ts
10791081
// ❌ Avoid
@@ -1082,12 +1084,12 @@ const m = s * 60;
10821084
// avg users per minute
10831085
const myAvg = u / m;
10841086

1085-
// ✅ Use - Expressive code and name things what they are
1087+
// ✅ Use - Prefer expressive code by naming things what they are
10861088
const SECONDS_IN_MINUTE = 60;
10871089
const minutes = seconds * SECONDS_IN_MINUTE;
10881090
const averageUsersPerMinute = noOfUsers / minutes;
10891091

1090-
// ✅ Use - Add context to explain why in comments
1092+
// ✅ Use - Add context to explain why
10911093
// TODO: Filtering should be moved to the backend once API changes are released.
10921094
// Issue/PR - https://github.com/foo/repo/pulls/55124
10931095
const filteredUsers = frontendFiltering(selectedUsers);

0 commit comments

Comments
 (0)