So you want to learn to program

Last week my friend asked me how she could learn to program. She’s a lawyer now, but she took one C++ programming class in college years ago.

I started down some long path: “Python is a nice beginner language. But you’ll want the most current Python version. You use a Mac, so you should get homebrew, so you can download the latest Python. Then you’ll need to install pip so you can get new Python packages. And you’ll do better in an IDE, so you should probably get Pycharm from JetBrains.”

What, am I insane? She doesn’t want to do all this. So I backed up: “What are you interested in about learning to program?”

Different goals of learning

  • Do you want to become a professional programmer?
  • Do you already know how to program one language and want to learn another?
  • Do you want to solve some specific problem just for yourself?
  • Do you want to understand more about how the world works?

My friend, as it turns out, just wants to understand more about how the world works. She knows code underlies everything on the Web, but she doesn’t have any sense of what is actually going on. She wants to play around with code for a bit, like taking a cooking class. Now, I have some place to start.

We learn by doing

Prior to GPS, we used paper maps to navigate in a new place. We would look at where we were, look at where we wanted to go, and make decisions about which route to take to get there. This act of making decisions is what allows us to develop an internal map of a place. This is why GPS so comprehensively interferes with our native way-finding abilities. The GPS makes the decisions for us, and so we do not build up our internal maps.

The same thing is true with programming. To learn to program, you must make decisions about which action to take, or which code to write. It is not enough to follow along with a tutorial, or read a book, or watch a lecture.

Beginner programming

So you need an environment in which you can make decisions about code, but in which you don’t have to begin by installing (and trouble-shooting) a huge mass of code onto your computer. The answer is Web-based teaching tools.

My favorite of these is Codecademy. (Note the spelling is a little weird there; there is no a at the beginning of Academy). Go to Codecademy, create a free user account, pick a lesson, and start working on it. The first one is “Make a Website”. They break material down into bite-size chunks, and provide a playground in which you can try things out. You do all your coding on a web page, and you see the results on that same web page. They run your code and identify errors and places where you have not done the required task. You don’t have access to the full output of the compiler or the run-time, so it is sometimes frustrating as an experienced programmer. But the tradeoff is that it is much simpler for someone new to coding.

Codecademy is focused on web programming (HTML, Javascript, Ruby, SQL), but they provide some general programming lessons as well (Python, Java). If you get into it, you can buy their paid product, which includes lessons you develop in your own environment, not in their web-based playground.

Khan Academy also has a nice set of web-based playground lessons, geared more towards children than adults.

Team Treehouse has another nice set of lessons and an active user-community for when you run into problems.

2 thoughts on “So you want to learn to program”

  1. Wow!
    Your site!
    First time seen, and such clarity of comment!
    I’ve done tech writing privately for family & friends (long ago) but could only dream of writing with such succinctness.
    Your work is now (or soon will be when I reread that bit) hard-linked and symlinked to my central bookmarks repository. (Whoops. No. Can’t hardL folders/directories – now I know why >grin< SoftL it is)
    You've gained a permanent limpet to your site.
    Thank you and well done.
    Cheers.

Leave a Reply

Your email address will not be published. Required fields are marked *