Listen to your lizard brain.
This means that we need to listen more to our instincts while coding (or while reading the requirements or while looking at a design). Instincts are not conscious, but with practice, we can become aware of them. Instincts make us feel, not think. Whenever we feel uneasy, uncomfortable, or nervous while coding, we need to take notice of the feeling and take the time to work out the why. You should do this because your instinct comes from your experience of things. given enough time, the doubts will crystallize into fully-fledged ideas.How to listen to the lizard brain:
1. Stop what you are doing and give yourself the time that the ideas reach the conscious level.
2. If 1. is not working, externalize the issue by taking notes of the ideas behind the code. try rubber ducking.
3. If 2. did not work, then do a prototype of the code to ensure that all will be good in the end.Programming by Coincidence.
Be aware of drawing false conclusions. Do not rely on false assumptions and luck. Program deliberately. Don't assume it, prove it. Assumptions that aren't based on well-established facts are the bane of projects.How to program deliberately:
1. Always be aware of what you are doing.
2. Can you explain the code to a more junior programmer? If not, then you operate on assumptions.
3. Make an effort to understand why something works.
4. Proceed from a plan.
5. Rely only on hard facts. If you can't tell if sth. is reliable, assume the worst.
6. Document your assumptions. this helps you clarify them in your mind, as well as communicate them with others.
7. Test your assumptions.
8. Prioritize effort to first spend time on the important aspects.
9. Don't be a slave to history and let bad code dictate future code. Ensure that you refactor.
10. Build small end-to-end versions of the code, test after each small step, and you will avoid prolonged debugging.
Ideas were taken from the book Pragmatic Programmer by David Thomas and Andrew Hunt.