These are probbaly not news to anyone who has any experience, but I’ve learned a few things the hard way in the wee hours of the morning. Making a list.
- Before you reboot a machine, be sure that the sshd server is starts on startup.
- If a runs a job repeatedly, always implement a sensible queuer.
- Never remove a file, always
mv $file $file.bakor similar. Better, use version control as much as possible.
- Increase your shell’s history size. Increase it more. You’ll forget how you set things up. Increase it more.
- Don’t skip the design process. Understand the requirements, then model the objects based on the API you’d like to use. Name the methods.
- Don’t use pre 1.0 software if you can help it. Related: Don’t upgrade unless you absolutely need a new feature.
- Don’t be afraid to write non DRY code.
- Don’t refactor when you’re adding new features. It’s fine to copy-paste 99% of a method and abstract it later.
- Each commit should be describable in one sentence. If it’s not easy to write a commit message summary, the diff is too large or unorganized.
- Don’t push new code without testing first (automated or otherwise). Even if it’s a one character diff.
- Branch aggressively. Clean old branches aggressively. Rebase aggressively.
- Be a stickler for typos, grammar, and clarity. The more time you spend now, while you still get it, the less time you’ll spend re-reading the code/spec when you revisit a few weeks/months later.
- Don’t skimp on the test suite. Definitely write all the easy tests. They will save you some day.
- Extract helper methods when you can. Refactoring test suites is just as important as refactoring code.