Lately I have been noticing many people who ask how they can better themselves and their code. I too ask myself this everyday, as we all should. So I have decided to touch on the subject to get you started and pointed in the right direction.
One of the best things I have found is whenever you find yourself in need of reading material, read documentation. Just start with Array, Hash, and Enumerable. Understanding those will put you leaps and bounds from where you stand without a good grasp on the basics. You don't have to memorize these, that is what they are there for. You just need to read through them every once in a while and let the concept of each sink in. Also, they make great bathroom reading material.
The next step is reading code and knowing what that code is doing. Anybody can write their own code and know what is happening(for the most part). You need to be able to understand code written by other programmers. Just direct your browser to www.github.com and look for a project that sparks interest in you. Read through the code in the project, understand what the code is doing and write comments for the code. Not only will this help you get a better grasp on fundamentals but it will get you used to reading code written by others and get you used to writing comments. This is a practice that not only others will thank you for, but you will thank yourself when you go back to code you wrote 6 months ago.
As you start to grow into your own skin, you have to face harder challenges. Refactoring code is a great step in becoming the programmer you want to be. In order to do it, you have to understand the code your reading and use critical thinking to make it better. A great resource for refactoring code is (www.refactormycode.com). It allows you to take a stab at refactoring and see how others approached the task as well.
In closing I would like to mention some of the most obvious things to help you progress:
1. Learn your editor inside and out. Know all the shortcuts and things that make you faster with your editor of choice.
2. Test, test, test. Testing not only helps you understand what your code is doing it will make your life much easier down the road.(Also most employers require it.)
<p>3. Start your own project. Don't start an easy project you already know you can knock out. Start one that will push you beyond your limits and force you to learn new things.</p>
<p>4. Lastly, always be writing code. Even if the code your writing is awful and makes most vomit at the sight of it, your making progress.</p>