‹ Back


Tips & Tricks

Five Methods for Learning How to Code

Mike Cavaliere • May 17, 2018

One of the biggest challenges for most people learning to code is the overwhelming amount of options. Not just in technologies, but in learning methods.

I’ve heard a fair amount of people ask, “What’s the best way to learn to code? Should I get a computer science degree? Or just take a coding bootcamp? Or learn from Lynda.com?” All of those are means to a similar end, with their own pros and cons. CS programs will give you more background and theory, but they also take tons more time. Bootcamps will get you productive quickly but probably won’t go as deep into CS. And there’s also nothing like real-world, on-the-job experience, which is another way to learn a ton.

So what’s the best way to learn to code?

The simple answer is this: Teach yo’self! Sort of.

I’m not telling you to learn everything on your own… not at all. I’m telling you to teach yo’self… as a supplement. Lemme ‘splain.

What are you talking about?

Professional programmers do a lot of self-study. In StackOverflow’s annual study of over 100,000 software developers in 183 countries, a whopping 86.7% percent of respondents claimed to have taught themselves a new programming language, framework, or software tool without taking any kind of course. In 2016 and 2017, respectively 69.1% and 91.1% of professional developers considered themselves “self-taught” in some capacity. That’s like, hella developers. Lots and lots.

The very important part to note is that these people aren’t completely self-taught–they often have at least bachelor’s degrees. But this huge chunk of the programming population has done significant amounts of self-teaching part of the time. Their primary sources of learning may be in other places, but the vast majority of them do plenty of work on their own.

What this means is that no matter what type of programming education you pick, you must practice and learn on your own as a supplement. Most professional coders I know do just that. Having a good education program of some sort is a great thing. But if this survey is any indicator, personal projects, drilling, and other forms of self-study are equally important.

Methods of self-teaching

So now we’re getting to the nitty-gritty. There’s no shortage of information and tutorials out there on any programming technology you can dream up. Learning how to learn a programming technology is the most valuable thing I can show you in this area. It’s not as simple as reading a bunch of stuff or watching videos.
So here are a few learning approaches that will help you consume programming tutorials in a valuable way.

Method #1: Coding Challenges

There’s a great subreddit with daily programming exercises of all different skill levels. And plenty more places on Google to find more.

Solving novel problems challenges your critical thinking and exposes you to a large variety of situations. Note that many of these are designed just to challenge you—they’re not necessarily based on situations you’re likely to run into in the real world (some are, some aren’t).

That’s OK, though—your ability to respond to new, never-before-seen situations is part of what you’re improving here.

Method #2: Documentation Drilling

To get a good hold of any programming language (or plugin, API, framework, etc.), I like to take time out to drill the different methods/functions/commands repeatedly.

For example, back when I first learned PHP, I remember taking the documentation and repeatedly typing out echo (and in_array, print_r, urlencode, etc. with their relevant parameters) to make using these methods second nature. Part of being a coder is muscle memory; the more you’ve typed something, the easier it is to retrieve it when you need it.

This gives you the added benefit of experimenting with the input/output of each of these methods while you’re typing them out. So not only are you teaching yourself to retain what command you need for a given task, you’re also retaining the different ways that command can be used. This is particularly handy for tools like jQuery, which allows one method or function to be called a dozen different ways.

Method #3: Programming Workshops

Individual workshops—the kind where you can get plenty of keyboard time, instead of just listening to someone talk all day—are great ways of learning something and drilling it right there on the spot. We’ve gotten some great feedback on the ones we’ve conducted as well.

Method #4: Reverse Engineering

Back before tech blogs and StackOverflow existed, we had big-ass programming books. They cost a lot, weighed enough to give you herniated discs, and were dense enough to kill a mugger if you hit him with it.

Google may not have had so many tech resources at the time, but you could still view the source of a webpage. That was like gold to me—every time I saw something cool, I looked under the hood to find out what it did. If I couldn’t tell by looking at it, I downloaded the HTML source and tried to recreate it on my computer.

As a result my HTML and CSS skills got better and better. Nowadays a lot can be gleaned from viewing your favorite website in the Chrome web inspector, toggling CSS styles, and running JavaScript commands in the console.

Mastering this method of learning is super powerful, since it gives you the ability to learn without being taught. This helps you go beyond tutorials and figure out stuff that most people don’t know—which is a skill that makes you far more valuable to clients and employers.

Method #5: Typing Out Programming Exercises

This is something people are often naturally drawn to, but it bears mentioning—especially the way I recommend you do it.

In your video courses, blog tutorials, and in-person courses, you’re guaranteed to get programming examples for each topic. Write them out piece by piece. At each step, try to iterate to something that functions in a small way.

For example, if the tutorial is on how to build a tabs component with jQuery, break it down into steps. First list out the HTML. Then use jQuery to hide the tab content. Then add a click event to toggle the active tab, and so on.

At every step, also let yourself break the tutorial’s rules and fiddle around. When I was a kid, I used to build my Legos according to the instructions… then I’d take them halfway apart and rebuild them my way. Doing the same with coding tutorials helps you really understand each concept, since you’re seeing it from multiple angles. (See Reverse Engineering.)

What are you waiting for?

Now you have five great methods for learning to code. You can use them throughout your career to continually better yourself as a developer. Try them all out, and let us know how they worked out for you. You won’t regret it.