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 Parvoti 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.
President Barack Obama told the world that everyone should learn how to code. And now he’s putting his money where his mouth is. Earlier today, to help kick-off the annual Computer Science Education Week, Obama became the first president ever to write a computer program. It was a very simple program—all it does is draw a square on a screen—but that’s the point, says Hadi Partovi, co-founder Code.org, an organization that promotes computer science education. “All programming starts simple,” he says. “No one starts by creating a complicated game.” Last year, Obama delivered a YouTube speech last year to promote Computer Science Education Week, but didn’t write any code himself. “Learning these skills isn’t just important for your future. It’s important for our country’s future,” the president said in the video. “If we want America to stay on the cutting edge, we need young Americans like you to master the tools and technology that will change the way we do just about everything.”
When we started to learn robotics, our first assignment was to teach the robot to draw a square.
It’s actually a good “hello world” exercise: