Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Former U.S. President Barack Obama's first line of code, the president code you understand?


Jun 02, 2021 Article blog



Obama was the first black president of the United States and the first president in human history to program and write code.

 Former U.S. President Barack Obama's first line of code, the president code you understand?1

He studied JavaScript at the White House and with several students at the White House. M any people wondered what his first line of code would look like. In fact, Obama's first line of code is JavaScript code: moveForward (100);

Obama is learning programming on the Code.org teaching website with the movie "Ice and Snow." His code calls the "move forward" function built into the game.

 Former U.S. President Barack Obama's first line of code, the president code you understand?2

Function calls in JavaScript are simple: write down the name of the function, followed by the brackets, which contain the function's arguments. T he first line of code Obama wrote was to tell the program to "let the Ice Queen move a distance forward." Because the distance on the screen is calculated in pixels, the argument is an integer.

Obama, the first president in U.S. history to program, has declared that everyone in the world should learn programming.

In American education, programming courses receive great attention. In American elementary and middle schools, more and more schools are advancing program design courses, making them fast becoming a compulsory part of schools, and American children are valued as creative people from an early age.

STEM education in the United States has a long history, dating back to the 1986 Report on Undergraduate Science, Mathematics, and Engineering Education published by the National Science Council.


It recommends the development of high-quality scientific and technological personnel, engineers, scientists, and mathematicians to enhance the competitiveness of the country.

 Former U.S. President Barack Obama's first line of code, the president code you understand?3

Of course, programming can also improve our thinking, as Jobs said, "I think everyone should learn a programming language." L earning programming teaches you how to think, just like learning law. S tudying law doesn't have to be a lawyer, but law teaches you a way to think. T he same is true of learning programming, which I see as a basic education, and everyone should spend a year learning programming.