| 80 | * Add comments so others can understand your code when they try to find bugs or improve/extend it |
| 81 | * Comments in code should explain intent (or clarify techniques), not repeat the code (do not explain what is self-explaining) |
| 82 | |
| 83 | Poor: |
| 84 | {{{ |
| 85 | # Set free to True |
| 86 | free = True |
| 87 | }}} |
| 88 | |
| 89 | Good: |
| 90 | {{{ |
| 91 | # Indicate that the position is now free |
| 92 | free = True |
| 93 | }}} |
| 94 | |
| 95 | * Commented code should have a comment explaining why it is commented |
| 96 | |
| 97 | Unclear: |
| 98 | {{{ |
| 99 | #result = somefunction(somearg) |
| 100 | result = 0 |
| 101 | }}} |
| 102 | |
| 103 | Better: |
| 104 | {{{ |
| 105 | # Not working yet, @todo: fix somefunction |
| 106 | #result = somefunction(somearg) |
| 107 | result = 0 |
| 108 | }}} |