Also, you don't see the first draft, you see the final edit.
For me, this means that it's OK to try stuff. For a long time I got mad at myself for taking half a day to change two lines of code. Of course to get to those two lines of code, I had to learn a lot and I had to try 10 different approaches.
The units of work for software development are learning and trying things, not lines of code.