So you want to learn to code?

Image courtesy of @nails_by_nette

Image courtesy of @nails_by_nette

A friend asked me how one might learn to code, if they’ve never coded before. I rattled off some of the resources I knew about, but promised to send links. And then I realized that, of course, this friend isn’t the only person with this question… So I figured I’d share with the world.

I would suggest that, if you want to learn to code, you should sit back and think about your preferred learning style and your goals. Do you like to go totally self-paced? Do you need the structure of a class? Can you learn online, or do you need in-person interaction? Do you want to learn to build webpages, or do you want to do more back-end types of development—or do you even know that, yet? Do you need to work toward one big project, or are you content to build a bunch of small things? Is it important to you to understand the intricacies of how computers “think,” or do you just want to learn enough to make things? (I say “just,” but that’s totally valid!) Do you want to build things for fun, to enhance your current career, or to change careers?

Step one, if you’re very new to coding: the Hour of Code is a fun place to start; I really recommend you play through that. Right now. Go! (I just did it and have one suggestion: at the end of each level, be sure to click “Show Code.” Then you can see how the little logic blocks are actual pieces of code.)

code

If you just want to see if coding appeals to you, or if you want to start making pretty things immediately…

html-css-shirt-500x500-300x300… a really good place to start is by learning HTML, CSS, and JavaScript, in that order. That’s enough to build interactive webpages (though you’ll learn fairly quickly that adding one or two more languages to your toolbox will let you build even more powerful webpages). HTML isn’t “a programming language,” per se—you won’t get to use “ifs” and “do-whiles” like in the Hour of Code—but it’s a type of code, and it’s structured, and it’s an easy way to get your feet wet. CSS lets you make your HTML look good. And JavaScript (which is a programming language!) lets you add interactivity and just generally do neat things.

If you like working entirely at your own speed, Anchorage Programming Workshop has simple tutorials for HTML and CSS that you might want to work through. It’s OK to ask us questions, if you’re working through them and run into issues; if anything’s unclear, we’d welcome the opportunity to make the tutorials better! (They were designed to go with in-person classes, to allow people to work at their own pace while we talked and showed them examples. They should be complete, but, seriously, we’ll take feedback.)

If you prefer working at your own speed, but want more structure/feedback—and more depth—Code Academy is quite good; I’ve used them before. To pick up HTML and CSS, I recommend following their Web Fundamentals track. Then I recommend following up with jQuery and JavaScript.

If you prefer learning through classes (and identify as female), I’ve taken two of the Women’s Coding Collective classes, and I’ve enjoyed them immensely. I didn’t take their HTML or Basic CSS class, but I took their more advanced CSS class and also JavaScript/jQuery, and both were helpful. They’re two weeks long and cost $50 (unless you have a $17 off coupon). They’re timed so that you can work a full-time job and still take the class, and if you run late on the assignments, you can still do them and get feedback. The instructors are really good about interacting/answering questions on the class forum. And, as someone who tries to teach coding in my spare time, I’m really impressed by their approach to teaching. It’s very good.

One other option: if you prefer classes, if you’re thinking you want to build webpages as a job, and if you want to get up to speed as quickly as possible—or if it’s important to you to have one big project done when you finish—you could take the Skillcrush 101 class. They are predominantly female; men make up about 25% of their students. I suggest you start with their free 10-day bootcamp (which is good; I’ve done it), and if you like that, you can always move on to the full, $299 6-week course. (That seems like a big investment, to me, so I really would make sure you’ve at least played a little with HTML and gone through their bootcamp before you sign up. Just in case you hate it, you know? … But I don’t want to talk you out of it, if you’re considering it: $299 is a good deal, for all that they teach; there’s some user experience stuff, beyond just the coding, and that makes me like them a lot. I’ve also looked through some of their past students’ webpages, and they’re very good.)

If you want to do back-end development or scripting of repetitive tasks…

If you aren’t interested in building webpages, you might want to skip right into a different kind of language. There’s tons of debate about what language to learn first, and although I’ll make my recommendation, it isn’t a hard-and-fast rule that you should take as gospel. Because, really, it depends what your goals are. If you’re working in Windows, with Microsoft Office, and you have something you want to automate, it might be that Visual Basic is the most useful thing you could learn. If you have large data sets, something like MATLAB or the statistical language R might be your best bet. If you have a goal that points you at a specific language, learn that language. That’s awesome!

But let’s say you don’t have a specific goal. Your goal is just to learn—and to see what your options are for projects, once you know a little better what code can do.

If you know what this is, don't tell on me, please!

If you know what this is, don’t tell on me, please!

In that case, my recommendation is to start with Python. It reads a little more like English (really, like pseudocode) than most languages you might otherwise start with. It forces you to learn good indentation and spacing, because, in Python, those things affect how the code is run. (It’s OK if you don’t know what I mean by that; you’ll learn it very early in the process of learning Python!) It’s versatile enough that you can use it to build everything from little scripts to Dropbox. It has pretty good documentation, as these things go; and it does some things for you that, later, you’ll be grateful to have abstracted away while you were learning. (A note for people who already know how to code and have opinions about first languages: I learned in C/C++, and my bad experiences with that are showing. I think those are great languages, but I also think learning in something friendly and modern, first, is the right pedagogical move. Pointers and garbage cleanup and all of that? It can be learned later. If you disagree, feel free to make your counter arguments in the comments, and maybe you’ll convince potential programmers to follow your advice instead of mine.)

Python is, again, something you can learn via Code Academy, if you like self-paced learning. I haven’t tried it, but I hear good things about LearnPython.org, too.

It’s also something you can generally find in-person classes for. For women (or men who have female friends who also want to learn to code and will bring you along), see if Girl Develop It has a chapter near you. Different Python User Groups may have different rules for their workshops, but I know Boston Python Workshop follows a similar “women and friends” model, for their classes. See what your local group says, though.

Specifically for Anchorage: I’m trying to find other people to help run the Boston Python Workshop curriculum for Anchorage Programming Workshop, since my co-host is off in San Francisco being awesome for most of the year. (She got a Code for America fellowship! How cool!) I’m not willing to run through the whole thing alone, in two days, without any teaching assistants (or other teachers, to give my voice a break), and I’m not sure whether any of the female volunteers I have on tap know Python. (My Mr. would help, and he’s a good teacher and generally good at giving off an air of “not intimidating,” when he wants to. So maybe if I found one more woman who wanted to teach Python, we’d change our “only women can be teachers” rule to “a majority of teachers at any event must be women.”) There’s also some challenge with scheduling; the public library is definitely out, if we want to do the standard “Friday night and Saturday all day” setup. But I know it’s something people want, and I’m thinking through the logistics, I promise. Worst case, I’ll break up the curriculum into 2-hour chunks, or we’ll at least meet and all work on Code Academy in the same room together, OK?

If you’re a librarian who wants to learn Python, I hear there’s a pre-conference at PLA. (It looks like Ruby is taking Python’s place at code4lib. That’s not a bad place to start, either; it has a lot in common with Python!) Also, keep an eye on Library Juice Academy; they’ve offered a Python class in the past, and it’s on their website as something that might happen again.

I’m going through the O’Reilly book, and honestly, I don’t recommend it for someone who hasn’t learned another language or three already. It’s not a gentle introduction to programming. And it’s not as much fun as the online tutorials. (I almost feel like a bad librarian. I never, ever point people at books for learning code. It’s too easy to read the book and not do the examples, and then you don’t learn anything.)

If you want to know everything about computers, or theory generally appeals to you…

algorithmI am a little bit of a completist, so I always find myself drawn to Computer Science, which teaches, yes, programming, but also a lot about the fundamentals of how computers work (operating systems, assembly language), how code is compiled, and, just generally, a lot of theory. Much of what you learn in CS classes, you don’t end up using in the field, or you use it to make something that already works, work better. If you aren’t a theory wonk, there are better/faster ways to learn what you need to know. But it feels good to me—and to many people—to understand something down to its bones. If you’re one of those people, you might prefer to start your journey into coding with an Introduction to Computer Science class.

There’s almost always something relevant being offered as a MOOC. EdX is offering Harvard College’s Introduction to Computer Science, starting this week. You can earn a certificate, and it’s free!* Coursera offers Stanford’s CS101 as a self-paced class, for now; I’m sure they’ll also offer the instructor-paced version in the future, as well. And they have a whole slew of other offerings. I personally found the Python class to be a little disappointing, because it was necessarily math-heavy and used a proprietary module for graphics rendering, but if you were thinking of going into game design, I think it would be a great starting point.

What I didn’t discuss

I know there are like a million coding bootcamps, right now. Those are great, but they’re pretty big investments, in both time and money. (Even the free ones require living in a different city for 3-6 months.) If you think you want to learn to code, try some of the suggestions in this post, first. Then, sure, look into bootcamps. (I am thinking about it, myself.. Because I know now how much I enjoy coding. But, even knowing that, it’s a pretty huge commitment.)

 

I know that’s a lot of words—more than my friend probably expected—but the upshot is, it’s a great time to learn to code! There are many options, catering to different learning styles and different goals, and many of them are free, or at least inexpensive. You can try out a couple of different methods and see what appeals to you!

 

*If someone local wants to take it, I’ll sign up and take it with you. Since there’s a lot of recap, for me, I can probably do the problem sets in less than the stated “10 to 20 hours” each. And I could use a refresher on some of the stuff in the syllabus.

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

About Coral Sheldon-Hess

Python dev, librarian, engineer, feminist, maker, bird nerd
Bookmark the permalink.

2 Responses to So you want to learn to code?

  1. Samantha B says:

    Coral, I signed up for the Harvard CS50x course! I saw Daniel post about it on Tumblr. Watched part of the first lecture during lunch and will watch the rest this weekend. I’m excited!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>