According to a recent Wired article, US President Barack Obama was the first president to write code:
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
[...]
Partovi says the president himself didn’t complete the tutorial from start to finish, but instead went from station to station watching the students work. He did, however, complete some of the exercises, which involved both using Google’s Blockly tool, and writing a line of code using the programming language JavaScript.
I'm wondering whether that is truth or not.