President Obama writes his first line of Javascript

 By 
Stan Schroeder
 on 
President Obama writes his first line of Javascript
President Barack Obama does a "fist bump" with a Adrianna Mitchell during an â Credit: AP Photo/Jacquelyn Martin

The U.S. now has a “coder-in-chief:” President Barack Obama has written his first line of code.

The president achieved the feat at an event for Hour of Code, a global effort to get kids involved in coding. The organization’s website, Code.org, claims it has reached tens of millions of students in more than 180 countries with the challenge, which is basically an hour-long tutorial about basic coding.

[seealso slug="obama-net-neutrality"]

The president wrote his code in Javascript, as well as Google’s “Blocky” programming language -- it made Elsa from Frozen move from one point to another.

Although the president’s coding was apparently correct, his explanation of code seemed a little convoluted.

“You take these zeroes and ones, you take two numbers — yes or no — those can be translated into electrical messages that run through the computer,” he said.

Thankfully, Code.org’s co-founder Hadi Partovi was helpful enough to explain it for him.

“You just give the computer commands and they’re much closer to English.”

President @BarackObama is learning an #HourOfCode! (He's writing a few lines of JavaScript right now) pic.twitter.com/vGTDb70i6s— Code.org (@codeorg) December 8, 2014

A former Microsoft employee, Partovi started the Hour of Code to spread awareness of computer science education and first attracted mainstream attention back in January with a video he produced starring a laundry list of celebrities.

The president’s coding efforts were part of the White House’s Computer Science Education Week.

The biggest stories of the day delivered to your inbox.
These newsletters may contain advertising, deals, or affiliate links. By clicking Subscribe, you confirm you are 16+ and agree to our Terms of Use and Privacy Policy.
Thanks for signing up. See you at your inbox!