File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2568,3 +2568,31 @@ class Client {
25682568```
25692569
25702570** [ ⬆ back to top] ( #table-of-contents ) **
2571+
2572+ ### TODO comments
2573+
2574+ When you find yourself that you need to leave notes in the code for some later improvements,
2575+ do that using ` // TODO ` comments. Most IDE have special support for those kind of comments so that
2576+ you can quickly go over the entire list of todos.
2577+
2578+ Keep in mind however that a * TODO* comment is not an excuse for bad code.
2579+
2580+ ** Bad:**
2581+
2582+ ``` ts
2583+ function getActiveSubscriptions(): Promise <Subscription []> {
2584+ // ensure `dueDate` is indexed.
2585+ return db .subscriptions .find ({ dueDate: { $lte: new Date () } });
2586+ }
2587+ ```
2588+
2589+ ** Good**
2590+
2591+ ``` ts
2592+ function getActiveSubscriptions(): Promise <Subscription []> {
2593+ // TODO: ensure `dueDate` is indexed.
2594+ return db .subscriptions .find ({ dueDate: { $lte: new Date () } });
2595+ }
2596+ ```
2597+
2598+ ** [ ⬆ back to top] ( #table-of-contents ) **
You can’t perform that action at this time.
0 commit comments