clock menu more-arrow no yes

Filed under:

Watch President Obama write his first line of code

New, 64 comments

If you buy something from a Verge link, Vox Media may earn a commission. See our ethics statement.

Pool/Getty Images

Dubbed "Coder in Chief," Barack Obama is being described as the first US president to dabble in computer programming. After kicking off the 2014 Computer Science Education Week with a call to code, Obama joined an "Hour of Code" event, an international campaign that aims to show how much an hour of programming can amount to.

Code.org co-founder Hadi Partovi told Wired that the president did not fully complete the tutorial, but did finish a number of exercises with the likes of Google's visual programming language Blocky. Partovi said that the president was exceptionally careful when he wrote a single line of Javascript — moveForward(100); — for a Code Studio tutorial featuring Frozen's Anna and Elsa. The code caused Elsa to move 100 pixels to finish drawing a square.

Partovi was quick to note that "no one starts by creating a complicated game." The special "Hour of Code" event was held at the White House, with 20 middle school students also in attendance. Obama has positioned himself as an advocate of code literacy. Last year, he released a speech on YouTube stressing the importance of having Americans master technology. "Don't just download the latest app, help design it," said the president. "Don't just play on your phone, program."