I spend most of my time thinking what needs to be done, and how to do it. Then I make the simplest possible prototype/POC and re-check my ideas. Then I think about use cases (test cases, actually) and keep iterating making small modifications (usually) to the code and finding more edge cases. My point is, the actual amount of time actually doing code-writing is very small, most time is spent figuring things out (thinking on the high level design/algorithm), writing out the ideas as code is usually the least part of the work. Finally I do cleanups/refactor, which are quite simple to do, but take non trivial amounts of time, including writting more documentation (e.g. code comments and descriptions for the PR for reviewers and for later reference).