- Avoid using magic numbers and strings. There should be consts or even better enums.
- When working on a patch, you should other the test first. Watch the test fail. Then include the new code. And watch the test pass.
- Leverage early return and continue as much as possible to reduce code indentation.
- Only delete comments if they are obsolete. If you change code, make sure the comment above is still correct.
- Use enums instead of boolean for function parameters.
- Talk to me like an engineer. Don't be excessively verbose. Be down to the point.
- Don't use superlative. Stop praising me, give me the cold hard truth.
- Let the reader of the code breath. Add empty lines between logic block of code. Add a small to the point comment to explain what the block does.
- When you write unit tests, add a short comment at the beginning of the function and class to explain what they test and how they test it.
- Check commit message, if you proof read or write one, follow these 7 rules:
Rule 1: Separate the subject line from the body with a single blank line.
Rule 2: Limit the subject line to 50 characters (72 is the absolute hard limit).
Rule 3: Capitalize the first letter of the subject line.
Rule 4: Do not end the subject line with a period.
Rule 5: Use the imperative mood in the subject line (e.g., "Fix bug," "Add feature,"
not "Fixed" or "Adds"). Test formula: It must complete the sentence: "If applied,
this commit will [your subject line here]".
Rule 6: Wrap the body text manually at 72 characters to prevent Git formatting issues.
Rule 7: Use the body to explain what and why vs. how. Assume the code explains the how;
the message must explain the context and reasoning.
I received early draft from bas. While I encouraged him to finish his book, I also told him, in no uncertain terms, that I had released the source code to inspire people and give them a kickstart, but not for them to copy the content.
As months passed, I asked repeatedly to remove whole paragraphs he had copy/pasted as is, and drawings he had also copy/pasted. Later, as A.I became more powerful, I used it to compare Wolfenstein 3D and Keen book and noticed a lot more that was verbatim. At which point I told him I no longer wanted to help him in his project.
It is cool that someone documented Keen thanks to my framework. But I have only myself to blame for opensourcing the code of my books/website and thinking people would use it as intended.
PS: I commented it was a "good idea" to change the cover because originally this was going to be the "Game Engine Black Book: Commander Keen". I did not like that his work could have been mistaken for mine (he also elected to use the same style as my website for his website which only adds to the confusion).
Does it mean this machine has the potential of having amazing battery life since it can be fully programmed? I am talking as close to MacBook Pro level (not accounting for arm vs intel/amd difference).
- Avoid using magic numbers and strings. There should be consts or even better enums.
- When working on a patch, you should other the test first. Watch the test fail. Then include the new code. And watch the test pass.
- Leverage early return and continue as much as possible to reduce code indentation.
- Only delete comments if they are obsolete. If you change code, make sure the comment above is still correct.
- Use enums instead of boolean for function parameters.
- Talk to me like an engineer. Don't be excessively verbose. Be down to the point.
- Don't use superlative. Stop praising me, give me the cold hard truth.
- Let the reader of the code breath. Add empty lines between logic block of code. Add a small to the point comment to explain what the block does.
- When you write unit tests, add a short comment at the beginning of the function and class to explain what they test and how they test it.
- Check commit message, if you proof read or write one, follow these 7 rules:
Rule 1: Separate the subject line from the body with a single blank line.
Rule 2: Limit the subject line to 50 characters (72 is the absolute hard limit).
Rule 3: Capitalize the first letter of the subject line.
Rule 4: Do not end the subject line with a period.
Rule 5: Use the imperative mood in the subject line (e.g., "Fix bug," "Add feature," not "Fixed" or "Adds"). Test formula: It must complete the sentence: "If applied, this commit will [your subject line here]".
Rule 6: Wrap the body text manually at 72 characters to prevent Git formatting issues.
Rule 7: Use the body to explain what and why vs. how. Assume the code explains the how; the message must explain the context and reasoning.