Code.org thinks that everyone can learn programming logic, even elementary school children. The computer science education nonprofit has teamed up with guest lecturer Mark Zuckerberg to teach programming through an extensive library of video game creation lessons.

This morning, Code.org expanded its online library of computer science lessons (studio.code.org) for elementary school students, and I took it for a spin.

Here’s how you teach the young to code:

What is a program? A set of rules

“Most of us think of programs as something we write for a computer,” says one of the first instructional videos. Any child who’s played a game has experience following a program; any child who’s modified the rules of a game is already a computer programmer in the making.

Instead of writing out code, Code.org organizes commands in a set of shapes that “snap” together. The very first lesson tests if children can perform the digital equivalent of Lego blocks by piecing together pictures.

 

puzzle-assembly

With the puzzle mastered, the curriculum has children dive into a game for helping an Angry Bird move along the screen to destroy an evil pig. In the screenshot below, I’ve programmed four eastward steps in the first lesson. I run my code and watch the bird take out the pig (or fail and re-write the program).

gameprogram

Voila. Instant game.

Loops – Enter the Zuck

“One thing that computers are really good at is repeating commands,” says the tech giant, in his small guest lecture on loops for Code.org.

For the unfamiliar, loops are the general computer science term for “repeat.” In the game, instead of asking an Angry Bird to move forward three times, I include a new tool that allows me to repeat commands.

loop

As the maze between the bird and pig becomes more complicated, I have to nest loops to describe directions in the fewest steps possible. To instill the values of parsimony, Code.org cautions users if they use excessive commands.

Advanced lessons become progressively more complex, with older elementary school students taking on such concepts as variables and functions.

Others in the field

Code.org’s approach has a long history. Back in the early ’90s, when I was in middle school, I took an engineering class at a private tutoring company that taught me to build race cars from Lego parts and DOS commands.

In 2012, Sal Khan’s, Khan Academy, launched a similar game-focused computer science curriculum, with a heavy emphasis on art. Not to be outdone, the University of Southern California is piloting an entire school for at-risk kids, GameDesk, which teaches every school subject through game design.

Code.org aims to make a difference by pairing accessible games with national legislation. Their primary mission is to make computer programming a staple of the American education system.

Indeed, there’s a diversity problem in Silicon Valley, partly due to poor access to courses. Last year, there were entire states where no girls, blacks, or Hispanics took the AP computer science test.

Code.org has ambitious national goals. A spokesperson for the company tells me that they plan on augmenting their new Code Studio with on-the-ground teacher training camps throughout the country.

It’s fascinating to see how some of the world’s top technical minds break down the fundamentals of programming logic into their most basic form. Readers (and their kids) can check out the lessons here.