Taken from this StackOverflow comment:
- Thinking before coding
- Fixing bugs or potential for bugs as soon as I see one (not leave it for tomorrow)
- Test each little piece of functionality that makes sense on its own
- Have it as principle to avoid quick hacks
- Use defensive programming techniques everywhere where possible (immutable objects, read-only properties, type constraints etc.)
- Write self-explanatory code and comments where code may seem not easy to understand
- Avoid sophisticated expressions that require a very fresh state of mind to comprehend
- Avoid dense blurbs of code, better make it more verbose to avoid misunderstanding (not saving a few characters on code block brackets helps greatly)
- Avoid duplication of code. It will be later next to impossible to trace all instances.
- Avoid magic constants in code. Even if you're 200% sure you'll only need it in one place, extract it to a constant. Will do you good.