I find that before I write any code, I first write down on a piece of paper the following:
1. The overall objective, purpose, or goal of my code
2. The steps to achieve it (using pseudo code or full sentences)
3. Any extreme cases to watch out for
It's a rigid, but useful habit I learned from my math and CS courses that I sometimes overdo to stay focused, minimize time wasted, and understand what I do and why.
#documentation #coding #codingstrategy #detailoriented