How to Learn to Code

How to Learn to Code

Thanks to for the question! Shares appreciated!

There you go. Here’s the code that will get you past your first technical interview.

By the way, don’t ever write things like that.

So today, I got a question on Twitter, from Sabrina, widely known as the Nerdiest and Quirkiest person on YouTube

And I got really excited, because this is a question I should be qualified to answer! I’ve been coding since I was a little kid; I’ve been working as a developer for the past eight years. I completed a computer science major (though I didn’t wrap up the degree), and I’ve given talks, tech reviewed many books, read and written tutorials.

This is a question I should be qualified to answer.

Surprisingly though, this is a really difficult question. And it’s one that developers get asked a lot by people who are looking to break into the field. “How on earth do I get started?”

And there are two sort of stock replies, that I don’t think work very well. I want to talk quickly about both of them.

The first one is: get a degree! Study the fundamentals of computer science. If you want to develop game engines, you have to learn vector calculus. If you want to work on systems engineering, you have to learn boolean algebra. Study your algorithms!

The problem with this approach is that most developers are inherently lazy. That’s why they program computers to do things for them. It’s very hard to get invested in software when you’re not actually making something you’re excited about.

A lot of people will say “Learn C” or “Learn JavaScript”, or learn some other language or toolset. And usually that’s because it’s a tool that they use, to solve problems that they are excited about.

Programming languages are a lot like human languages. Just because you can read and write in French doesn’t make you a French novelist. And in the same way, just because you know the syntax of a programming language does’t mean you can solve problems with it.

There are a lot of languages out there, and they’re all designed around solving particular problems. But unlike human languages, most of them are designed to be somewhat friendly to people who don’t already speak the language.

Let’s use “Hello, World!” as an example. “Hello, World!” is usually the first program you’re going to write when you look at a new language. All you want is for the program to output “Hello, World!”, and that’s kindof the basic test to know you’ve got something that runs. So let’s pull up some examples.

What I want you to notice is that even if you don’t know anything about programming, you can tell that these are all pretty darned similar.

And what I think a lot of developers forget to tell you is that eighty to ninety percent of what you learn programming in one language, is going to be transferrable to another language.

We all tend to have our favorites — I tend to like Ruby, JavaScript, and Elixir — but don’t listen to people who say “You have to learn this or that”, because those preferences are based on personal preference, and the problems those people are trying to solve.

So I’ve argued that it’s not a great idea to try and force people into studying a particular academic field, or prodding them toward our favorite languages. But then where do we start? There’s a lot of information out there, and it can be very overwhelming.

I’m here to tell you that you don’t actually want to learn to program. What you want to do is solve a problem. Maybe there’s an app on your phone that you don’t like, and you want to come up with a better solution. Maybe you’ve decided that you want to have a website. Or maybe you want to build a game.

Learning “programming” is like practicing scales. It’s going to make you a very strong musician, but if you do that for years without ever playing a song, you’re going to get very frustrated. It’s a lot easier to learn something when you have a reason to want to know it.

For me, the first problem was high school math tests. I’d be using my TI calculator; I’d show my work; I’d make a little tiny mistake, and I’d get the wrong answer. That was a problem I wanted to solve. So I learned TI-BASIC, and I wrote some programs that would factor and foil and all that stuff. That way, when I found my answer, I could go ahead and check that it was right.

It was so much easier to learn that language, because I was using these tools to solve an actual problem that I had. I was excited to figure out ways to make it better and faster.

So before you look at programming at all, figure out a problem that you’re excited about. Something that’s going to motivate you to learn about the languages and tools available. And once you’ve built that really cool thing, you’re going to discover that you accidentally picked up a lot of skills along the way.

You may also like...

20 Responses

  1. Derrek McNab says:

    Ha. In the 90’s high school I learned how to code on a TI-83 without an
    instruction book. I made a multiplayer pass-and–play game called
    “Thieves”. Then I was asked to make another. So I made a more refined
    sequel based on problems and exploits my classmates found. I graduated
    before I finished the third one :(

  2. Peeja says:

    This was fantastic! I’ll be sharing this all over the place.

    BTW, if you don’t mind my asking, how do you do your zoomed jump cuts?
    They’re remarkably smooth. Do you re-zoom optically between lines, or do
    you zoom in post? I’ve found the former to be error prone and the latter to
    be pixellated… :)

  3. Fff Fff says:

    Good advice. Same advice I give people who say they want to learn Linux.
    Don’t learn Linux. Find something you want to do with it and then just
    jump in head first.

  4. Tali Finestone says:

    Great speaker!

  5. Larry Combs says:

    This is spot on! 

  6. Nataly RAW says:

    hahah you’re all noobs. I’m -10 years old and i program in machine code

  7. Simon Bilodeau says:

    You sir ! Just got a new subscriber !

  8. Lord Whirlin says:

    That is amazing advice, and I’ll definitely reference this video to others.
    Like you, I managed to start my ‘programming’ on the wonderful TI-83, just
    making simple text and menu based games. Subsequently I graduated to
    excel’s VBA to manage work related spreadsheets, etc. Programming is like
    having a skillset to be able to perform dynamic problem solving, and it’s a
    new way of approaching a problem, less about actually keying something!

  9. Marko Paunovic says:

    Watched this video, didn’t learn how to code.

  10. Boyinaband says:

    Definitely agree with finding something you want to do rather than learning
    completely abstractly. Good advice yo!

  11. TheSaucySauce says:

    Your python syntax was wrong. It’s: print(“Hello World”). Just saying.

  12. TheSaucySauce says:

    I started late. I was in the Marines. I’m about to complete college and
    feel like im behind people like you. What advice would you give me?

  13. mellowfish316 says:


    Good advice for people learning to code, though as someone who *is*
    classically trained (ie: Computer Science degree) I can’t recommend it
    enough if you want to have a career in software development. It makes a
    world of difference in algorithms knowledge and code reliability and
    performance that can take a decade or more of field work to make up, if you
    ever do between all the deadlines and shipping code.

  14. 100 Letters says:

    Awesome video man!

  15. Peter Churchyard says:

    Good video, once you start learning to solve problems with or without
    computers, you never seem to stop learning. I have been learning for about
    40 years and still find new things to learn most days. The more FUN you can
    make it the easier it is. There will be hurdles that seem to stop your
    progress, but so many resources are available for free. The main downside
    is that people starting now have probably too much choice. :)

  16. Rasmus Aaen says:

    This is the exact answer math teachers should give when asked why we should
    learn math.

  17. jASTDK says:

    I would also point out that this personal preference is also highly
    influenced by what tooling is available for a given language or set of

    For instance, I prefer C# over Java, simply because I much prefer the tools
    for C#

  18. ehhorvath13 says:

    fprintf (‘Hello World’)

  19. Puneeth Chaganti says:

    Solve a problem, don’t learn to program — via +Chaitanya C H 

  20. Jonathan Keane says:

    awesome video! shared!