Beginning programming

In Metacademy, we're trying to build a dependency graph of knowledge to help you find the most direct path to learn about a topic. But some topics are so important and fundamental that they're simply used everywhere. If you do any sort of programming, there are
some basic concepts you'll simply have to be familiar with: control structures, functions, arrays, and so on. These are the air you breathe,
the water you drink. Trying to list all the things that depend on them would be hopeless.

If you have already taken a university level programming course, or AP Computer Science, or have taught yourself enough programming to write simple programs (e.g. games), then you know enough to use Metacademy. You can skip the rest of this roadmap. If not, then read on.

What language to start with?

Really, you can start with any general-purpose programming language, such as Python, Ruby, Java, C, C++, C#, Go, JavaScript, etc. Most of the topics covered here will be similar enough in all of these languages that if you learn them in one language, you can quickly pick them up in any other.

All the languages I just listed are procedural programming languages, where statements are executed in order, and programs are structured in terms of procedures. At some universities, the introductory courses are taught in a functional programming language, such as Scheme or Haskell. You're free to follow this path as well, and being comfortable with functional programming ideas will pay off even in imperative programming languages. But be warned that this road can be more difficult, since the mapping between programs and algorithms is less obvious. Also, since functional and imperative languages are very different, it will be more work to translate what you've learned from one setting to the other. (Introductory college courses which use Scheme or Haskell are typically intended for students who have already done some programming in an imperative langauge.)

If you don't have a reason to want to learn a particular language, our recommendation is to start with Python. Here are some of the advantages:

The core language is clean and simple, and presents fewer hurdles to beginners compared with some of the alternatives

It is "batteries included," i.e. a lot of important functionality is included in the standard libraries

It is one of the most popular languages for introductory college courses, so there are lots of materials out there

It is an interpreted language, so you can quickly experiment in an interactive shell

If you are impatient to get started, try one of the JavaScript tutorials listed below. The advantage is that JavaScript runs in all modern web browsers, which makes it easy for web sites to provide interactive exercises. You can start programming without having to install anything. The downside is that JavaScript has lots of gotchas which will bite you once you start writing programs of any significant size. On the balance, you'll probably save yourself time by starting with a language like Python.

What to learn?

You should be comfortable with all the things we use on a daily basis when programming. In particular:

Know the basic syntax of the language: statements and expressions, comments, etc.

Know what variables are and what it means when you assign to a variable

Be familiar with basic data types like integers, floating points, and strings, and the operations you can use to manipulate them

Know and be able to use the basic control structures: conditionals and loops

Be able to decompose your code into functions (or methods or procedures, depending on the language) and understand why it is a good idea to do so

Be able to use some basic data structures (for the purposes of this roadmap, you don't need to understand what's going on beneath the hood)

an array or list type (e.g. arrays in C or Java; lists in Python)

an associative array (e.g. HashTables in Java; dictionaries in Python; objects in JavaScript)

a record data structure (e.g. structs in C; classes in Java and Python; objects in JavaScript)

Know the language's common idioms for iterating over arrays and associative arrays

Where to learn?

There are hundreds of textbooks, online courses, tutorials, and other kinds of introductions to programming out there. Any of them will probably cover all or most of the topics listed above. We list here a few free online resources which we happen to know about.

Option 1: online programming course

Do one of the following:

The EdX course CS50, Introduction to Computer Science, is Harvard's introductory programming course, aimed at non-majors. This has a light-hearted style, with high production values. The course covers several languages, but the relevant parts are taught in C. You should watch the videos for Weeks 0 through 3, and do problem sets 1 and 2.