See all Lex Fridman transcripts on Youtube

youtube thumbnail

John Carmack: Doom, Quake, VR, AGI, Programming, Video Games, and Rockets | Lex Fridman Podcast #309

5 hours 14 minutes 50 seconds

🇬🇧 English

S1

Speaker 1

00:00

I remember the reaction where he had drawn these characters and he was slowly moving around and like people had no experience with 3D navigation. It was all still keyboard. We didn't even have mice set up at that time, but slowly moving, going up, picked up a key, go to a wall, the wall disappears in a little animation and there's a monster like right there and he practically fell out of his chair. It was just like, ah!

S1

Speaker 1

00:22

And games just didn't do that. You know, the games were the God's eye view. You were a little invested in your little guy. You can be like, you know, happy or sad when things happen, but you just did not get that kind of startle reaction.

S2

Speaker 2

00:34

You weren't inside the game.

S1

Speaker 1

00:36

Something in the back of your brain, some reptile brain thing is just going, oh shit, something just happened. And that was 1 of those early points where it's like, yeah, this is going to make a difference. This is going to be powerful and it's going to matter.

S2

Speaker 2

00:52

The following is a conversation with John Carmack, widely considered to be 1 of the greatest programmers ever. He was the co-founder of id Software and the lead programmer on several games that revolutionized the technology, the experience, and the role of gaming in our society, including Commander Keen, Wolfenstein 3D, Doom, and Quake. He spent many years as the CTO of Oculus VR, helping to create portals into virtual worlds and to define the technological path to the metaverse and meta.

S2

Speaker 2

01:28

And now he has been shifting some of his attention to the problem of artificial general intelligence. This was the longest conversation on this podcast at over 5 hours and still I could talk to John many many more times and we hope to do just that. This is the Lux Readment Podcast. To support it, please check out our sponsors in the description.

S2

Speaker 2

01:52

And now, dear friends, here's John Carmack. What was the first program you've ever written? Do you remember?

S1

Speaker 1

02:01

Yeah, I do. So, I remember being in a radio shack going up to the TRS-80 computers and learning just enough to be able to do 10 print John Carmack. And it's kind of interesting how, of course, Carnegan and Ritchie kind of standardized hello world as the first thing that you do in every computer programming language and every computer, but not having any interaction with the cultures of Unix or any other standardized things, it was just like, well, what am I gonna say?

S1

Speaker 1

02:29

I'm gonna say my name. And then you learn how to do go to 10 and have it scroll all off the screen. And that was definitely the first thing that I wound up doing on a computer.

S2

Speaker 2

02:39

Can I ask you a programming advice? I was always told in the beginning that you're not allowed to use go to statements. That's really bad programming.

S2

Speaker 2

02:45

Is this correct or not? Jumping around code. Can we look at the philosophy and the technical aspects of the go-to statement that seems so convenient, but it's supposed to be programming? Well, so certainly

S1

Speaker 1

02:56

back in the day in basic programming languages, you didn't have proper loops. You didn't have for, whiles, and repeats. You know, That was the land of Pascal for people that kind of generally had access to it back then.

S1

Speaker 1

03:07

So you had no choice but to use go-tos. And as you made what were big programs back then, which were a thousand-line basic program is a really big program, They did tend to sort of degenerate into madness. You didn't have good editors or code exploration tools, so you would wind up fixing things in 1 place, add a little patch, and there's reasons why structured programming generally helps understanding. But gotos aren't poisonous.

S1

Speaker 1

03:33

Sometimes they're the right thing to do. Usually it's because there's a language feature missing, like nested breaks or something, where it can sometimes be better to do a goto cleanup or goto error rather than having multiple flags, multiple if statements littered throughout things. But it is rare. If you grep through all of my code right now, I don't think any of my current codebases would actually have a go-to.

S1

Speaker 1

03:59

But deep within sort of the technical underpinnings of a major game engine, you're gonna have some go-to's in a couple places probably.

S2

Speaker 2

04:07

Yeah, the infrastructure on top of, like the closer you get to the machine code, the more go-to's you're gonna see, the more of these like hacks you're going to see, because the set of features available to you in low level programming languages is limited. So, print John Carmack, when is the first time, if we could talk about love, that you fell in love with programming. You said like, this is really something special.

S1

Speaker 1

04:34

It really was something that was 1 of those love at first sight things where just really from the time that I understood what a computer was, even, I mean, I remember looking through old encyclopedias at the black and white photos of the IBM mainframes at the reel-to-reel tape decks. And for people nowadays, it can be a little hard to understand what the world was like then from information gathering, where I would go to the libraries and there would be a couple books on the shelf about computers, and they would be very out of date even at that point, just not a lot of information. But I would grab everything that I could find and devour everything.

S1

Speaker 1

05:10

Whenever Time or Newsweek had some article about computers, I would cut it out with scissors and put it somewhere. It felt like this magical thing to me, this idea that the computer would just do exactly what you told it to. I mean, and there's a little bit of the genie monkey's paw sort of issues there where you'd better be really, really careful with what you're telling it to do. But it wasn't going to backtalk you.

S1

Speaker 1

05:32

It wasn't going to have a different point of view. It was going to carry out what you told it to do. And if you had the right commands, you could make it do these pretty magical things.

S2

Speaker 2

05:43

And so what kind of programs did you write at first? So beyond the print John Carmack.

S1

Speaker 1

05:48

So I can remember as going through the learning process where you find at the start you're just learning how to do the most basic possible things. And I can remember stuff like a Superman comic that Radio Shack commissioned to have, it's like Superman had lost some of his super brain and kids had to use Radio Shack TRS-80 computers to do calculations to help him kind of complete his heroics. And I'd find little things like that and then get a few basic books to be able to kind of work my way up.

S1

Speaker 1

06:20

And again, it was so precious back then. I had a couple books that would teach me important things about it. I had 1 book that I could start to learn a little bit of assembly language from, and I'd have a few books on BASIC and some things that I could get from the libraries. But my goals in the early days was almost always making games of various kinds.

S1

Speaker 1

06:41

I loved the arcade games and the early Atari 2600 games, And being able to do some of those things myself on the computers was very much what I aspired to. And it was a whole journey where if you learn normal basic, you can't do any kind of an action game. You can write an adventure game. You can write things where you say, what do you do here?

S1

Speaker 1

07:00

I get sword, attack troll, that type of thing. And that can be done in the context of basic I But to do things that had moving graphics there were only the most limited things you could possibly do you could maybe do breakout or Pong or that sort of thing in low resolution graphics And in fact 1 of my first sort of major technical hacks that I was kind of fond of was on the Apple II computers, they had a mode called low resolution graphics, where of course all graphics were low resolution back then. But regular low resolution graphics, it was a grid of 40 by 40 pixels normally, but they could have 16 different colors. And I wanted to make a game kind of like the arcade game Vanguard, just a scrolling game.

S1

Speaker 1

07:44

And I wanted to just kind of have it scroll vertically up. And I could move a little ship around. You could manage to do that in basic, but there's no way you could redraw the whole screen. And I remember at the time just coming up with what felt like a brainstorm to me where I knew enough about the way the hardware was controlled, where the text screen and the low-resolution graphics screen were basically the same thing.

S1

Speaker 1

08:07

And all those computers could scroll their text screen reasonably. You could do a listing and it would scroll things up. And I figured out that I could kind of tweak just a couple things that I barely understood to put it into a graphics mode, and I could draw graphics, and then I could just do a line feed at the very bottom of the screen, and then the system would scroll it all up using an assembly language routine that I didn't know how to write back then. So that was like this first great hack that sort of had analogs later on in my career for a lot of different things.

S1

Speaker 1

08:37

So I found out that I could draw a screen, I could do a line feed at the bottom, we would scroll it up once, I could draw a couple more lines of stuff at the bottom, and That was my first way to kind of scroll the screen, which was interesting in that that played a big part later on in the id software days as well.

S2

Speaker 2

08:53

So do efficient drawing where you don't have to draw the whole screen, but you draw from the bottom using the thing that was designed in the hardware for text output.

S1

Speaker 1

09:04

Yeah. Where so much of, until recently, game design was limited by what you could actually get the computer to do. Where it's easy to say, like, okay, I want to scroll the screen. You just redraw the entire screen at a slight offset.

S1

Speaker 1

09:19

And nowadays that works just fine. Computers are ludicrously fast. But up until a decade ago or so, there were all these things everybody wanted to do, But if they knew enough programming to be able to make it happen, it would happen too slow to be a good experience, either just ridiculously slow or just slow enough that it wasn't fun to experience it like that. So so much of kind of the first couple decades of the programming work that I did was largely figuring out how to do something that everybody knows how they want it to happen.

S1

Speaker 1

09:51

It just has to happen 2 to 10 times faster than sort of the straightforward way of doing things would make it happen. And it's different now Because at this point, lots of things you can just do in the most naive possible way and it still works out. You don't have nearly the creative limitations or the incentives for optimizing on that level. And there's a lot of pros and cons to that.

S1

Speaker 1

10:14

But I do Generally, I'm not going to do the angry old man shaking my fist at the clouds bit where back in my day programmers had to do real programming. It's amazing that you can just kind of pick an idea and go do it right now. And you don't have to be some assembly language wizard or deep GPU arcanist to be able to figure out how to make your wishes happen.

S2

Speaker 2

10:35

Well there's still, see that's true, but let me put on my old man with a fist hat and say that probably the thing that will define the future still requires you to operate at the limits of the current system. So we'll probably talk about this, but if you talk about building the metaverse and building a VR experience that's compelling, it probably requires you to not to go to assembly or maybe not literally, but sort of spiritually to go to the limits of what the system is capable

S1

Speaker 1

11:08

of. Yeah, and that really was why virtual reality was specifically interesting to me, where it had all the ties to, you could say that even back in the early days, I have some old magazine articles that's talking about Doom as a virtual reality experience back when just seeing anything in 3D. So you could say that we've been trying to build those virtual experiences from the very beginning. And in the modern era of virtual reality, especially on the mobile side of things.

S1

Speaker 1

11:34

When it's standalone, you're basically using a cell phone chip to be able to produce these very immersive experiences. It does require work. It's not at the level of what an old school console game programmer would have operated at, where you're looking at hardware registers and you're scheduling all the DMA accesses. But it is still definitely a different level than what a web developer or even a PC Steam game developer usually has to work at.

S1

Speaker 1

12:01

And again, it's great. There's opportunities for people that wanna operate at either end of that spectrum there and still provide a lot of value to the world.

S2

Speaker 2

12:09

Let me ask you sort of a big question about preference. What would you say is the best programming language? Your favorite, but also the best.

S2

Speaker 2

12:22

You've seen throughout your career, you're considered by many to be the greatest programmer ever. I mean, it's so difficult to place that label on anyone, but if you put it on anyone it's you. So let me ask you these kind of ridiculous questions of what's the best band of all time? But in your case, what's the best programming language?

S1

Speaker 1

12:41

Everything has all the caveats about it, but so what I use, so nowadays I do program a reasonable amount of Python for AI ML sorts of work. That's I'm not a native Python programmer. It's something I came to very late in my career.

S1

Speaker 1

12:56

I understand what it's good for.

S2

Speaker 2

12:58

But you don't dream in Python.

S1

Speaker 1

13:00

I do not. And it has some of those things where there's some amazing stats when you say if you just start, if you make a loop, you know, a triply nested loop and start doing operations in Python, you can be thousands to potentially a million times slower than a proper GPU tensor operation. And these are staggering numbers.

S1

Speaker 1

13:19

You can be as much slower as we've almost gotten faster in our pace of progress and all this other miraculous stuff.

S2

Speaker 2

13:26

So your intuition's about inefficiencies within the Python sort of-

S1

Speaker 1

13:30

It keeps hitting me upside the face where it's gotten to the point now I understand it's like, okay, you just can't do a loop if you care about performance in Python. You have to figure out how you can reformat this into some big vector operation or something that's going to be done completely within a C++ library. But the other hand is, it's amazingly convenient, and you just see stuff that people are able to cobble together by, you just import a few different things, and you can do stuff that nobody on earth could do 10 years ago, and you can do it in a little cookbook thing that you copy-pasted out of a website.

S1

Speaker 1

14:02

So that is really great. When I'm sitting down to do what I consider kind of serious programming, it's still in C++, and it's really kind of a C flavored C++ at that, where I'm not big into the modern template metaprogramming sorts of things. I see a lot of train wrecks coming from some of that over abstraction. I spent a few years really going kind of deep into the kind of historical Lisp work and Haskell and some of the functional programming sides of things.

S1

Speaker 1

14:35

And there is a lot of value there in the way you think about things. And I changed a lot of the way I write my C and C++ code based on what I learned about the value that comes out of not having this random mutable state that you kind of lose track of. Because something that many people don't really appreciate till they've been at it for a long time is that it's not the writing of the program initially, it's the whole lifespan of the program. And that's when it's not necessarily just how fast you wrote it or how fast it operates But it's how can it bend and adapt as situations change?

S1

Speaker 1

15:09

And then the thing that I've really been learning in my time at Meta with the oculus and VR work is It's also how well it hands off between a continuous kind of revolving door of programmers taking over maintenance and different things and how you get people up to speed in different areas and there's all these other different aspects of it.

S2

Speaker 2

15:27

So C++ is a good language for handover between engineers?

S1

Speaker 1

15:32

Probably not the best. And there's some really interesting aspects to this where in some cases, languages that are not, that are not generally thought well of for many reasons, like C is derided pretty broadly that yes, obviously all of these security flaws that happen with the memory and unsafeness and buffer overruns and the things that you've got there. But there is this underappreciated aspect to the language is so simple, anyone can go and, you know, If you know C, you can generally jump in someplace and not have to learn what paradigms they're using because there just aren't that many available.

S1

Speaker 1

16:08

I think there's some really, really well-written C code. I find it great that if I'm messing around with something in OpenBSD, say. I mean, I can be walking around in the kernel and I'm like, I understand everything that's going on here. It's not hard for me to figure out what I need to do to make whatever change that I need to.

S1

Speaker 1

16:30

While you can have more significant languages, it's a downside of Lisp where I don't regret the time that I spent with Lisp. I think that it did help my thinking about programming in some ways. But the people that are the biggest defenders of Lisp are saying how malleable of a language it is, that if you write a huge Lisp program, you've basically invented your own kind of language and structure because it's not the primitives of the language you're using very much. It's all of the things you've built on top of that.

S1

Speaker 1

16:59

And then a language like Racket, kind of 1 of the more modern Lisp versions, it's essentially touted as a language for building other languages. And I understand the value of that for a tiny little project, but the idea of that for 1 of these long-term supported by lots of people kind of horrifies me, where all of those abstractions that you're like, okay, you can't touch this code until you educate yourself on all of these things that we've built on top of that. And it was interesting to see how when Google made Go, a lot of the criticisms of that are it's like, wow, this is not a state of the art language. This language is just so simple and almost crude.

S1

Speaker 1

17:38

And you could see the programming language people just looking down at it. But it does seem to be quite popular as basically saying this is the good things about C. Everybody can just jump right in and use it. You don't need to restructure your brain to write good code in it.

S1

Speaker 1

17:53

So, I wish that I had more opportunity for doing some work in Go. Rust is the other modern language that everybody talks about that I'm not fit to pass judgment on. I've done a little bit beyond Hello World. I wrote some video decompression work in Rust just as an exercise, but that was a few years ago and I haven't really used it since.

S1

Speaker 1

18:15

The best programming language is the 1 that works generally that you're currently using. Because that's another trap is in almost every case I've seen when people mixed languages on a project, that's a mistake. I would rather stay just in 1 language so that everybody can work across the entire thing. And we have, like at Meta, we have a lot of projects that use kind of React frameworks.

S1

Speaker 1

18:36

So you've got JavaScript here, and then you have C++ for real work, and then you may have Java interfacing with some other part of the Android system. And those are all kind of horrible things. And that was 1 thing that I remember talking with Boz at Facebook about it, where like, man, I wish we could have just said, we're only hiring C++ programmers. And he just thought from the Facebook meta perspective, well, we just wouldn't be able to find enough.

S1

Speaker 1

19:05

With the thousands of programmers they've got there, it is not necessarily a dying breed, but you can sure find a lot more Java or JavaScript programmers. And I kind of mentioned that to Elon 1 time, and he was kind of flabbergasted about that. It's like, well, you just, you go out and you find those programmers and you don't hire the other programmers that don't do the languages that you want to use. But right now, I guess, yeah, they're using JavaScript on a bunch of the SpaceX work for the UI side of things.

S1

Speaker 1

19:33

When you go find UI programmers, they're JavaScript programmers.

S2

Speaker 2

19:36

I wonder if that's because there's a lot of JavaScript programmers, because I do think that great programmers are rare. That it's not, you know, if you just look at statistics of how many people are using different programming languages that doesn't tell you the story of what the great programmers are using. And so you have to really look at what you were speaking to, which is the fundamentals of a language.

S2

Speaker 2

20:00

What does it encourage, how does it encourage you to think, what kind of systems does it encourage you to build? There is something about C++ that has elements of creativity but forces you to be an adult about your programming.

S1

Speaker 1

20:14

It expects you to be an adult. It

S2

Speaker 2

20:16

expects you to-

S1

Speaker 1

20:17

It does not force you to.

S2

Speaker 2

20:18

And so it brings out people that are willing to be creative in terms of building large systems and coming up with interesting solutions, but at the same time have the, sort of the good software engineering practices that amend themselves to real world systems. Let me ask you about this other language, JavaScript. So if we, you know, aliens visit in thousands of years and humans are long gone, something tells me that most of the systems they find will be running JavaScript.

S2

Speaker 2

20:54

I kind of think that if we're living in a simulation, it's written in JavaScript. For the longest time, even still, JavaScript didn't get any respect, and yet it runs so much of the world and an increasing number of the world. Is it possible that all, everything will be written in JavaScript 1 day?

S1

Speaker 1

21:16

So the engineering under JavaScript is really pretty phenomenal. The systems that make JavaScript run as fast as it does right now are kind of miracles of modern engineering in many ways. It does feel like it is not an optimal language for all the things that it's being used for, or an optimal distribution system to build huge apps in something like this without type systems and so on.

S1

Speaker 1

21:45

But I think for a lot of people, it does reasonably the necessary things. It's still a C-flavored language. It's still a braces and semicolons language. It's not hard for people to be trained in JavaScript and then understand the roots of where it came from, I think.

S1

Speaker 1

22:03

Garbage collection is unequivocally a good thing for most programs to be written in. It's funny that I still, just this morning I was on, I was seeing a Twitter thread of a bunch of really senior game dev people arguing about the virtues and costs of garbage collection. You will run into some people that are top-notch programmers that just say, no, this is literally not a good thing.

S2

Speaker 2

22:24

Oh, because it makes you lazy?

S1

Speaker 1

22:25

Yes, that it makes you not think about things. And I do disagree. I think that there is so much objective data on the vulnerabilities that have happened in C and C++ programs, sometimes written by the best programmers in the world.

S1

Speaker 1

22:40

It's like nobody is good enough to avoid ever shooting themselves in the foot with that. You write enough C code, you're going to shoot yourself in the foot. And garbage collection is a very great thing for the vast majority of programs. It's only when you get into the tightest of real-time things that you start saying it's like, no, the garbage collection has more costs than it has benefits for me there.

S1

Speaker 1

23:00

But that's not 99 plus percent of all the software in the world. So JavaScript is not terrible in those ways. And so much of programming is not the language itself. It's the infrastructure around everyone that surrounds it.

S1

Speaker 1

23:17

All the libraries that you can get and the different stuff that you can, ways you can deploy it, the portability that it gives you. And JavaScript is really strong on a lot of those things where for a long time, and it still does if I look at it, the web stack about everything that has to go when you do something really trivial in JavaScript and it shows up on a web browser to kind of x-ray through that and see everything that has to happen for your 1 little JavaScript statement to turn into something visible in your web browser, it's very, very disquieting, just the depth of that stack and the fact that so few people can even comprehend all of the levels that are going on there. But it's, again, I have to caution myself to not be the in the good old days old man about it because clearly there's enormous value here. The world does run on JavaScript to a pretty good approximation there, and it's not falling apart.

S1

Speaker 1

24:16

There's a bunch of scary stuff where you look at console logs and you just see all of these bad things that are happening, but it's still kind of limping along and nobody really notices. But so much of my systems design and systems analysis goes around, you should understand what the speed of light is, like what would be the best you could possibly do here. And it sounds horrible, but in a lot of cases, you can be a thousand times off your speed of light velocity for something and it still be okay. And in fact, it can even sometimes still be the optimal thing in a larger system standpoint where there's a lot of things that you don't want to have to parachute in someone like me to go in and say, make this webpage run a thousand times faster.

S1

Speaker 1

25:01

Make this web app into a hardcore native application that starts up in 37 milliseconds and everything responds in less than 1 frame latency. That's just not necessary. And if somebody wants to go pay me millions of dollars to do software like that, when they can take somebody right out of a boot camp and say, spin up an application for this. Often being efficient is not really the best metric.

S1

Speaker 1

25:26

It's like that applies in a lot of areas where It's kind of interesting how a lot of our appliances and everything are all built around energy efficiency, sometimes at the expense of robustness in some other ways or higher costs in other ways, where there's interesting things where energy or electricity could become much cheaper in a future world, and that could change our engineering trade-offs for the way we build certain things where you could throw away efficiency and actually get more benefits that actually matter. I mean, that's 1 of my – 1 of the directions I was considering swerving into was nuclear energy When I was kind of like, what do I want to do next? It was either going to be cost-effective nuclear fission or artificial general intelligence. And 1 of my pet ideas there is like, you know, people don't understand how cheap nuclear fuel is.

S1

Speaker 1

26:18

And there would be ways that you could be a quarter the efficiency or less, but if it wound up making your plant 10 times cheaper, that could be a radical innovation in something like that. So there's like some of these thoughts around like direct fission energy conversion, fission fragment conversion that, you know, maybe you build something that doesn't require all the steam turbines and everything, even if it winds up being less efficient. So that applies a lot in programming where there's always, it's always good to know what you could do if you really sat down and took it far. Because sometimes there's discontinuities.

S1

Speaker 1

26:54

Around user reaction times, there are some points where the difference between operating in 1 second and 750 milliseconds, not that huge. You'll see it in web page statistics, but most of the usability stuff, not that great. But if you get down to 50 milliseconds, then all of a sudden this just feels amazing. It's just like doing your bidding instantly rather than you're giving it a command, twiddling your thumbs, waiting for it to respond.

S1

Speaker 1

27:19

So sometimes it's important to really crunch hard to get over some threshold, but there are broad basins in the value metric for lots of work where it just doesn't pay to even go that extra mile. And there are craftsmen that just don't want to buy that. And more power to them. If somebody just wants to say, no, I'm going to be, my pride is in my work.

S1

Speaker 1

27:42

I'm never going to do something that's not as good as I could possibly make it. I respect that. And sometimes I am that person. But I try to focus more on the larger value picture.

S1

Speaker 1

27:53

And you do pick your battles and you deploy your resources into play that's going to give you sort of the best user value in the end.

S2

Speaker 2

28:00

Well, if you look at the evolution of life on Earth as a kind of programming effort, it seems like efficiency isn't the thing that's being optimized for. Like natural selection is very inefficient, but it kind of adapts and through the process of adaptations, building more and more complex systems that are more and more intelligent, the final result is kind of pretty interesting. And so I think of JavaScript the same way.

S2

Speaker 2

28:30

It's like this giant mess that, you know, things naturally die off if they don't work. And if they're become useful to people, they kind of naturally live. And then you build this community, large community of people that are generating code and some code is sticky, some is not, and nobody knows the inefficiencies or the efficiencies or the breaking points, like how reliable this code is. And you kind of just run it, assume it works, and then get unpleasantly surprised.

S2

Speaker 2

29:00

And then that's very kind of the evolutionary process.

S1

Speaker 1

29:03

So that's a really good analogy. And we can go a lot of places with that, where in the earliest days of programming, when you had finite, you could count the bytes that you had to work on this. You had all the kind of hackers playing code golf to be 1 less instruction than the other person's multiply routine to kind of get through.

S1

Speaker 1

29:20

And it was so perfectly crafted. It was a crystal piece of artwork when you had a program because there just were not that many – you couldn't afford to be lazy in different ways. And in many ways, I see that as akin to the symbolic AI work, where again, if you did not have the resources to just say, well, we're going to do billions and billions of programmable weights here, you have to turn it down into something that is symbolic and crafted like that. But that's definitely not the way DNA and life and biological evolution and things work.

S1

Speaker 1

29:54

On the 1 hand, it's almost humbling how little programming code is in our bodies. We've got a couple billion base pairs, and it's like this all fits on a thumb drive for years now. And then our brains are even a smaller section of that. You've got maybe 50 megabytes.

S1

Speaker 1

30:10

And this is not like Shannon limit, perfectly information dense conveyances here. It's like these are messy codes. They're broken up into amino acids. A lot of them don't do important things or they do things in very awkward ways.

S1

Speaker 1

30:26

But it is this process of just accumulation on top of things. And you need scale. Both you need scale for the population for that to work out. In the early days, in the 50s and 60s, the ancient era of computers where you could count when they said like when the internet started even in the 70s, there were like 18 hosts or something on it.

S1

Speaker 1

30:48

It was this small finite number and you were still optimizing everything to be as good as you possibly could be. But now it's billions and billions of devices and everything going on. And you can have this very much natural evolution going on where lots of things are tried, lots of things are blowing up, venture capitalists lose their money when a startup invested in the wrong tech stack and things completely failed or failed to scale. But good things do come out of it.

S1

Speaker 1

31:17

And it's interesting to see the mimetic evolution of the way different things happen. Like mentioning Hello World at the beginning. It's funny how some little thing like that where everybody, every programmer knows Hello World now. And that was a completely arbitrary sort of decision that just came out of the dominance of Unix and C and early examples of things like that.

S1

Speaker 1

31:38

So millions of experiments are going on all the time, but some things do kind of rise to the top and win the fitness war for whether it's mind space or programming techniques or anything.

S2

Speaker 2

31:50

Like there's a site on Stack Exchange called Code Golf where people compete to write the shortest possible program for a particular task in all the different kinds of languages. And it's really interesting to see folks kind of, their masters of their craft really play with the limits of programming languages. It's really beautiful to see.

S2

Speaker 2

32:14

And across all the different programming languages, You get to see some of these weird programming languages and mainstream ones, difference between Python 2 and 3. You get to see the difference between C and C++ and Java. You get to see JavaScript, all of that. And it's kind of inspiring to see how much depth of possibility there is within programming languages that code golf kind of tasks reveal.

S2

Speaker 2

32:44

Most of us, If you do any kind of programming, you kind of do boring kind of very vanilla type of code. That's the way to build large systems. But it's nice to see that the possibility of creative genius is still within those languages. It's laden within those languages.

S2

Speaker 2

33:00

So given that you are once again, 1 of the greatest programmers ever, what do you think makes a good programmer? Maybe a good modern programmer.

S1

Speaker 1

33:10

So I just gave a long rant slash lecture at Meta to the TPM organization, and my biggest point was everything that we're doing really should flow from user value. All the good things that we're doing. It's like we're not technical people.

S1

Speaker 1

33:28

It's like you shouldn't be taking pride just in the specific thing. Like code golf is the sort of thing, it's a fun puzzle game, but that really should not be a major motivator for you.

S2

Speaker 2

33:38

It's

S1

Speaker 1

33:38

like we're solving problems for people or we're providing entertainment to people. We're doing something of value to people that's displacing something else in their life. So we want to be providing a net value over what they could be doing, but instead they're choosing to use our products.

S1

Speaker 1

33:53

And that's where, I mean, it sounds trite or corny, but I fundamentally do think that's how you make the world a better place. If you have given more value to people than it took you and your team to create, then the world's a better place. People have gone from something of lesser value, chosen to use your product, and their life feels better for that. If you've produced that economically, that's a really good thing.

S1

Speaker 1

34:19

On the other hand, if you spent ridiculous amounts of money, you've just kind of shoveled a lot of cash into a wood chipper there, and you should maybe not feel so good about what you're doing. So being proud about a specific architecture or a specific technology or a specific code sequence that you've done, it's great to get a little smile, like a tiny little dopamine hit for that, but the top level metric should be that you're building things of value. Now, you can get into the argument about how you, you know, what is user value, how do you actually quantify that. And there can be big arguments about that, but it's easy to be able to say, okay, this pissed off user there is not getting value from what you're doing.

S1

Speaker 1

34:58

This user over there with the big smile on their face, I am The moment of delight when something happened, there's a value that's happened there. You have to at least accept that there is a concept of user value. Even if you have trouble exactly quantifying it, you can usually make relative arguments about it. Well, this was better than this.

S1

Speaker 1

35:17

We've improved things. So being a servant to the user is your job when you're a developer. You want to be producing something that other people are going to find valuable. And if you are technically inclined, then finding the right levers to be able to pull, to be able to make a design that's going to produce the most value for the least amount of effort.

S1

Speaker 1

35:41

And it always has to be kind of divided. There's a ratio there where you – it's a problem at the big tech companies, whether it's MetaGoogle, Apple, Microsoft, Amazon, companies that have almost infinite money. I mean, I know their CFO will complain that it's not infinite money, but from most developers' standpoints, it really does feel like it. And it's almost counterintuitive that if you're working hard as a developer on something, there's always this thought, if only I had more resources, more people, more RAM, more megahertz, then my product will be better.

S1

Speaker 1

36:16

And that sense that at certain points, it's certainly true that if you are really hamstrung by this, removing an obstacle will make a better product, make more value. But if you're not making your core design decisions in this fiercely competitive way where you're saying, feature A or feature B, you can't just say, let's do both. Because then you're not making a value judgment about them. You're just saying, well, they both seem good.

S1

Speaker 1

36:42

I don't want to necessarily have to pick out which 1 is better or how much better and tell team B that sorry we're not going to do this because A is more important. But that notion of always having to really critically value what you're doing, your time, the resources you expend, even the opportunity cost of doing something else. That's super important.

S2

Speaker 2

37:04

Well, let me ask you about this, the big debates that you're mentioning of how to measure value. Is it possible to measure it kind of numerically, or can you do the sort of Johnny Ive, the designer route of imagining sort of somebody using a thing and imagining a smile on their face, imagining the experience of love and joy that you have when you use the thing. That's from a design perspective, or if you're building more like a lower level thing for like Linux, you imagine a developer that might come across this and use it and become happy and better off because of it.

S2

Speaker 2

37:50

So where do you land on those things? Is it measurable? So I imagine like Meta and Google will probably try to measure the thing. They'll try to, it's like you try to optimize engagement or something, let's measure engagement.

S2

Speaker 2

38:03

And then I think there is a kind of, I mean, I admire the designer ethic of like, think of a future that's immeasurable, and you try to make somebody in that future that's different from today happy.

S1

Speaker 1

38:17

So I do usually favor, if you can get any kind of a metric that's good, by all means, listen to the data. But you can go too far there where we've had problems where it's like, hey, we had a performance regression because our fancy new telemetry system is doing a bazillion file writes to kind of archive this stuff because we needed to collect information to determine if we were doing, you know, if our plans were good. So when information is available, you should never ignore it.

S1

Speaker 1

38:46

I mean, all of

S2

Speaker 2

38:47

it- For actual users using the thing, human beings using the thing, large number of human beings, and you get to see sort of at-

S1

Speaker 1

38:54

So there's the 0 to 1 problem of when you're doing something really new, you do kind of have to make a guess. But 1 of the points that I've been making at Meta is we have more than enough users now that anything somebody wants to try in VR, we have users that will be interested in that. You do not get to make a completely green field, blue sky pitch and say, I'm going to do this because I think it might be interesting.

S1

Speaker 1

39:18

I challenge everyone. There are going to be people, whether it's working in VR on your desktop replacement or communicating with people in different ways or playing the games, there are going to be probably millions of people, or at least if you pick some tiny niche that we're not in right now, there's still going to be thousands of people out there that have the headsets that would be your target market. I tell people, Pay attention to them. Don't invent fictional users.

S1

Speaker 1

39:47

Don't make an Alice, Bob, Charlie that fits whatever matrix of tendencies that you want to break the market down to because it's a mistake to think about imaginary users when you've got real users that you could be working with. But on the other hand, there is value to having a kind of wholeness of vision for a product. Companies like Meta have – they understand the tradeoffs where you can have a company like SpaceX or Apple in the Steve Jobs era, where you have a very powerful leading personality that I, you know, that can micromanage at a very low level and can say it's like, no, that handle needs to be different or that icon needs to change the tint there. And they clearly get a lot of value out of it.

S1

Speaker 1

40:34

They also burn through a lot of employees that have horror stories to tell about working there afterwards. My position is that you're at your best when you've got a leader that is at their limit of what they can kind of comprehend of everything below them and they can have an informed opinion about everything that's going on. And you take somebody, you've got to believe that somebody that has 30, 40 years of experience, you would hope that they've got wisdom that the just out of boot camp person contributing doesn't have and that if they're like, well, that's wrong there, you probably shouldn't do it that way or even just don't do it that way, do it another way. So there's value there, but it can't go beyond a certain level.

S1

Speaker 1

41:18

I have Steve Jobs stories of him saying things that are just wrong right in front of me about technical things because he was not operating at that level. But when it does work and you do get that kind of passionate leader that's thinking about the entire product and just really deeply cares about not letting anything slip through the cracks. I think that's got a lot of value. But the other side of that is the people saying that, well, we want to have these independent teams that are bubbling up the ideas because, like, it's almost anti-capitalist or anti-free market to say it's like I want my great leader to go ahead and dictate all these points there where clearly free markets bring up things that you don't expect.

S1

Speaker 1

41:59

In VR, we saw a bunch of things. It didn't turn out at all the way the early people thought were going to be the key applications and things that would not have been approved by the dark cabal making the decisions about what gets into the store turned out to in some cases be extremely successful. So yeah, I definitely kind of wanted to be there was a point where I did make a pitch. It's like, hey, make me VR dictator and I'll go in and get shit done.

S1

Speaker 1

42:25

I am. And that's just it's not in the culture at Meta, you know, and they they understand the trade offs. They I and that's just not the way that's not the company that they want the team that they that they want to do.

S2

Speaker 2

42:37

It's fascinating because VR, and we'll talk about it more, it's still unclear to me in what way VR will change the world. Because it does seem clear that VR will somehow fundamentally transform this world, and it's unclear to me how. Yeah.

S2

Speaker 2

42:54

And it's- Let

S1

Speaker 1

42:54

me know when you wanna get into that.

S2

Speaker 2

42:57

Well, hold on a second. So, stick to the you being the best programmer ever. Okay, in the early days when you didn't have adult responsibilities of leading teams and all that kind of stuff, and you can focus on just being a programmer, what did a productive day in the life of John Carmack look like?

S2

Speaker 2

43:17

How many hours of the keyboard, how much sleep, what was the source of calories that fueled the brain? What was it like? What times you wake up?

S1

Speaker 1

43:26

So I was able to be remarkably consistent about what was good working conditions for me for a very long time. I was never 1 of the programmers that would do all-nighters going through work for 20 hours straight. It's like my brain generally starts turning to mush after 12 hours or so.

S1

Speaker 1

43:47

But the hard work is really important and I would work for decades. I would work 60 hours a week. I would work a 10-hour day 6 days a week and try to be productive at that. Now my schedule shifted around a fair amount when I was young without any kids and any other responsibilities.

S1

Speaker 1

44:04

I was on 1 of those cycling schedules where I'd kind of get in an hour later each day and roll around through the entire time and I'd wind up kind of pulling in at 2 or 3 in the afternoon sometimes and then working again past midnight or 2 in the morning. And that was, when it was just me trying to make things happen, and I was usually isolated off in my office, people generally didn't bother me much at it, and I could get a lot of programming work done that way. I did settle into a more normal schedule when I was taking kids to school and things like that.

S2

Speaker 2

44:40

So kids were the forcing function that got you to wake up at the same time.

S1

Speaker 1

44:44

It's not clear to me that there was a much of a difference in the productivity with that where I kind of feel, if I just get up when I feel like it, it's usually a little later each day. But I just recently made the focusing decision to try to push my schedule back a little bit earlier to getting up at 8 in the morning and trying to shift things around. I'm often doing experiments with myself about what should I be doing to be more productive.

S1

Speaker 1

45:11

1 of the things that I did realize was happening in recent months where I would go for a walk or a run. I cover like 4 miles a day and I would usually do that just as the sun's going down at here in Texas now and it's still really damn hot but I'd go out at 8.30 or something and cover the time there and then the showering. And it was putting a hole in my day where I would have still a couple hours after that. And sometimes my best hours were at night when nobody else is around, nobody's bothering me.

S1

Speaker 1

45:41

But that hole in the day was a problem. So just a couple of weeks ago, I made the change to go ahead and say, all right, I'm going to get up a little earlier. I'm going to do a walk or get out there first so I can have more uninterrupted time. So I'm still playing with factors like this as I kind of optimize my work efforts.

S1

Speaker 1

45:59

But it's always been – it was 60 hours a week for a very long time. To some degree, I had a little thing in the back of my head where I was almost jealous of some of the programmers that would do these marathon sessions. And I had like Dave Taylor, 1 of the guys that he had, he would be 1 of those people that would fall asleep under his desk sometimes and all the kind of classic hacker tropes about things. And a part of me was like always a little bothered that that wasn't me, that I wouldn't go program 20 hours straight because I'm falling apart and not being very effective after 12 hours.

S1

Speaker 1

46:31

I mean, yeah, 12-hour programming, that's fine when you're doing that, but you're not doing smart work much after. At least I'm not, but there's a range of people. I mean, that's something that a lot of people don't really get in their gut, where there are people that work on 4 hours of sleep and are smart and can continue to do good work, but then there's a lot of people that just fall apart. So I do tell people that I always try to get 8 hours of sleep.

S1

Speaker 1

46:56

It's not this, you know, push yourself harder, get up earlier. I just do worse work where, you know, there's, you can work a hundred hours a week and still get 8 hours of sleep if you just kind of prioritize things correctly. But I do believe in working hard, working a lot. There was a comment that a game dev made that, that I know there's a backlash against really hard work in a lot of cases and I get into online arguments about this all the time.

S1

Speaker 1

47:23

But he was basically saying, yeah, 40 hours a week, that's kind of a part-time job. And if you are really in it, you're doing what you think is important, what you're passionate about. Working more gets more done. And it's just really not possible to argue with that if you've been around the people that work with that level of intensity and just say, it's like, no, they should just stop.

S1

Speaker 1

47:46

And we had – I kind of came back around to that a couple years ago where I was using the fictional example of, all right, some people say, they'll say with a straight face, they think, no, you are less productive if you work more than 40 hours a week. And they're generally misinterpreting things where your marginal productivity for an hour after 8 hours is less than in 1 of your peak hours, but you're not literally getting less done. There is a point where you start breaking things and getting worse behavior and everything out of it, where you're literally going backwards, but it's not at 8 or 10 or 12 hours. And the fictional example I would use was, imagine there's an asteroid coming to impact, you know, to crash into Earth, destroy all of human life.

S1

Speaker 1

48:30

Do you want Elon Musk or the people working at SpaceX that are building the interceptor that's going to deflect the asteroid, do you want them to clock out at 5 because, damn it, they're just going to go do worse work if they work another couple hours? And it seems absurd. And that's a hypothetical, though, and everyone can dismiss that. But then when coronavirus was hitting and you have all of these medical personnel that are clearly pushing themselves really, really hard, and I'd say it's like, OK, Do you want all of these scientists working on treatments and vaccines and caring for all of these people?

S1

Speaker 1

49:05

Are they really screwing everything up by working more than 8 hours a day? And of course people say I'm just an asshole to say something like that, but it's, I know, it's the truth. Working longer gets more done.

S2

Speaker 2

49:17

Well, so that's kind of the layer 1, but I'd like to also say that, at least I believe, depending on the person, depending on the task, working more and harder will make you better for the next week in those peak hours. So there's something about a deep dedication to a thing that kind of gets deep in you. So the hard work isn't just about the raw hours of productivity, it's the thing it does to you in the weeks and months after too.

S1

Speaker 1

49:56

You're tempering yourself in some ways.

S2

Speaker 2

49:58

And I think, you know, it's like your 0 dreams of sushi. If you really dedicate yourself completely to making the sushi, to really putting in the long hours, day after day after day, you become a true craftsman of the thing you're doing. Now there's of course discussions about are you sacrificing a lot of personal relationships, are you sacrificing a lot of personal relationships?

S2

Speaker 2

50:18

Are you sacrificing a lot of other possible things you could do with that time? But if you're talking about purely being a master or a craftsman of your art, that more hours isn't just about doing more. It's about becoming better at the thing you're doing.

S1

Speaker 1

50:36

Yeah, and I don't gainsay anybody that wants to work the minimum amount. They've got other priorities in their life. My only argument that I'm making, it's not that everybody should work hard.

S1

Speaker 1

50:46

It's that if you want to accomplish something, working longer and harder is the path to getting it accomplished.

S2

Speaker 2

50:53

Well, let me ask you about this then, the mythical work-life balance. For an engineer, it seems like that's 1 of the professions for a programmer where working hard does lead to greater productivity in it. But it also raises the question of sort of personal relationships and all that kind of stuff, family.

S2

Speaker 2

51:21

And how were you able to find work-life balance? Is there advice you can give, maybe even outside of yourself? Have you been able to arrive at any wisdom on this part in your years of life?

S1

Speaker 1

51:32

I do think that there's a wide range of people where different people have different needs. It's not a 1 size fits all. I am certainly what works for me.

S1

Speaker 1

51:40

I can tell enough that I'm different than a typical average person in the way things impact me, the things that I want to do, my goals are different, and sort of the levers to impact things are different. Where I have literally never felt burnout, and I know There's lots of brilliant smart people that do world-leading work that get burned out. And it's never hit me. I've never been at a point where I'm like, I just don't care about this.

S1

Speaker 1

52:12

I don't want to do this anymore. But I've always had the flexibility to work on lots of interesting things. You know, I can always just turn my gaze to something else and have a great time working on that. And so much of that, so much of the ability to actually work hard is the ability to have multiple things to choose from and to use your time on the most appropriate thing.

S1

Speaker 1

52:33

Like there are time periods where I am, it's the best time for me to read a new research paper that I need to really be thinking hard about it. Then there's a time that maybe I should just scan and organize my old notes because I'm just not on top of things. And then there's the time that, all right, let's go, you know, bang out a few hundred lines of code for something. So switching between them has been real valuable.

S2

Speaker 2

52:56

So you always have kind of joy in your heart for all the things you're doing. And that, that is a kind of work life balance as a first sort of step. Yeah, I do.

S2

Speaker 2

53:04

So you're always happy.

S1

Speaker 1

53:06

I do. Well, happy, you know. Yeah, I mean, that's like, a lot of people would say that often I look like kind of a grim person, you know, with just sitting there with a neutral expression or even like knitted brows and a frown on my face as I'm staring at something.

S2

Speaker 2

53:18

That's what happiness looks like for you.

S1

Speaker 1

53:21

Yeah. It's kind of true where that's like, okay, I'm pushing through this. I'm making progress here. I know that doesn't work for everyone.

S1

Speaker 1

53:30

I know it doesn't work for most people, but what I am always trying to do in those cases is I don't want to let somebody that might be a person like that be told by someone else that no, don't even try that out as an option where I – work-life balance versus kind of your life's work, where there's a small subset of the people that can be very happy being obsessive about things. And obsession can often get things done that just practical, prudent, pedestrian work won't, or at least won't for a very long time.

S2

Speaker 2

54:05

There's legends of your nutritional intake in the early days. What can you say about, sort of, as a, you know, being a programmer is a kind of athlete. So what was the nutrition that fueled it?

S1

Speaker 1

54:21

I have never been that great on really paying attention to it where I'm good enough that I don't eat a lot. You know, I've never been like a big heavy guy, but it was interesting where 1 of the things that I can remember being an unhappy teenager, not having enough money. And like 1 of the things that bothered me about not having enough money is I couldn't buy pizza whenever I wanted to.

S1

Speaker 1

54:43

So I got rich and then I bought a whole lot of pizza.

S2

Speaker 2

54:46

It was really- So that was the defining, like that's what being rich felt like. There was a

S1

Speaker 1

54:50

lot of

S2

Speaker 2

54:50

little things.

S1

Speaker 1

54:50

Like I could buy all the pizza and comic books and video games that I wanted to. And it really didn't take that much, but the pizza was 1 of those things. And it's absolutely true that for a long time it did software.

S1

Speaker 1

55:04

I had a pizza delivered every single day. You know, the delivery guy knew me my name. And I didn't find out until years later that apparently I was such a good customer that they just never raised the price on me. And I was using this 6 year old price for the pizzas that they were still kind of sending my way every day.

S2

Speaker 2

55:21

So you were doing eating once a day or were you? It

S1

Speaker 1

55:25

would be spread out you know you have a few pieces of pizza you have some more later on and I'd maybe have something at home. It was 1 of the nice things at Facebook Meta is they do – they feed you quite well. You get a different – I guess now it's DoorDash sorts of things delivered but they take care of making sure that everybody does get well fed and I probably had better food those 6 years that I was working in the Metta office there than I used to before.

S1

Speaker 1

55:51

But it's worked out okay for me. My health has always been good. I get a pretty good amount of exercise and I don't eat to excess and I avoid a lot of other kind of not so good for you things. So I'm still doing quite well at my age.

S2

Speaker 2

56:05

Did you have a kind of, I don't know, spiritual experience with food or coffee or any of that kind of stuff? I mean, you know, the programming experience, you know, with music and or, or like I listen to Brown Noise on a program or like creating an environment and the things you take into your body, just everything you construct can become a kind of ritual that empowers the whole process of the program. Did you have that relationship with pizza or?

S1

Speaker 1

56:34

It would really be with Diet Coke. I mean,

S2

Speaker 2

56:36

there still

S1

Speaker 1

56:36

is that sense of, you know, drop the can down, crack open the can of Diet Coke. All right, now I mean business. We're getting to work here.

S2

Speaker 2

56:43

Still to this day, is Diet Coke is still part of it?

S1

Speaker 1

56:46

Yeah, probably 8 or 9 a day.

S2

Speaker 2

56:49

Nice. Okay. What about your setup? How many screens?

S2

Speaker 2

56:53

What kind of keyboard? Is there something interesting? What kind of IDE, Emacs, Vim, or something modern? Linux?

S2

Speaker 2

57:02

What operating system? Laptop? Or any interesting thing that brings you joy?

S1

Speaker 1

57:06

So I kind of migrated cultures where early on through all of game dev, there was sort of 1 culture there, which was really quite distinct from the more the Silicon Valley venture culture for things. They're different groups and they have pretty different mores in the way they think about things. And I still do think a lot of the big companies can learn things from the hardcore game development side of things, where it still boggles my mind how I am, how hostile to debuggers and IDEs that so much of them, the kind of big money, get billions of dollars, Silicon Valley venture-backed funds are.

S2

Speaker 2

57:44

Well, that's interesting. Sorry, so you're saying like, like big companies like Google and Meta are hostile to-

S1

Speaker 1

57:50

They are not big on debuggers and IDEs. Like so much of it is like Emacs, Vim for things. And we just assume that debuggers don't work most of the time for the systems.

S1

Speaker 1

58:00

And a lot of this comes from a sort of Linux bias on a lot of things where I did come up through the personal computers and then the DOS and then I am Windows and it was Borland tools and then Visual Studio and-

S2

Speaker 2

58:16

Do you appreciate the buggers?

S1

Speaker 1

58:18

Very much so. I mean, a debugger is how you get a view into a system that's too complicated to understand. I mean, anybody that thinks just read the code and think about it, that's an insane statement in the, you can't even read all the code on a big system.

S1

Speaker 1

58:30

You have to do experiments on the system. And doing that by adding log statements, recompiling and rerunning it is an incredibly inefficient way of doing it. I mean, yes, you can always get things done even if you're working with stone knives and bearskins. That is the mark of a good programmer, is that given any tools, you will figure out a way to get it done.

S1

Speaker 1

58:52

But it's amazing what you can do with sometimes much, much better tools, where instead of just going through this iterative compile-run debug cycle, You have the old Lisp direction of like you've got a REPL and you're working interactively and doing amazing things there. But in many cases, a debugger has a very powerful user interface that can stop, examine all the different things in your program, set all of these different breakpoints. And of course, you can do that with GDB or whatever there. But this is 1 of the user interface fundamental principles, where when something is complicated to do, you won't use it very often.

S1

Speaker 1

59:28

There's people that will break out GDB when they're at their wits' end, and they just have beat their head against a problem for so long. But for somebody that kind of grew up in game dev, it's like they were running into the debugger anyways before they even knew there was a problem. And you would just stop and see what was happening. And sometimes you could fix things even before you, you know, even before you did 1 compile cycle.

S1

Speaker 1

59:50

You could be in the debugger and you'd say, well, I'm just going to change this right here. And yep, that did the job and fix it and go on. And for

S2

Speaker 2

59:57

people who don't know, GDB is a sort of popular