8 Simple Tips to Teach Yourself to Program

October 10, 2011

Back in college, I always assumed that computer programming was best left to the few strange people who wanted to be professional developers upon graduation. The intimidating course descriptions for the computer science classes at my school, combined with their apparent irrelevance to my financial career path, scared me off. I never signed up for one.

Flash forward three years to the present day and there’s nothing I regret more from college than missing the opportunity to learn how to program. As it turns out, programming is a vastly more useful skill in the real world than I ever imagined, and not just for developers. If your job is based in excel (almost everyone I know), or the internet (everyone else), there’s a strong chance basic programming will someday be extremely useful. For me, that meant automating a research process that could end up saving me, literally, days of my time by running a simple program to parse and clean data from a website. So I finally bit the bullet and decided to teach myself to code.

Learning to program without the benefit of a professor, a tailored curriculum, and set of like-minded peers is difficult, but not impossible. I’ve found the hardest part is learning how to learn how to program. Here are some tips and tricks I’ve found useful in my initial plunge into the wide world of coding:

1) Don’t stress out about your choice of language. Start by deciding what general task you’re interested in — whether it’s designing websites, manipulating databases, writing excel macros, or anything else — and do a bit of research to determine which languages are best at these tasks. But once you’ve settled on a general family of languages, don’t stress out about which one to choose. You’re just getting your feet wet and they’ll all have the functionality to accomplish the basic tasks you’re asking of them. I picked Python because it’s known as fairly easy to learn and good at what I needed it for, but most of my advice will work for any language you settle on. If you do decide to switch later, it’ll be infinitely easier to pick up a second language than it was to start from scratch.

2) Make sure your resources are intended for true beginners. I’ve wasted a lot of time downloading manuals and watching videos that were actually intended for experienced developers switching over to Python for the first time, instead of pure novices like myself. Not surprisingly, they lost me pretty quickly. A good beginner’s resource is going to start with a basic explanation of how to use the software and explain each piece of new vocabulary in layman’s terms. If your resource incorrectly assumes you know the difference between a “command line” and a “string,” dump it and find a new one.

3) Find a comprehensive set of classes that can serve as the backbone of your curriculum. Youtube is a great place to start, but be sure to pick a coherent course that spans multiple hours. If you rely on one minute snippets you’ll be left with big gaps in your knowledge and waste a ton of time on overlapping topics. I found a two-day class on Python made for Google’s employees that I’ve found very concise and user-friendly, and it’s just the right length.

4) Be conscious of the product version. If possible, try to find a course based in the same version of your language (for example, v3.2) to avoid having slightly different functionality or syntax. I must’ve wasted half an hour just figuring out how to write my own name in Python before realizing that my version of Python required an extra set of parentheses.

5) Don’t get bogged down on a difficult task. Because you can’t interact with your professor, you’re inevitably going to get stuck — badly— at some point or another. Don’t be afraid to consult another resource that might do a better job explaining a certain concept, or even skip it altogether. The important thing is to keep your wheels moving and experiment on your own. A few gaps here and there aren’t the end of the world. I’ve found that if I come back to a difficult problem with a fresh outlook a week later, it virtually solves itself.

6) Try to find someone to talk to about the basics. You don’t need someone who’s an expert in your language, just someone who’s learned a language before and knows how to go about the process.My colleague Brandon Hickie has been a great help setting me on the right course and is the origin of some of the tips I’ve brought up in this post.

7) Write as many stupid programs as possible. At the beginning, you’re not going to be able to write a program that actually accomplishes something useful. But even if the content is total gibberish, writing as many programs as possible will make you more comfortable with the syntax and get you thinking like a programmer. Don’t give in to the temptation to skip over laughably useless programs that your curriculum asks you to write. Getting the basics down cold at the beginning will allow you to focus on the content when the time comes to put your programming skills to use.

8) Stay organized. Keep all of your programs, even the stupid ones, and write comments explaining what you were trying to do and how you did it. If you’re ever stuck, refer back to an old program that accomplished a similar task for clues as to what you’re doing wrong. I’ve found this infinitely easier than trying to comb the web for an answer, because my own comments are written in a way that I understand.

Learning a programming language, like learning a foreign language, takes a good chunk of time and a lot of mental effort. But if I can do it, anyone can. The biggest challenge is learning enough that you can experiment on your own and diagnose your own errors.  After that, it’s smooth sailing, and you might even have fun doing it.

Behavioral Data Analyst

Nick is a Behavioral Data Analyst at <a href="https://www.betterment.com/">Betterment</a>. Previously he analyzed OpenView portfolio companies and their target markets to help them focus on opportunities for profitable growth.