I think this is over-indexing "perfect" a bit. My intended point is that practicing the "correct" way will lead to improvement and especially to learning "correct" habits. Perhaps replace "correct" with "helpful"; it's about paying attention to the actions one takes and ensuring that they generally aid in progressing towards a goal.
If the goal is to make a program, I make sure that my thoughts about the program are sound before actually building it. If I need to play around a bit to understand the problem domain then I additionally need to be prepared to throw out the play-work. If I run into a bug, I remember it and proactively avoid it in the future. I think about the limitations of my design before I start building. This is my implementation of writing "without bugs"; it doesn't have to be perfect, it just can't be something which I know to be wrong.