Most important requirement for learning is to have a concrete project to work on. One year back I was too confused about how to improve and try to code a great code in my first major project.
What I learned after researching a lot is code and just code with an aim in mind.
Another thing is try to follow coding conventions which exists in your choice of language. For example, in python world pep8 conventions are followed and I did the same. Don't ever think that let me code first and then I will worry about conventions. Conventions are there for your benefits, use them.
Learning to code is easy but learning to write proper and maintainable code is a must.
After some time (if you are in learning stage not on sharp deadlines) go back and read your old code again and there is lot of chance you will cringe at it or may want to improve it.
No code is perfect. Always try to refactor after writing a working code.
Always unit test your code because unit test brings out your mistakes very soon not when you have written so much code that it pains you to find out that small mistake.