Here’s how I learned to leverage projects and goals to become a programmer:
I dabbled in code when I was in college working on my minor in astronomy. For my stellar astrophysics course, we had to simulate a star for the final project. Throughout the semester, we worked through assignments that required some kind of code to solve. I squeaked through class by pushing Excel and its ability to iterate formulas over rows to its limits. For the final project, I had a set of seven differential equations I needed to iterate over at least 100,000 times. I realized that learning a little bit of code might make solving the project way less frustrating. I’m not sure why, but I went with C++ (probably because I thought it had a cool name). After a week of playing with online C++ tutorials, I could throw together some math into
int main() and see results (and yes, I did score an A on the project).
Flash forwards four years and I had forgotten pretty much everything I had learned about code. I was working for a web startup and felt silly that I had zero understanding of the platform on which my product was being built. So I decided to learn.
I didn’t have a goal in mind at first besides “learning,” which is a terrible motivator. I’m lucky that my addiction to learning kept me going, but I felt a distinct lack of direction. It was just an intellectual exercise. As soon as I felt satisfied that some new type of thinking had creeped into my brain (which happened shortly after finishing a few coding exercises) I lost momentum and motivation to learn. My progress slowed and stalled. That is, until I figured out how to redouble my efforts to actually become a programmer.
I had to define a problem for myself. At the time, we were comparing different online education websites. I wanted an automated way to learn about lots of websites very quickly and I wasn’t thrilled at the prospect of clicking through thousands of links to copy and paste millions of pieces of information, so I decided to build a web crawler (and, wow, I wish I had known about Udacity’s Intro to Computer Science course then). All of a sudden, I had this project that was clawing at my brain, pushing me to learn at an ever accelerating rate. I started writing programs with functions. I started implementing objects. I learned how to pull in the Beautiful Soup library. I started poring through inane details of Python documentation. I started learning about HTML and the purpose of tags and classes and hierarchical relationships. I got obsessed by the problem and got some help from the engineers at work. They helped me put together my code and I got the chance to see how real engineers work and think.
And, holy cow, did it feel good when it actually worked.
Long story short: if you want to learn how to program, give yourself a project and a goal. What do you want to be able to do? Something outlandish like “make the next Call of Duty from scratch” isn’t going to work. But “I want to make a box appear on the screen and make it move” could be perfect. Or maybe you could just automate one part of your day. Try a fun, small project and it will only lead to more interesting problems.
Give yourself a problem and get started!
 I currently work for Udacity