What It Was Like to Teach Obama to Code

How was President Obama convinced to do Hour of Code? originally appeared on Quora - the knowledge sharing network where compelling questions are answered by people with unique insights.

Answer by Hadi Partovi, CEO, Code.org, on Quora.

This is a great story. Code.org launched in 2013 with a video, and we had little more than a video, a great name, and a web site. I was a one-man team at the time, but with one million people having signed our petition, and 15,000 schools having reached out asking our help to bring coding and computer science to their school, I knew we could do a lot more. And people everywhere wanted to help - celebrities, companies, and politicians.

The White House reached out to me to ask if there was a way we could get some of the celebrities or tech companies who were part of our video to do something together with the White House around computer science. This was in 2013, May or June. I told them U.S. education is mostly driven by the states, if the Federal government can provide states funding for computer science that would be great. But what would really help would be if we could get the President to write even one line of code, to show symbolically, worldwide, that this is something any adult or child can participate in.

They loved the idea, but they wanted to know when or where it could happen, and there was a question of how could we get other celebrities or tech companies or influential people all involved to provide it context and follow-up and ongoing value.

A few days later, I thought - let's make a campaign, to get lots of people just trying one hour of coding, and have schools everywhere participate, during Computer Science Education Week, and then we can convince the President to participate too. That's how the idea for the Hour of Code came about! Five and a half months later, we launched the first Hour of Code campaign, in 2013, and we had convinced the President to issue a speech about computer science. But it was impossible to get the president to code that year - the administration had just launched its Healthcare..gov web site, which had had such well-publicized technical failures, and nobody wanted the visual of site failing while the President is learning to code.

So the Hour of Code was a huge success, but the President didn't himself try it, and I waited another year. In 2014, the White House was more engaged, but the folks we were working with couldn't confirm the President's support. We decided to take matters into our own hands. First, we announced publicly that "one lucky classroom" would be brought to Washington DC for a super-historic special Hour of Code, but that all the details were secret. Everybody assumed this meant doing something with the President, but we never said "President" or "White House", because we didn't have any of that confirmed. Next, I had the good luck to be invited to a function with the President, completely unrelated to Code..org, and I was part of a receiving line of people who got to shake hands with the president for 2 seconds. I turned my 2 seconds into 10 seconds, didn't let go of the President's hand, and personally asked him if he would write 1 line of code as part of the Hour of Code. This was in November 2014. He said "yes," and 3 weeks later, we had bussed in a lucky classroom from Newark and were in the White House, teaching the President to write his first line of JavaScript.

Bottom line - it took 1.5 years of hard work, not giving up, not taking no for an answer, asking in person, and inventing a worldwide education campaign along the way!

This question originally appeared on Quora. - the knowledge sharing network where compelling questions are answered by people with unique insights. You can follow Quora on Twitter, Facebook, and Google+. More questions:​

More questions:​