Writing software is like driving a bus.
The best software engineers I know make writing code the central part of their day. Like playing a sport or a musical instrument, writing software requires first that you show up.
While the three of us were having coffee, a friend of mine once asked Dain Sundstrom how long it would take to become a really good Java developer. Dain's answer was "six hours . . . every single day."
You'd be amazed how many talented writers I know who don't succeed at writing (software or otherwise) simply because they don't sit down and write. Ultimately, the results are never as good as you want them to be, and what you want is never as good as people need it to be. So you've got to fall in love with the process as well as the product. You might not get paid for it. But if you love the process you'll get something to sustain you while you learn. You're not guaranteed to get better if you sit and write. But you're guaranteed not to get better if you don't.
Also, don't get too attached to your work. You might be proud of it, but don't get so proud that you resist hacking it to pieces in order to improve it. This was a hard lesson for me early on. But now, I've learned to sustain myself creatively by rendering all of my work from the day before worthless, or at least trying to. It means I'm doing my job. I call this practice "eating your babies". Some corporations take this mentality to an extreme and hire a division whose sole purpose is to dream up ways to put the parent company out of business before the competitors do. Then they incorporate the findings into their business strategy.
Baby eating requires you to simultaneously be more critical and more forgiving of your work.
My two cents on becoming a better programmer: long hours and good-old Jonathan Swift style baby eating.