Act Two / Chapter 28

How Did The Tech Titans Learn To Code?

Shows, through the stories of Musk, Zuckerberg, Gates, and many engineers Matt has worked with, that the path to coding mastery almost always began with games, and that play is therefore an underused educational lever.

Published July 2, 2026

Abstract cover image for How Did The Tech Titans Learn To Code?

PRINCIPLE: Intrinsic Motivation Through Play Drives Deep Learning

We can try to design the perfect education in theory. That’s how most education is designed. Or we can ask ourselves: how did the people who made it to the top of the mountain get there? How did Elon Musk learn to code? Mark Zuckerberg and Bill Gates and Larry Page? How did they all learn to code? I stumbled my way into the answer with our very own engineering team.

I was curious about how our engineers working on Endless OS had learned to code. It was part curiosity, part desire to understand how we could teach kids in emerging markets how to code, and, if I’m honest, partly a quiet wish that I had discovered that journey for myself. I had been so close with Hypercard, where I made little games and hacked secret traps for my friends. If only I had been able to slip a little further into the rabbit hole, I wonder how my life would have been. In retrospect I’m happy with where I ended up, but I wanted to know: how did they get there?

So I started asking them. The pattern emerged almost gradually. "I wanted to mod games." "I learned by hacking games." "I got into coding because I wanted to make games." Over and over again, I heard variations of the same story. These weren't just any engineers. They were some of the most talented systems programmers I'd ever met, working on complex operating system architecture. Yet nearly all of them traced their origin story back to games.

The answer surprised me. Almost every one of them told me the same story. Whether it was writing the code for a game from a magazine in BASIC, boosting their lives and weapons, tweaking character attributes in their favorite RPG, swapping the audio files to make the characters speak in their own squeaky voice, modifying maps in Warcraft, or diving into the code of simple Flash games, their first taste of coding came from the desire to bend games to their will. It wasn't formal education that had ignited their passion – it was play.

That realization would go on to shape everything we do at Endless Studios. But at that moment, sitting there listening to engineer after engineer tell their story, I couldn't help but smile at the elegance of it. The very thing that parents often worry will distract their kids from learning could actually be the key to unlocking their future. Indeed, for so many of today’s tech titans, it was.

Here I was, trying to solve one of education's greatest challenges: how do you teach coding to kids who live beyond the reach of great teachers? And these brilliant engineers were showing me, in story after story, that their greatest teacher hadn't been a person at all. It had been their own curiosity, sparked by games.

I thought back to the girls I met in a dusty village in India, their eyes lighting up as they explored our laptop. What if we could give them not just games to play, but games they could take apart, modify, and rebuild? What if the very thing that makes games so engaging, that irresistible urge to explore and master and build, could be channeled into learning the language of software?

The Hours
The average kid spends 20 hours a week playing video games. That is 1,000 hours per year. From the ages of 10 - 20, that is 10,000 hours spent playing video games. They say that it takes 10,000 hours to be a virtuoso at something and most kids are spending that much time playing video games. Most parents, rightfully, balk at that volume of time. Playing video games distracts them from living life! But what if you could harness some of that time to turn them into creators?

When parents say, “go play,” they want their kids to fly free. To run around the playground, playing games like basketball and football. I couldn’t agree more. We chose where we bought our home based on my own childhood of running around the woods building tree forts and having pinecone wars with my brothers. Our kids hardly touch screens, as 3 and 4 year olds.

But when they become teenagers, we parents have to ask ourselves: how do we prepare them to get a good job? So, what’s the answer? Again, let’s look at how others found their way there.

Here’s the answer for Elon Musk: Video games.

Elon Musk taught himself to program at age 10 when he got his first computer, a Commodore VIC-20. He learned by reading and studying the computer's manual. Why was he so engaged? In his words, “Part of the reason, maybe the reason, I got interested in tech was video games.” He had soon completed the six-month basic programming course that came with the computer. At age 12, he created his first commercial software - a space-themed video game called Blastar. He sold the source code for the game to the South African PC and Office Technology magazine for approximately $500. Speaking about this experience later, Musk said: “I probably wouldn’t have started programming if it wasn’t for video games or wouldn’t have been as interested in computers and tech if it wasn’t for video games. I think video games are a very powerful force for getting young kids interested in technology; it has way bigger knock-on effects than people may realize.” He later went on to work at a gaming startup, “which weirdly was called Rocket Science — fate loves irony.” Games got Elon's attention and kept his attention. In fact, Elon recently claimed that he is the 20th best Diablo IV player in the world. It still has his attention.

How does Elon Musk interview his engineers? “If we’re interviewing somebody for a software engineering role at Tesla or SpaceX, many times we’ll [ask], ‘How’d you start programming?” “I think many of the best software engineers in the world are at, or spent much of their career at, video game houses,” he says. “If people had to try to create incredibly realistic graphics using very little computer power, it’s a hard problem, so a lot of people had to write really tight code and come up with really clever ideas to do that.”

CNBC describes, “For Musk’s team at Tesla, the enhanced graphics in video games enable them to better simulate self-driving cars with the help of artificial intelligence. He tasks his simulation team with creating a photorealistic world of what he says are some of the most boring things: skid marks on the road, concrete curves, shadows, and faded street lines. These simulations have been essential to the development of autopilot cars, which are scheduled for a full rollout next year.”

What about Mark Zuckerberg? He was unequivocal: “I made a lot of games for myself, and they were terrible, but this was how I got into programming.” "I hear a lot that parents are concerned about their kids playing games, and there are valid concerns and I think that there's an important debate to be had around that," he continued. "But I do think that if you're a parent and you don't let your children use technology, but also want them... to be open to [a career in programming], then I actually think giving people the opportunity to play around with different stuff is one of the best things you can do... I definitely would not have gotten into programming if I hadn't played games as a kid."

"We as a society need to get to a point where everyone has the same opportunity and the same ability to be playing with technology and experimenting with different things, because that's how you eventually get into engineering," he said. "You learn and you mess around with things and design some things. Most of the engineers I know, who are the best engineers, are self-taught. It's not because they took some classes."

He also still plays. Zuckerberg recently boasted that he’s “close to grandmaster status” in Civilization and that it would surprise him if anyone in the world could beat him.

Microsoft did a study that showed that 4 out of 5 engineers learned to code when they were kids. So what was it that they were doing as kids that made them so engaged with coding?

Who thinks that it was that they were riveted by a coding course, or that they were so engaged by textbooks that they spent countless waking hours learning to code, or that they thought, “this is good for my career” and so they spent those hours coding?

For most of those 4 out of 5 engineers, it was simple: they liked games.

Elon Musk, Mark Zuckerberg, Bill Gates, Jeff Bezos, Larry Page. They all started with games.

Thank Games for AI
Demis Hassabis, renowned for co-founding DeepMind, recently won the Nobel Prize for his contributions to the foundational technology behind AI, specifically for developing AlphaFold, an AI system that revolutionizes protein structure prediction. His work is pivotal because AlphaFold addresses a long-standing challenge in biology—accurately predicting the three-dimensional structures of proteins from their amino acid sequences—which is essential for advancements in drug discovery and understanding diseases.

This breakthrough came from his prior breakthrough in AlphaGo, a seminal moment when AI first defeated a world champion in Go, a game with more possible board positions than atoms in the universe. What made this victory particularly profound was Move 37 in Game 2 against Lee Sedol—a move so unconventional that commentators initially thought it was a mistake. Professional players said no human would ever play it. Yet this seemingly bizarre move turned out to be brilliant, ultimately leading to AlphaGo's victory. It was a moment that showed AI could not only match human strategic thinking, but develop its own form of "intuition" that transcended 2,500 years of human Go wisdom. He showed, for the first time, that machines could master tasks requiring both intuition and strategic thinking, previously thought to be uniquely human.

DeepMind then developed AlphaZero, which mastered Go, chess, and shogi from scratch, followed by AlphaStar, which conquered the real-time complexity of the video game StarCraft II. Each step built upon the last, ultimately leading to AlphaFold's breakthrough in protein folding—a jump from games to one of biology's greatest challenges.

So, where did his passion for games (Go, chess, shogi, StarCraft II) and computer science come from? What was his story? He was a chess prodigy who became curious about how computers could play the game so well. “I think that started sparking off in my mind ideas about how does the chess computer play chess and learning about that.” He swung from a passion for chess to a passion for building games.

He joined the game studio Bullfrog Productions and at 18 years old he had his first runaway hit as the co-designer and lead programmer of the game Theme Park, a game where players run amusement parks. Theme Park hands you an empty plot of land in Britain and a chunk of startup cash. Your mission: build a profitable amusement park by carefully balancing your spending on rides, shops, and staff against revenue from tickets, food, and merchandise.

Theme Park wasn't just a game about building roller coasters—it was an intricate simulation of interconnected systems that mirrored real-world complexity. Every visitor who stepped off the bus into your park was a tiny AI agent with their own personality, preferences, and needs, all packed into a mere 200 bytes of memory. These virtual humans would respond to everything: they'd get happier if the ice cream had the right amount of sugar, frustrated if the bathrooms were too far away, scared if rides weren't maintained properly, and entertained by the roaming entertainers you hired. Your staff had their own behaviors too—mechanics would inspect rides, janitors would clean paths, and security guards would patrol for vandals. When visitors became unhappy, it would trigger a cascade of consequences: thugs might appear to vandalize the park, staff might strike over wages, and rides could break down catastrophically. Even the economy was a complex simulation—research funding would unlock new attractions, loans had to be managed, and stock prices would fluctuate based on park performance. Every element was connected to every other element in a delicate dance of cause and effect.

For Hassabis as lead programmer, building this intricate simulation required creating artificial intelligence systems that could handle thousands of interacting variables simultaneously. He had to code economic feedback loops, social dynamics, and emergent behaviors—where small changes in one area could ripple through the entire system in unexpected ways. In essence, he was building a miniature digital world where every line of code had to work in harmony with countless others. For a young programmer, it was essentially an apprenticeship in building intelligence systems: precisely the kind of experience that would later prove invaluable in his work on artificial intelligence.

EA published the game and it sold over 15 million copies. In 2004, GameSpot named Theme Park one of the greatest games of all time.

His journey from there was, well, “typical” for these outliers: It started with games and then “Hassabis went on to gain a double first in computer science at Cambridge University, launch his own video game company, complete a PhD in cognitive neuroscience and then co-found the artificial intelligence startup DeepMind, which Google bought for £400m in 2014.”

But his start was certainly typical: “many children start by playing games, like I did, and then getting into programming and then using this incredible tool, the computer, to create things.”

This theme rings so loudly.

Subscribe to updatesShare
UpvoteDownvote
Send us feedback

Loading feedback...

Loading next chapter

Bookmark this chapter