Why Learn to Code?

Photo Credit  via Flickr / Creative Commons

Photo Credit via Flickr / Creative Commons

Lots of people these days are interested in teaching people to "code."  This post is about why I think that is both a good idea, and a slightly misguided idea -- and why I'm doing it anyway.

Good Idea

My observation has been that smart people, from very different backgrounds, can learn to program if they want to.  Computer scientists are great, but programming literacy is much more powerful in the hands of people who are also trained as journalists, linguists, historians, artists, etc. For instance, my degree is in Political Science, and I have had very little formal classroom training in computer science. But I know enough to get some things done, and I know how to stand on the shoulders of giants by re-using their libraries and tools.  I believe that you can too.

It doesn't have to be world-changing: my wife has expressed interest in writing some programs to help her develop knitting patterns, or analyze the logs that she keeps for her fitness regimen.  I once wrote a small Python program to help analyze our kids' sleep patterns. It showed very clear trends in the amounts of sleep they needed, and guided us to make some bedtime and naptime changes that made a huge difference in the quality our lives.

So, anything that expands the community of people who are literate in programming strikes me as a good thing.

Misguided Idea

However, "learn to code" has taken on a life of its own. It's sometimes presented by economic development organizations that if more people would just learn to code, it would magically solve a host of economic and social problems. I'm not so sure that is the case.

"Learning to code" is not that simple. The best analogy I can think of is "learning about cars." There are many different stages of learning. Are you talking about learning to drive a passenger car? Learning to safely drive a heavy truck with air brakes? Learning to air up the tires and change the oil? Rebuild an engine? Design a new manufacturing process for building cars?

Some of these things can be learned by anyone in the space of a month; some of them take years to learn, and will only be mastered by a select few. I would argue that it's the same with learning to write software.

The kinds of things you learn in an introductory course can only plant the seeds. It's going to be up to the learner to take that seed and nurture it into deeper knowledge.

Why Me?

So why would I, in particular, want to teach an introductory programming class?  I can think of a few reasons.

First, I think Python is a great language. It was designed as a teaching language and should be easy to learn, yet it is more than powerful enough to get real work done. It performs well enough for most tasks. It has access to great libraries that provide a lot of C-implemented (fast) features, like NumPy, which can do a lot of what GNU R is used for, but with less pain. Programmers can be much more effective in Python than they can in Java or C#, yet job boards are crowded with postings for the latter. And don't even get me started on Ruby or PHP. In short, Python needs a little evangelism.

Second, the Python community has a great culture. Bad things happen, but they are generally not tolerated the way they are in other communities. Geek culture in general tends to be pasty-white and male, but PyCon has gone to great lengths to encourage women to participate. Even Forbes noticed the record number of talks by women at last year's PyCon. So I think Python would be a friendly way to welcome new people into the wider world of programming.

I also have a selfish reason. My Ancho simulation project is written in Python. Partly, I chose Python because I thought it would be easy for people to learn, so they can make use of what I'm doing. By trying to teach people Python, I'm testing that assumption.

Finally, I want to give credit where credit is due. I am explicitly riffing on Portland's CodeScouts, the brainchild of Michelle Rowley, for the class format we're using. I like the idea of self-directed learning where class sessions are more for help in areas where you're stuck. While we are obviously not as focused on women as CodeScouts is, the idea for the format and explicit diversity goals came from them.

If you or someone you know is interested in getting started with programming, check out our upcoming class!