HomeVideos

Why performant code matters (but gets widely ignored), with Casey Muratori

Now Playing

Why performant code matters (but gets widely ignored), with Casey Muratori

Transcript

3338 segments

0:00

There's a misconception about the way

0:02

you approach optimization. You run a

0:04

profile, you identify the big parts, you

0:07

make some changes, you measure

0:09

statistics. I've worked with many

0:11

extremely good optimization people and

0:13

that is not how it is done.

0:14

>> Assembly language is not all that

0:16

complicated, right?

0:17

>> All of the JavaScript libraries, the

0:18

DOM, CSS, React, assembly language,

0:21

maybe there's 20, 30 instructions you

0:24

might have to learn total. If you can

0:26

vertically center a div in HTML, then

0:28

you can probably learn assembly

0:29

language, I would say.

0:30

>> How are you using AI tools, if you're

0:32

using them at all?

0:33

>> We are not using them at all. The reason

0:35

that I want to program things in a game

0:37

is because I want to program them. If I

0:39

just wanted an AI to program them, I'd

0:41

just go get the Unreal [laughter]

0:42

Engine.

0:43

>> What are things that you think are

0:44

non-negotiable for someone to be a great

0:46

software engineer?

0:47

>> So, I find there's a lot of received

0:49

programming wisdom that's just nonsense.

0:51

Clearly, no one's ever tested it. And so

0:53

in order for it to be received wisdom,

0:55

you should

0:59

Why do most devs not care about writing

1:01

performance software and should we?

1:03

Today's guest Casey Moratory spent the

1:05

last decade arguing that we should. He

1:07

also says that most software out there

1:09

runs tens to 100 times slower than it

1:11

needs to. [music] Today we discuss why

1:12

the focus on performance took a backseat

1:14

across the industry and why Casey thinks

1:16

the tide is finally turning. why you'll

1:18

want to learn reading assembly if you're

1:20

serious about high performance code and

1:22

why it's less scary than it sounds. The

1:24

saying premature optimization is the

1:25

root of all evil, why Casey says that

1:27

the majority of people use it to avoid

1:29

thinking about performance when they

1:30

really should and many more. If you want

1:33

to get better at writing faster software

1:34

[music] and become a better engineer

1:36

while doing so, then this episode is for

1:38

you. And if you're one of the people who

1:39

hit a like on this post by Ryan asking

1:41

for this episode to be more about

1:42

programming than about AI, this episode

1:44

is also for you. This episode is

1:46

presented by antithesis. If you work

1:48

with agents, your job is no longer just

1:50

writing code. It's also specifying and

1:52

testing it. [music] Antithesis is the

1:54

most effective method of verifying

1:55

agentic code today. This episode is

1:57

brought to you by Sentry. You probably

1:59

already know what Sentry is because

2:00

you're a developer. If not, just ask a

2:02

dev and they'll tell you. I use Cry to

2:03

monitor the back end of the pragmatic

2:05

engine for any and all events and

2:06

errors. Of course, Sentry doesn't only

2:08

do errors. They also have logs, replays,

2:10

spans, profiles, metrics, and more

2:12

because they're all connected to the

2:13

same trace. One new capability Sentry

2:15

has I'm really liking is its ability to

2:17

fix errors. Let me show you. Here's a

2:19

list of errors on my admin back end.

2:21

There's a recent error on O that I want

2:23

to check out. Let's have Seir run an

2:25

autofix for us. Seir is Century's AI

2:27

debugging tool. First, it generates a

2:29

root cause analysis. It's finding some

2:32

problem with HTTP versus HTTPS URLs.

2:35

Cool. Now that we know what's going

2:37

wrong, Seir can create a plan on how to

2:38

go about fixing it. I could go and edit

2:41

this plan, but I'm happy with it. So,

2:42

let's create the actual code fix. Here's

2:45

a code fix that Seir generated. Assuming

2:47

it looks good, and in my case, it does.

2:49

Let's draft the pull request. And boom,

2:52

the PR is created, ready to merge. What

2:54

I love about Autofix is how Senu went

2:56

from showing a list of errors inside my

2:58

application to offering me a fast way to

3:00

fix it and close the loop while I stay

3:02

in charge of this bug fix the whole

3:03

time. Debugging got a whole lot faster

3:05

and a whole lot easier. Check out Sentry

3:07

at centry.io/pragmatic io/pragmatic and

3:09

start detecting errors, diagnosing your

3:11

root causes, and fixing issues and

3:13

regressions today. All right, Casey,

3:15

welcome to the podcast. It's so nice to

3:17

have you here.

3:18

>> Thank you so much. It's great to be

3:19

here. Thank you for the invitation.

3:21

>> Now, I want to go back when we start to

3:23

the beginning. How did you get into tech

3:26

programming, computers?

3:27

>> Well, I guess computers, it's like very

3:30

very early on. Um, my dad was a

3:33

programmer at Digital Equipment

3:34

Corporation, which is a company that

3:36

people will know if they studied

3:38

computer history, but would not know if

3:40

you just looked at the landscape today.

3:41

They're they're completely gone, right?

3:43

Uh, they got absorbed partly by Intel,

3:45

partly by Compact, I think. Uh, there

3:47

was, you know, they kind of got uh,

3:49

broken up. At that time, it was kind of

3:52

a really big computer manufacturer. You

3:54

know, computers like the PDP11, that's a

3:57

digital equipment corporation computer.

3:59

uh the vax like things that you may have

4:00

heard of in computers.

4:01

>> Oh, these were these ma massive main

4:03

frames.

4:04

>> Yeah. Uh mini computers as well. So like

4:06

smaller also sometimes than main frames

4:09

like the kind of next step down, right?

4:11

And so in general that that era, my dad

4:14

was a programmer there. He would later

4:16

end up at Intel because, you know, like

4:17

I said, parts got acquired. He never

4:19

actually left his job. He just ended up

4:20

at Intel through kind of uh digital's

4:23

eventual demise. But as a result, we

4:25

always had computers at home, even

4:28

though at that time, you know, that

4:30

might have been a little bit odd. Um,

4:33

you know, I I learned to program when I

4:35

was seven, which would have been in

4:37

like, you know, 1982 or something like

4:40

that. And so at that time, you know,

4:43

maybe you might have an Apple or

4:45

Commodore kind of computer at home, like

4:47

some kind of early computer. I don't

4:49

remember the exact line dates of those

4:51

computers, but most people didn't. And

4:54

it was only until a little bit later

4:55

that you would and you probably wouldn't

4:56

have had a programmer in your household

4:59

to teach you more importantly, right?

5:01

So, uh, so I learned really early on and

5:04

that's when I got into computers. How I

5:05

got into games was, uh, I ended up

5:08

randomly interning at Microsoft and I

5:09

met people there and like I went and,

5:12

you know, sort of went off into games

5:14

through them. That was that was how that

5:15

happened if that makes sense.

5:16

>> But wait, how is the Microsoft/game

5:19

relationship? That's not kind of a

5:21

given, right? Microsoft is not

5:23

They [laughter] have one game, right?

5:24

It's Flight Simulator.

5:26

>> Uh yes, at that time it would it would

5:28

have been very weird. Uh the reason that

5:30

happened was a guy called Chris Hecker

5:32

who uh a lot of people don't really know

5:36

his history because there was sort of

5:38

two waves of bringing games to Microsoft

5:41

Windows. Um cuz I mean now it's it's

5:43

funny to think about now because people

5:44

think of like what platform are you

5:46

going to play games on if you have a PC?

5:48

You know, Windows is like the default.

5:50

Linux is now an insurgent to that. But

5:52

Windows is the default. And so you think

5:54

about how did that happen? Be you know

5:57

uh because that wasn't the case if you

5:59

were back in the early days. Uh

6:01

Microsoft Windows not a gaming platform.

6:03

It's almost nothing on it. It's like

6:04

solitire and mind sweeper and a few

6:06

other uh sort of games.

6:08

>> How did it happen?

6:09

>> So uh what happened the reason for this

6:12

this kind of gets into a technological

6:14

reason. The reason for this is that it

6:16

was very hard to actually produce images

6:19

that could be displayed on the screen

6:21

quickly.

6:22

And to understand why this is is like

6:24

its own kind of topic, but in general,

6:26

you can just imagine you have these this

6:30

operating system running, which is

6:31

Microsoft Windows. It's controlling the

6:33

graphics card. It's often running at a

6:35

fairly high resolution uh compared to

6:37

what a game might want to run at. You

6:39

have to negotiate with it in order to

6:41

display your bit map in some way that

6:43

won't destroy all the things that it's

6:44

trying to display. So on so forth. early

6:47

versions of Windows uh up through like

6:50

Windows uh three uh Windows for workg

6:52

groupoups let's say if anyone remembers

6:53

that name.

6:54

>> Was it after 3.1?

6:56

>> It was 3.51 I think is what it's called

6:58

or maybe just 31. Yeah, there's NT351.

7:01

No, so it's like I think you're right.

7:02

31 3.1 I don't know something like this.

7:04

Yeah, Windows for workg groupoups was uh

7:06

you know around that time. that version

7:09

of Windows, which is in the 3 series,

7:12

didn't really have a way to quickly use

7:14

the CPU to fill pixels, which is what

7:17

games need to do, right? There's there's

7:19

no GPU acceleration really at this

7:20

point. We there's a little bit we could

7:22

talk about, but it's not mainstream.

7:23

It's not in consumer. So, they they need

7:25

to be able to to do this sort of thing.

7:27

They need to be do it in a double

7:28

buffered way so they can draw to a back

7:29

buffer and then show it to the screen.

7:30

And that has to happen very quickly. And

7:32

there just wasn't a way to do this in

7:34

Windows. In Windows, you had to kind of

7:35

go through uh this API where you would

7:37

produce sort of a bit map that wasn't

7:40

necessarily in the right format for the

7:42

display you were using and then it had

7:43

to do a translation from that bit map to

7:45

the other one when it displayed it. All

7:47

this sort of stuff. So games on Windows

7:49

like things like Doom, they're not

7:51

coming to Windows, right? Uh that kind

7:53

of future was not in the works uh for

7:56

Windows. And that was kind of what some

7:58

people in Microsoft wanted to change.

7:59

And one of the people who brought this

8:01

change about was a guy named Chris

8:03

Hecker. and he was like, "Okay, we could

8:07

actually just make a library that did

8:11

the fast blitz to the screen so that we

8:13

could have a way that people could do

8:15

these draws and get them on the screen

8:17

quick enough to make gaming viable.

8:19

Would it be 100% as fast as DOSs?"

8:21

Probably not. But could you actually run

8:24

uh you know, some of these new games?

8:26

You know, Wolfenstein 3D I think would

8:28

have been out at this time. Doom was

8:29

kind of on the horizon and that sort of

8:31

thing, right?

8:31

>> Yeah. And so he started this project

8:33

that he was not supposed to do. He did

8:35

not have the authority to do this called

8:37

wing,

8:39

which I believe at least stand for like

8:40

win graphics or something like that.

8:42

Total skunk works project. He had cover

8:44

from his manager. I'm I'm assuming I can

8:46

say all this stuff now because it's

8:47

ancient history. He had cover from his

8:49

manager. His name guy's name was Michael

8:51

Edwards. And Michael Edwards basically

8:53

just kind of ran cover for this, which

8:55

is a thing that probably wasn't going to

8:56

fly because they were in a division at

8:59

that time which would have been

9:00

Microsoft Research today kind of. It was

9:02

called at Advanced Technology was the

9:04

early version of Microsoft Research. You

9:06

were not supposed to be shipping core

9:08

libraries for Windows like it had

9:09

nothing to do with that. Long story

9:11

long, what ended up happening is that

9:14

product did ship. Win, I guess you

9:16

wouldn't call it a product. It's an

9:17

add-on for Windows. did ship and it was

9:20

the first step towards DirectX.

9:23

>> Uh people forget that Wing was the first

9:25

way you did this and then eventually we

9:28

had DirectX and DIB sections and Win 95

9:30

and all that sort of stuff. When I went

9:32

to Microsoft, amusingly the person I was

9:34

supposed to be reporting to as an intern

9:37

was Michael Edwards. When I showed up

9:41

first day along with the other interns,

9:43

uh guy named Rudy, a guy named Rajie, uh

9:46

we were all supposed to report to him,

9:47

right? because you get a couple interns

9:49

in under one, you know, sort of manager.

9:52

We show up and we're just taken aside,

9:54

you know, after some kind of, you know,

9:56

stupid HR orientation thing that was,

9:58

you know, lame as it always is. And and

10:01

we get taken aside by somebody. I don't

10:03

remember the lyrics. They're like,

10:04

"Look, bit of bit of a problem. Uh the

10:07

person you interviewed with and were

10:08

supposed to like report to, uh they they

10:12

aren't here. Like I don't remember

10:13

exactly how they put it. So, uh, you're

10:16

going to go talk to this other guy and

10:17

they'll find something for you to do.

10:18

Turns out the wind thing had blown up

10:21

the previous week and Mike Edwards had

10:24

stormed out of the building and had not

10:26

been seen since. That is what actually

10:29

happened. [laughter] So, that's I arrive

10:31

at Microsoft, the person I'm supposed to

10:32

intern with, he just he just flamed out

10:34

and left. No one knows when he'll be

10:36

back. He did end up coming back like a

10:38

week after I got there. Uh, but he was

10:40

kind of moved over to a different

10:42

division. like they you know there was a

10:43

bunch of like triage work done there to

10:45

figure out what's going on. So that that

10:46

was my experience but suffice to say it

10:48

meant that I was right in sort of like

10:50

ground zero of games on Windows. So I

10:52

met Chris Hecker. I got to talk to a

10:54

bunch of people there. He actually took

10:55

me out to see one of my childhood heroes

10:58

Ron Gilbert who is the guy who did the

11:00

scum engine. Yeah.

11:02

>> He knew all these guys because working

11:03

on WG he had gone out to see a bunch of

11:06

game developers and like work with them

11:08

and this sort of thing. So, I got to go

11:09

to Humongous Entertainment, which was

11:11

Ron's new company. He gave me a a secret

11:14

of Monkey Island, uh, mouse mouse pad, I

11:17

remember. Uh, so anyway, it was it was

11:19

really cool. And that's how I ended up

11:20

getting into the game industry was was

11:21

was through Chris Hecker. And he's kind

11:23

of an unsung hero of getting games on

11:25

Windows because, you know, he he just he

11:28

wasn't out there making his story known,

11:29

but but, you know, I am now, I guess.

11:32

>> But it's it's so interesting to hear

11:33

these stories. Obviously, now you can

11:35

share it, I'm sure. you know, like for a

11:36

while this would have been like only

11:38

with within the inner circle, but the

11:40

fact that you know, of course, DirectX

11:42

was a huge

11:43

>> success and and it it did like as far as

11:47

you know, from my vantage point, huge

11:48

reason why games are big on Windows, but

11:50

now here's someone who just ignored

11:52

wasn't asked anything, just was doing

11:54

something, got into conflict, fights,

11:57

and just like pushed an idea. It's more

11:59

than you think because there were three

12:01

people who really were the core people

12:05

who pushed DirectX, meaning

12:07

institutionally pushed it. There are

12:08

tons of programmers like Todd Laney who

12:10

did, you know, really important core

12:12

work. It never would have shipped

12:14

without people like him. So, not on the

12:15

program side, I'm talking about

12:16

institutional side. It's Angstrom and

12:19

Alex St. John. I don't remember which

12:21

one is either or Angstrom

12:24

was the tester on Win. So he came from

12:28

that team. So the start of DirectX, one

12:32

of the core members of DirectX was on

12:34

the Windy team. So it's a direct

12:36

lineage. It's not even like an unrelated

12:39

push. So WGI really was the start of it.

12:41

And then DirectX was kind of the actual

12:44

full blossoming into an org with

12:46

Microsoft's blessing at that point, you

12:48

know, that that actually became powerful

12:50

internally. And then after after this

12:53

Microsoft internship and getting exposed

12:54

to all these folks, you actually went

12:56

and and built games tooling, you then

12:59

started your own studio as well, right?

13:01

So like how how did that sequence?

13:03

>> I guess there's a couple of steps in

13:04

there. I worked at a startup with Chris

13:07

Hecker that didn't end up doing anything

13:08

interesting. Then I went to a company

13:11

called Gaspowered Games, which was

13:12

actually a Microsoft guess they're not a

13:15

Microsoft studio, but their publishing

13:16

deal with was Microsoft. and uh they did

13:19

a game called Dungeon Siege which is

13:22

kind of a you know I don't know it's not

13:23

a particularly well-known title. From

13:25

there I went to Rad Game Tools and

13:27

that's where I stayed for quite some

13:29

time. Uh I did their character animation

13:31

system that was a very popular product

13:33

that ended up getting used in in lots

13:34

lots of games. It's still used to this

13:36

day, much to my surprise. Uh because

13:38

that's a very very I haven't worked on

13:39

it since 2004, [laughter]

13:42

but I guess other people had maintained

13:44

it and some studios just kind of

13:45

integrated into their you could get

13:47

source licenses. So I guess some studios

13:49

just integrated it into their pipelines

13:51

and have never removed it. Uh and they

13:52

just maybe keep updating it um to to

13:55

keep it working the way that they want.

13:57

So anyway, uh that's what I did there.

13:59

And then afterwards I' I've been

14:01

independent since then. I just have a

14:02

company called Malle Rocket uh where we

14:04

do various stuff. I've done you know

14:05

contract work for for people through

14:07

that. We now do like the Substack

14:09

through that where we do educational

14:11

materials. So I've kind of just done

14:13

random stuff uh since then. Although I

14:16

have done some work on games. I noticed

14:17

your checklist you were talking about

14:18

the witness.

14:19

>> Uh obviously that one was an actual

14:22

specific title that I worked on but that

14:24

was that was mostly just because it was

14:26

a very big project and I was you know

14:27

I'm friends with John so I was just

14:29

trying to do some helpful programming on

14:30

the side. I did some stuff on how the

14:32

movement system worked. I thought there

14:33

were some interesting problems that we

14:35

could solve there for games. And so that

14:37

was a that was a really fun project to

14:38

work on.

14:39

>> Yeah. And then today you're you're doing

14:41

educational stuff on a bunch of

14:43

subprogramming performance on your

14:45

substack. And what else are you busy

14:47

with?

14:47

>> So we do actually have a an unannounced

14:49

project that we've been working on uses

14:51

up sort of the rest of the time

14:53

[laughter] that that I have if that

14:55

makes sense which is not always so much.

14:57

um and that we will we're hoping to

14:59

announce it sometime soon. Um but it it

15:02

it's not quite out yet. Believe me, I

15:03

will I will you will hereby I will send

15:05

you an email as soon as we have an

15:07

actual announcement. But uh given the

15:09

fact that it is kind of like a split

15:11

time sort of thing for us because we're

15:13

pretty focused on making sure the

15:14

substack is good and all that sort of

15:15

stuff. We're we're trying to keep it

15:18

fairly tight lipped until we actually

15:20

know we're mostly done because we don't

15:22

know how much time we can always devote

15:24

to it if that makes sense.

15:25

>> Yeah. No, it's it's it's it's pretty

15:27

typical games related things, right?

15:30

Like tight lipped until you have

15:32

something for good reasons.

15:34

>> Well, sometimes people play the other

15:35

game. They go like, "Look, we're going

15:37

to day one we're going to be very loud

15:40

about this and try to build a community

15:42

around the development of the game and

15:43

all that sort of stuff." And that's

15:45

great. Uh so, you know, that's another

15:48

route you can go. But if it's not your

15:50

full-time thing, if you have, you know,

15:52

other responsibilities, that doesn't

15:54

seem great, right? because you you don't

15:56

have any insight into how much time you

15:57

will actually be able to devote to it,

15:59

right?

15:59

>> Yeah. And on on Substack, it's called

16:02

computer enhance and you started it with

16:05

performance related topics and that's

16:07

how we started to talk I think about

16:09

three years ago when when you already

16:10

had a Substack and we we had a direct

16:12

message conversation. I remember you

16:14

messaged me saying, "Hey, Gerge, why do

16:16

you think in the industry

16:19

people software developers just don't

16:21

really focus on performance?" I I think

16:24

you specifically wrote

16:25

>> I did

16:26

>> uh you were saying how there's there's

16:29

little emphasis on performance. There's

16:30

even though there seems to be

16:31

overwhelming evidence that performance

16:33

is critical to the bottom line of of

16:35

most software and I wanted to ask you we

16:37

we've had a good back and forth on this

16:39

and actually I think initially I told

16:40

you like oh here's why you don't need to

16:42

care about performance when you're

16:43

building I don't know distributed

16:44

systems or like but since then what have

16:47

you learned? Why do most developers

16:49

don't care or even most companies,

16:51

teams, engineering teams not care about

16:52

performance all that much? It's a really

16:54

good question and I think I do think

16:57

your answer at the time if I remember it

16:59

correctly is certainly an accurate one

17:01

for some subset of of industries uh

17:04

which you know you said something along

17:06

the lines of look a lot of these pieces

17:08

of software that you're seeing the user

17:10

isn't the purchaser right like you were

17:13

you were like this is some kind of thing

17:15

where you know somebody very high up is

17:17

going to look and say we need software

17:19

for managing HR they're going to look at

17:21

the cost of the software they're going

17:22

to look at the compliance terms terms of

17:23

the software, the legal liability,

17:25

whatever, right? And then they're just

17:27

going to make a purchase decision on

17:28

that sheet. They're not in there looking

17:31

to see whether it takes like, you know,

17:33

whether there's a 30-cond pause every

17:35

time you want to try and access

17:36

somebody's record, right? And I think

17:38

that's very true. Like unfortunately,

17:40

the situation for a lot of enterprise

17:42

software probably is that way. So maybe

17:45

an individual might well be upset about

17:47

the performance of that software. And I

17:49

certainly hear from people all the time

17:51

who are upset about the software that

17:52

they use. They might not be in any

17:54

position to change it. I think that's

17:55

one thing. There's thing two which is

17:58

that in a lot of cases you simply have

18:02

monopoly effects. Uh you know people

18:04

aren't right now realistically going to

18:07

challenge the social networks that

18:09

currently exist. For example, people

18:11

have tried. It's very hard. you know,

18:13

Blue Sky and Threads have tried to

18:16

assail X and you know, you've got

18:19

Facebook and Instagram and Tik Tok and

18:21

they kind of just own those spaces,

18:24

right? And it's very hard to push into

18:26

those because of these like network

18:28

effects and maybe performance could be

18:31

part of a package where you try to take

18:35

on one of those players. like, hey, look

18:36

at how much more responsive our thing is

18:38

than theirs. Might be a nice plus, but

18:41

that's not going to be sufficient. If

18:43

you just show up with no plan for how

18:44

you get adoption, no plan how you get

18:46

big influences over there, all that sort

18:48

of stuff,

18:49

>> it can't sell a product on its own into

18:51

a monopoly space, right? If you're just

18:53

talking about apps that someone can

18:55

choose to download, maybe you've got a

18:56

shot there. But those are just they're

18:58

forming a smaller and smaller subset of

19:00

what software is, right? and this bigger

19:01

and bigger subset is like these monopoly

19:03

platforms you go on uh to to sort of

19:06

work with. So I'd say that's another

19:07

thing. Thing number three is I think now

19:09

people sort of are caring about

19:11

performance more. I think over the past

19:13

decade uh the people uh including myself

19:15

but many many other people who have been

19:17

saying that this is a problem uh have

19:20

actually had some effect like I don't

19:21

think that it was a waste of time. I'm

19:23

seeing a lot of new emphasis on

19:26

performance, people talking about

19:27

performance, people posting benchmarks

19:30

on things. And so I actually think that

19:32

the third thing is well actually it kind

19:34

of does seem that pointing at this issue

19:37

and saying this is something we should

19:38

be doing better has not been completely

19:41

uh a waste of time. I I do see things as

19:44

sort of starting to turn around a little

19:45

bit. I also see people attacking major

19:48

product categories now with

19:49

performance-based pitches. Things like

19:51

File Pilot or the Blick video editor,

19:53

like things like this that have been

19:54

coming out lately where it's like, oh,

19:56

really performant software to try to

19:58

take on uh incumbents in a space and

20:00

they've been getting traction. So, I

20:02

think that's also a really good sign.

20:03

>> Yeah. And I guess on on this last

20:05

category, a really good example in the

20:06

developer community is bun versus npm

20:10

where bun just said like okay we're like

20:12

10x or 20x or 50x faster and devs are

20:16

like what this possible and then it was

20:19

so they there was this outrageous claim.

20:22

I almost I I wonder if like you need to

20:24

have these outrageous claims cuz devs

20:25

started to pay attention cuz it was 10x

20:28

faster in many you know categories. You

20:31

know, linear versus was gyra is also a

20:34

good example where linear have this

20:37

benchmark of okay, they have 300

20:38

milliseconds for any action and gyra of

20:40

course we know is is just slow because

20:43

they have a bunch of complex you can

20:45

explain why but it's slow. They it was

20:47

never built for that.

20:48

>> Yeah. And you know if you think about

20:49

something like a 300 millisecond budget

20:51

for an operation 300 milliseconds is

20:53

like an eternity in computing, right?

20:56

And so if you're talking about like our

20:58

pitch is that we're not more than 300

21:00

milliseconds, that just shows you how

21:02

the bar was so far past where it

21:06

probably should have been for something.

21:08

And you see it everywhere. You know, I

21:09

you go on to programs and you're waiting

21:11

sometimes seconds for an operation. And

21:13

I don't think people realize just what

21:15

an eternity a second is in modern

21:17

computing. Uh especially when you're

21:19

sitting on networking like that has, you

21:22

know, sub 10 millisecond ping times.

21:24

Sometimes you're talking about this, you

21:27

know, the actual packets had to travel

21:29

physical distance to get to this data

21:31

center and that was being done far

21:33

faster than this very simple operation

21:35

that you were failing to do in a

21:36

reasonable amount of time. It's just

21:37

like we are massively underperforming

21:39

and people don't believe it when you say

21:40

10x 100x but it's actually true and

21:43

we've seen a lot of proof of it as you

21:44

point out. I do wonder if one part of

21:47

the not really much focus on performance

21:49

is that a lot of developers don't know

21:52

the the baseline thing. And I I'm

21:53

reminded by Simon Ericson, the founder

21:56

of Turbuffer, have this has this project

21:57

called Napkin Math where he did a list

22:00

of mostly networking operations. How

22:02

long does it take to transfer one bite

22:05

between like two AWS data centers? How

22:08

much does a gigabyte take? How much does

22:10

a terabyte take? how much does it take

22:12

uh to to write an SSD to an N an MVM an

22:16

N N N N N N N N N N N N N N N N N N N N

22:16

N N N N N N N N N N N N N N N N N N N N

22:16

VME and so on. And so he had he had

22:18

these numbers and he said that what he

22:20

found is whenever inside Shopify they

22:23

were deciding do we choose vendor A or

22:25

vendor B as a database they would just

22:27

run uh a benchmark that they would write

22:30

themselves and they would get like okay

22:32

like I don't know storing this and this

22:34

it takes 2 seconds on this one 10

22:35

seconds on that one we will choose a two

22:37

second one and he looked at it and said

22:38

like hey like this doesn't make sense

22:41

like the amount to to store in a file

22:44

system like here's a theoretical limit

22:45

which is I don't know 100 milliseconds.

22:47

Like there's no way that's going to be

22:49

10 seconds. And it often turns out that

22:51

he found that the benchmark was just

22:52

wrong. They were benchmarking the wrong

22:54

thing and they were making decisions. So

22:55

I wonder if there's a thing where many

22:58

engineers, developers are maybe just not

23:00

aware of how truly devastatingly slow

23:03

this thing is versus the resources you

23:05

have.

23:06

>> Uh that is the entire point of like my

23:09

substack, right? So what you just said

23:12

is exactly true and it is the thing that

23:15

I hammer home on the substack through

23:17

all the parts of like the courses on

23:18

there which is that in general there's a

23:21

misconception about the way that you

23:23

approach optimization in uh like in

23:26

computer science or in whatever software

23:28

engineering let's say and that

23:29

misconception is that what you do is you

23:31

run a profile you identify where the

23:34

like you know big parts of the profile

23:37

are you make some changes to those and

23:40

you you measure like statistics the

23:42

better the statistics you know the the

23:44

the more uh statistics you can get the

23:46

better and you look to see if those

23:47

statistics improved if they have that

23:49

was a good change and you proceed as

23:50

such and this is completely not correct

23:54

that is not how anyone has ever you know

23:56

I I've worked with many extremely good

23:58

optimization people and that is not how

24:01

it is done the correct way to do

24:03

optimization is very much like what you

24:05

just said you first go what are the

24:07

operations that this system has to

24:09

perform form. What is the underlying

24:11

hardware capable of doing at its

24:13

theoretical peak? And then you measure

24:15

the delta between that theoretical

24:18

maximum and what you have achieved. And

24:21

then your goal during optimization is to

24:23

shrink that gap to something that you

24:25

think could be plausibly explained and

24:27

hopefully come up with explanations of

24:30

why you aren't at theoretical. Because

24:31

often times you can't hit theoretical.

24:33

That's why we call it theoretical,

24:34

right? And it's crucial that you do this

24:36

because otherwise all you're doing with

24:38

that other method is finding a you know

24:40

with with the with the I'm just going to

24:42

you know make something I think might be

24:43

an optimization and look if my

24:44

statistics improved. All you're doing

24:46

there is finding a local minima.

24:48

>> That's all you're doing. You're just

24:49

you're just you know you've got this

24:51

this shape of your performance and

24:52

you're finding some little spot and

24:54

you're sitting in it. That's not

24:56

optimization. That's improvement. But

24:58

optimization means to make optimal,

25:00

right? means we're going to find what we

25:02

actually should be able to get this

25:04

machine to do. And so, uh, you know,

25:07

that's why I emphasize that approach

25:08

because it's the one that I I've always

25:10

seen great optimizers take. That is how

25:12

they get good performance is by knowing

25:14

what the maximum could be. In addition

25:17

to that, it also is what lets you become

25:20

better at optimization. Because no

25:22

matter who you are and no matter how

25:24

much you already know, when you go to

25:26

tackle an optimization problem, there

25:28

may well be some things in the new like

25:31

way that the system is laid out that you

25:33

don't know about, new uh things that

25:36

people have not figured out about modern

25:38

CPUs, new things that are different

25:40

about the network backplane, new things

25:41

that are different about the GPU

25:42

drivers, who knows, right? And if you

25:45

don't have some theoretical maximum to

25:48

look at and to measure your delta from,

25:50

you don't know if there's some serious

25:51

anomaly there. And we you would be

25:54

surprised at how many times we find

25:57

anomalies like this things in CPUs that

25:59

no one knew about. And we, you know,

26:01

like I've literally had them in the

26:03

course of making the Substack. I've been

26:04

like, "What is this thing?" And I look

26:06

into it's like, "Oh, there's this new

26:08

renaming this this new rat table thing

26:10

that Intel chips seem to be able to do.

26:12

We didn't know about that." And that's

26:13

like a new thing we have to model when

26:15

we talk about how to do performance. And

26:17

so the that's the other crucial part of

26:19

I guess what you were calling napkin

26:21

math. I also call it back of the

26:22

envelope. That's the term I've heard

26:24

used for it. Often times they're kind of

26:25

interchangeable, right? Knowing what the

26:27

theoretical is is how you learn as well.

26:30

Uh how you learn about new hardware and

26:32

new performance op options.

26:34

>> Interesting. Plus by doing this you're

26:36

just learning. You're becoming better

26:37

professional. you understand more about

26:39

given hardware or or the inner workings

26:42

of of your computer or or software stack

26:45

or kernel, you know, all the stuff that

26:47

I guess goes way beyond the the the b

26:49

the vanilla programming language like

26:51

cuz you can say I'm an I'm an engineer.

26:53

I'm a software engineer because I know

26:54

how to use this programming language,

26:55

but I'd argue you're probably an

26:57

engineer if you can go down the stack

26:59

and you have that ability and you have

27:01

like a good good understanding of some

27:02

of it at least, right? And you can learn

27:04

the rest. And I would also say that one

27:06

of the other things that uh we do in the

27:07

class is teach how to read assembly

27:09

language. And people often ask what like

27:11

why like you know assembly language what

27:13

would I ever need that for? Uh there's a

27:15

very good reason for it. And that is

27:16

that everything else that you might use

27:19

doesn't tell you anything about what the

27:21

CPU is actually receiving. You know if I

27:24

look at a Java program if I look at a C

27:26

program if I look at Haskell OAML

27:29

whatever right uh Rust all I'm seeing is

27:32

input to a compiler. I have no idea what

27:35

the CPU is actually going to be asked to

27:37

do. If I look at the assembly language

27:39

output from that compiler, I know

27:40

exactly what the CPU is being asked to

27:43

do. And it's not that hard to be able to

27:46

learn to read assembly language so that

27:47

you can see very quickly is the CPU

27:51

being asked to do the things that I

27:52

think it should be asked to do them. And

27:54

in that way, right, you don't have to

27:56

write it hardly ever. Uh it's very rare

27:59

that you have to write assembly language

28:01

to do anything. um other than sometimes

28:03

for test purposes it's easier to do that

28:05

so you don't have to try and convince a

28:06

compiler to output something. So if

28:08

you're just testing something, sometimes

28:09

it helps to be able to write some

28:10

assembly language. But if you're just

28:12

talking about the uh vast majority of

28:15

tasks you might do in optimization,

28:17

writing it, no reading it essential. And

28:19

it also unlocks this sort of uh huge

28:22

world of possibilities to you because

28:24

once you know assembly language, you can

28:26

now do things like read those CPU

28:28

diagrams like you know when they

28:29

announce a new processor, they put up a

28:31

little diagram. That diagram tells you

28:33

stuff like the fastest this thing could

28:34

do multiplication and stuff like that.

28:36

It tells you that if you know a semi

28:37

language, you can read it right off the

28:38

chart, right? If you don't know a semi

28:40

language, you look at that chart and

28:41

like I have no idea do what I'm looking

28:42

at, right? Like it's just this weird

28:44

flowchart that doesn't really tell me

28:45

anything, right? And so one of the

28:47

really great things about s unlocks all

28:49

of this knowledge for you because it's

28:50

the it's the it's the actual uh input

28:53

language to the machine and it allows

28:55

you to figure out how it's operating.

28:57

>> Plus, I guess we should add that

28:58

assembly language is not all that

29:00

complicated, right? Just just by by by

29:02

nature, it's a far simpler language.

29:04

Okay, it's harder to read if you've

29:06

never seen it, but it's in terms of the

29:09

number of operations. It's so barebones

29:12

because you know that's what assembly

29:14

is. Like every single higher level

29:15

language will have way more keywords,

29:17

structure, whatever you name it, right?

29:19

Than assembly,

29:19

>> massively more uh and especially when

29:21

you consider the subset that are

29:23

actually used. If you look at the subset

29:25

of constructs that you would need to

29:27

understand to be able to understand um

29:29

say just a website from today, all of

29:32

the JavaScript libraries, all of the

29:34

JavaScript syntax, all of the DOM, you

29:36

know, all of the behavior that's going

29:38

to go on there, CSS, [laughter]

29:40

>> React, CSS, right? all of that

29:43

>> assembly language, you know, maybe

29:45

there's 20 30 instructions you might

29:47

have to learn total because most

29:50

assembly most things in legacy assembly

29:52

like x64, most of them are hardly ever

29:54

output by the compiler. So you only need

29:56

to learn a very small subsets. That's

29:58

the ones that's actually going to be

29:59

that you're going to be seeing in 90% of

30:00

the cases. It's so much simpler. And

30:03

also when you're looking at performance,

30:05

you're typically only looking at a very

30:06

small part, right? You've kind of

30:08

understood roughly what's going on. and

30:10

you've you've seen the basics layouts of

30:12

your program. you've identified what's

30:13

supposed to be happening and you're just

30:14

looking to see like wait why is this

30:16

part which I don't think should be

30:17

running this slowly why is it running

30:18

this slowly it's just a very small piece

30:20

you typically end up having to look at

30:22

as well so it's really much easier if

30:24

you can understand how to center a div

30:27

as they say if you can vertically center

30:29

a div in HTML then you can probably

30:31

learn assembly language I would say

30:33

>> okay you're super passionate about

30:37

performance optimization you also have

30:38

really good educational materials both

30:40

both free videos your paid substack the

30:42

free parts of it, etc. But let me just

30:44

play devil's advocate. There's this

30:46

saying that premature optimization is

30:48

the root of all evil. And we typically

30:50

use it or I typically use it so many

30:52

times. We're like, oh, should we make

30:53

this performance? Should we optimize the

30:55

thing? And like, nah, let's not do that.

30:57

Let's first build it. Let's see if it's

30:58

good enough for our customers, for

31:00

ourselves, and if we need to, we can

31:02

always optimize it. I mean, you know,

31:03

like it's it's not the hardest thing in

31:04

the world. Okay, maybe not as good as

31:06

how you mentioned cuz maybe I don't read

31:08

assembly but and that's that's kind of a

31:10

thinking of building you know like I

31:12

guess SAS software building software at

31:13

big tech. What is your reply to that cuz

31:16

I I'm I feel really good that I made a

31:18

really good argument here.

31:19

>> So I guess what I would say is the

31:22

important part about that and I guess

31:25

I'll divorce it a little bit from the

31:26

saying. I have an entire lecture on that

31:28

saying by the way. It's it's like two

31:30

hours long and I I gave it at better

31:32

software conference this year and I

31:34

believe the VOD we're linking that in

31:36

the show notes below.

31:37

>> Okay. It'll it'll be like a week or two

31:38

I think till it's up. So it may be right

31:40

at the same time as this. Uh but so if

31:43

you want to find out the history of that

31:44

phrase you can go look at that. But I

31:47

wanted to talk about the idea behind it

31:50

because I think there's uh I don't want

31:52

to dismiss it entirely because it's not

31:54

entirely false. And the idea is that

31:56

well I'm just going to delay

31:57

optimization work. I'm not going to

31:59

think about that and then I'm just going

32:00

to make whatever I'm going to make and

32:01

then you know either myself or maybe

32:03

I'll just hire some performance person

32:05

to come in and clean up the mess later.

32:07

Right? So here's the positive side of

32:09

that first. The positive side of that

32:11

first is for some types of code that

32:14

will work. If you happen to have written

32:17

some operation poorly where the

32:20

optimized version of that operation just

32:23

looks like someone taking a loop and

32:25

changing the loop from your really like

32:27

you know naive version to a really well

32:29

optimized version.

32:30

>> The the the typical of like I wrote a

32:32

bubble sort we can later optimize that.

32:35

>> Who knows right? Anything of that form.

32:38

Okay maybe we can just do that. So there

32:40

are certain times where you do in your

32:43

head want to be doing this where you

32:45

want to say okay I could go spend a week

32:48

researching the fastest hasht

32:50

implementation here but part of software

32:53

engineering is being smart enough to

32:54

know it won't matter if I do that now or

32:57

later the architecture around this piece

33:00

won't have to change I'm quite certain

33:02

because I understand the problem well

33:03

enough so it's okay I can defer that to

33:06

later maybe it's never too slow with the

33:09

naive when put in there and then we

33:10

don't have to do any work. Maybe it's

33:12

too slow later. That's okay. I just

33:13

target this one hasht implementation and

33:16

we'll get as fast as we need. Right? If

33:18

you're doing that, if you're applying

33:20

that true engineering mentality to it,

33:23

you don't have a problem. The problem

33:25

comes when you don't know if the choice

33:28

that you're making produces that kind of

33:32

optimizable hotspot. And I'll give you a

33:34

very simple example that usually people

33:37

have had experience with. A very simple

33:39

example would be we write our entire

33:41

software thing like we just whatever

33:43

this massive thing that we're imagining

33:44

doing where we're going to ignore

33:45

optimization. We sit down and we write

33:48

it and we use a paradigm where we ask

33:51

the server for something. We have like

33:53

some API, you know, that we've built for

33:55

asking servers for things. We ask the

33:57

server and it returns to us what the

33:59

server's response was. And we that's

34:01

like kind of how we architect this

34:02

thing. So everyone writes, you know,

34:05

hundreds of thousands or millions of

34:06

lines of code and they all look like ask

34:08

the server something, do some

34:09

calculations, ask the server for the

34:10

next thing, do some calculations, right?

34:12

Then at the end you find this is way too

34:14

slow. But that's okay. You weren't

34:15

worried about that cuz you're like when

34:17

the end you call in some performance

34:18

experts. They look at and they go,

34:19

there's nothing we can do for you.

34:20

Sorry.

34:21

>> Why? Well, the reason is because you

34:24

created a serial dependency chain. All

34:26

of your code looks like wait for a

34:29

network request to come back, do

34:30

something. wait for a network request to

34:32

come back, do something, wait for and

34:35

that serial dependency chain can't

34:37

really be shortened without just

34:39

rewriting it. If instead you had made

34:42

the paradigm and told your programmers,

34:44

look, here's what you need to do. At the

34:45

top of every operation, you need to

34:47

figure out all the things you might want

34:48

to ask the server for, you ask them for

34:51

all of those things, right? And then you

34:53

do all of your processing there. And you

34:55

only create a chain of dependencies if

34:57

you absolutely couldn't have determined

35:00

what it was you needed to ask a server

35:02

for. Now you're just in this situation

35:03

because you didn't tell them to do that.

35:05

You have to rewrite all your code.

35:06

Everyone is now going out rewriting all

35:08

the code if they even can. If it's even

35:10

possible to really do that in a way

35:12

that's not slower than just rewriting

35:14

the thing, right? So what happened

35:16

there? Well, again, we talk about this a

35:17

lot on on the Substack, but there's this

35:19

idea of a serial dependency chain. It's

35:21

when you stack things in order, right?

35:23

And the performance of your software is

35:25

generally determined by the longest

35:27

serial dependency chain because it's

35:29

something that cannot be parallelized.

35:31

If I have thing A that then B depends on

35:34

that then C depends on that we cannot

35:36

shorten that because it has to go in

35:38

order. Everything waits for it. We can't

35:39

multi-thread it because it's dependent.

35:41

We can't uh you know make it run wide.

35:44

We can't you know uh amortize the

35:46

network request whatever. that kind of

35:48

thing can be pervasive in the

35:49

programming and we can't cheaply remove

35:51

it cuz it's not a hot spot. It's a way

35:53

that you did things. That's the part

35:55

where that kind of thinking breaks down.

35:57

If every uh software engineer knew to

36:01

watch out for false serial dependency

36:03

chains, things where they were creating

36:05

series of dependent operations that

36:07

could not be optimized away or other

36:09

sorts of architectural problems like

36:11

that that cannot be easily fixed, then

36:14

the world would look more like just wait

36:16

and optimize the hotspot, right?

36:18

>> Yeah. So this this is the architecture,

36:20

the planning, right? Like if if in that

36:22

phase you're like okay like as this

36:24

thing grows like what will get in the

36:26

way of performance what will slow it

36:28

down or you can ask all these questions

36:29

or like different flavors of the

36:30

questions you know or from the other

36:32

side and so on.

36:33

>> Yeah. Another way to think of it is cuz

36:35

hotspots is the way that people talk

36:37

about that like oh it's it's going to be

36:38

hotspot optimization. We just got a few

36:40

spikes. Someone will come in and clean

36:41

up those spikes and we're done. Right.

36:43

The way to think about it is your

36:44

codebase will not end up that way by

36:46

accident in most cases anymore. you have

36:48

to engineer upfront for a [snorts]

36:51

hotspot codebase that people can then

36:54

optimize, right? And so that's the

36:56

crucial takeaway is everybody on your

37:00

team who is making architectural

37:01

decisions, those people must know

37:04

performance and they must make decisions

37:06

that will allow the other people

37:09

downstream of them to use an

37:12

architecture which can be optimized

37:14

later. If you don't do that, you're just

37:16

rolling the dice. Casey just talked

37:18

about how engineers making architectural

37:20

decisions should know about performance.

37:21

This is also true when choosing your

37:23

dependencies like which database to use.

37:25

And this is where I want to mention our

37:26

season sponsor Turbopuffer. You already

37:29

know how Turboper is a vector and full

37:30

text search engine. But here's an

37:32

interesting story from Linear on what

37:34

happens when you stop thinking of

37:35

Turbopuffer as a search engine and start

37:37

using it as a primitive to reduce

37:38

latency. As context, Linear is a local

37:41

first app. So each client keeps a local

37:44

database and when that client goes back

37:46

online, it needs to catch up with what

37:48

happened and do it fast. Their biggest

37:50

workspaces generate around a million

37:52

sync actions per day. Doing catch-ups by

37:54

reading from post was getting slow for

37:56

large reads. So the tail latency got too

37:59

large and adding more replicas did not

38:01

help either. Linear solved the problem

38:03

cleverly. They started using Turbopuffer

38:05

as a serving index for each client. This

38:07

is because Turbopuffer itself is built

38:09

on top of inverted indexes. So for every

38:12

index value, it stores the documents

38:14

that that value can be found in. The

38:15

lookup cost for such an index is

38:17

constant. So linear took this structure

38:19

and had each client's index point to the

38:22

changes that they needed to sync. As a

38:24

result, not only did they reduce

38:25

latency, but they kept it constantly low

38:28

matter how long the change list is

38:29

synced to the client is. Linear

38:31

published a blog post about this

38:32

refactors titled rebuilding linear's

38:34

delta sync read path. Check it out. I

38:36

love this story because it shows how

38:38

important it is to choose the right

38:39

primitives and how good primitives can

38:41

improve your system. If you're building

38:43

systems where you store a lot of data or

38:45

serve a lot of data, Turbopuffer can

38:47

probably speed things up or save on your

38:49

costs. Learn more at

38:50

turbopuffer.com/pragmatic.

38:52

I'd also like to talk about a presenting

38:54

sponsor and this is while Casey

38:56

deliberately does not use AI coding

38:58

agents for his work. Most of us do. And

39:00

when you work with coding agents, your

39:01

job is no longer writing code. It's

39:03

specifying and testing it. Antithesis is

39:05

the most effective method for verifying

39:07

agentic code today. Let me explain how

39:09

it works. Antithesis runs your whole

39:11

system in a hostile simulation. By doing

39:13

so, it finds every bug before your users

39:15

do. And because the simulation is fully

39:17

deterministic, and this doesn't only

39:19

find bugs, it gives you a perfect

39:20

reproduction of every issue. To create

39:22

such a tool, the anticys needed to

39:24

invent new kinds of debugging tools as

39:26

well. For example, here's what's called

39:27

a bug probability graph. The xaxis is

39:30

virtual time and the yaxis is

39:32

probability. As anticis runs a hostile

39:34

simulations. It plots time frames when

39:36

the bug probably increases which greatly

39:39

helps with finding the root cause of the

39:40

bugs and antithesis also has a log

39:42

visualizer. Vertical lines going down

39:45

represent events branching off from the

39:46

same state. And the purple dots are

39:48

where the bug happens. Antithesis is as

39:51

good as it gets in being able to ship

39:52

agent written code. It's what teams at

39:54

Jane Streetfly.io and the CD community

39:56

used to ship with full confidence. Head

39:58

to antithesis.com/primmatic

40:00

to learn more. And with this, let's get

40:02

back to Casey and how if you don't

40:04

design an architecture that can be

40:05

performance optimized later, you're just

40:07

rolling the dice. And we've seen so many

40:10

projects. I have an entire video where I

40:12

go through like look at all these blog

40:14

posts of people who like say we, you

40:16

know, it's Facebook, it's Uber, it's

40:18

everybody. They've got blog posts of we

40:20

had to rewrite this whole thing because

40:21

the performance was bad. If it was

40:22

always hotspots that made your

40:24

performance bad, you'd never have to

40:25

rewrite the whole thing. So, we know

40:27

that that doesn't work anymore. Uh why?

40:29

Because of the things I just said. I was

40:31

at Uber where I I was not making the

40:33

decision but the teams next to me were

40:34

and I saw or I I kind of understood why

40:37

they were making but typically and right

40:39

now it's happening with AI companies

40:40

oftent times it's like we chose this

40:42

technology which is Python and it's

40:44

single threaded and it made sense at the

40:46

time on the web server but now we're big

40:48

and this happened at Uber it was it was

40:50

Python and NodeJS and then they went to

40:52

go and Java on the back end and now with

40:55

AI companies it was Python open AI and

40:57

Tropic are both going through this right

40:59

now uh They're both either public about

41:01

it or I I've written with Antropic. They

41:03

they they share with me with with me,

41:05

but I I put it out there. They used

41:07

Python because data scientists or AI or

41:09

machine learning engineers knew Python.

41:11

They put on a bunch of web servers. They

41:13

had their API run on it. Initially, they

41:14

just, you know, scales horizontally, but

41:16

now they're like, well, if we move move

41:17

over to Rust, they right now they're

41:20

choosing Rust or or Go, but I think it's

41:21

Rust. Well, we can actually have

41:23

multi-threaded and the same machine can

41:26

actually handle more connections. So,

41:28

cool. I came across a lot of that

41:30

because I think that's easy and safe to

41:32

communicate because it doesn't look bad

41:34

on you. But you're right, a lot of times

41:37

I don't think on engineering blog post

41:38

you'll get the real reason that these

41:41

companies put out there like when it's

41:43

kind of a very kind of you know easy to

41:45

own mistake or not mistake but just the

41:48

decision which made sense. they'll tell

41:49

you. But if it's something that was an

41:51

oversight, you're not really going to

41:53

get that on a on a public facing

41:54

engineering blog post, except for maybe

41:56

some startups who are really there. But

41:58

don't forget like a lot of those blog

42:00

posts are going to help someone get

42:01

promoted or get recognized and they will

42:04

always be way more positive in

42:06

especially when there's a content writer

42:07

team which large companies do have. So

42:10

it's it's not quite PR but it's

42:12

somewhere midway in between. And I mean,

42:15

yes. And also, I would just point out

42:17

the fact that like the fact that these

42:20

things are happening though is all we

42:23

really need to know for the signal,

42:25

right? Because in general, this should

42:27

not be happening. If the the ideas about

42:30

activation were true, you'd never have

42:31

to rewrite something in a language in a

42:33

different language unless you just

42:36

preferred that language. It would just

42:37

the story would just be we rewrote it in

42:40

this language because we wanted to use

42:41

this new language. would never be um or

42:43

for Rust it might be just memory safety.

42:45

We see those blog posts, right? It's

42:46

like why did we write into Rust? It

42:48

wasn't performance. It was just we

42:49

wanted the memory safety or something

42:50

like that.

42:50

>> If I'm a software engineer, programmer

42:54

and I'd like to just get better at

42:57

writing performance code, I'm

42:59

interested, you know, maybe after this

43:01

podcast or or looking into some of the

43:03

things that you did. What is a learning

43:05

path you would follow outside of your

43:07

substack where you cover a lot of these

43:08

things, but what are areas that you

43:10

think are kind of like you need to

43:11

understand these things to like get

43:13

better at writing performant code? I

43:16

think it's actually very simple and

43:19

perhaps a little bit counterintuitive.

43:22

So, I'll start with the uh the very good

43:25

news about learning to write uh

43:28

performance software. The good news is

43:31

that optimization of the kind that we

43:35

sort of talked about, the like hotspot

43:36

kind where it's like somebody's going to

43:39

go in here, maybe they're going to even

43:41

rewrite this routine in handcoded

43:42

assembly or something crazy like this,

43:44

right?

43:46

That's very rarely necessary these days.

43:49

One of the reasons that you don't see

43:52

hotspot optimization as a thing that

43:54

really matters that much anymore and one

43:56

of the reasons I advise that

43:58

architecture and and not making bad

43:59

decisions is much more important is

44:01

because a lot of libraries already have

44:04

been optimized for you that you might

44:05

use. CPUs are incredibly good at taking

44:08

bad code and running it quickly and so

44:10

on. So, typically when we're talking

44:12

about the causes of performance, uh,

44:14

negative performance that aren't

44:16

squeezing every last little thing out of

44:17

the hardware, but rather just making

44:19

sure this thing isn't running like a

44:21

hundred times slower than it should be,

44:23

usually it's more just about having an

44:25

awareness again of what the computer

44:28

should be able to do and making sure

44:30

you're making uh software architecture

44:32

choices that allow it to do that. And if

44:34

you do those things, you will generally

44:37

be within, you know, 2x or something,

44:40

which is 50x better than the people who

44:43

are 100x [laughter] away, right? So the

44:44

good news is in order to write software

44:46

that's much better than a lot of the

44:48

software you use today, you don't have

44:49

to know that much. So what do you have

44:52

to know? What I argue and what we focus

44:54

on the substack is I think you just have

44:56

to go through the experience once of

44:59

learning reading the assembly language

45:02

seeing how the CPU works seeing the

45:04

difference seeing why Python is slow

45:07

which we show on the sub. So one of the

45:08

first things I show is uh I walk you

45:10

through the assembly language necessary

45:12

to execute uh A plus B in Python and

45:15

it's so vast that you know I have to

45:17

skip most of it. It's it's massive right

45:19

it's like this huge and whereas you know

45:21

if you have the equivalent function in C

45:23

it's one instruction add right so you

45:27

know uh understanding basic things like

45:29

that if you go through learn to read

45:31

assembly language learn to look at some

45:33

code learn to do some CPU timings and

45:36

you just have that experience just spend

45:38

you know uh a month or two of nights or

45:41

whatever you want just understanding

45:44

some performance stuff and going through

45:46

a few examples where you play with it

45:48

and you see the difference

45:49

>> and and just so I understand you're

45:51

you're saying do this not because let's

45:55

say you're doing iOS development or or

45:57

web development read what React like you

45:59

you will not look at the assembly that

46:03

the React does but if you do this on a

46:05

project you will be able to

46:07

conceptualize what is likely happening

46:09

what the layers are and you you might be

46:12

able to decide like do I want this layer

46:14

or do I want to use let's say WebGL If

46:17

you're a React engineer, you probably

46:19

haven't touched it. But again, you can

46:20

skip a bunch of those things and it

46:22

comes to trade-offs with

46:23

maintainability, yada yada, but that now

46:25

you you you will know like kind of what

46:28

you say by keeping this layer or not

46:30

keeping it and so on. Is it do I get

46:32

that right?

46:33

>> Essentially, yes. And like uh you know

46:35

the simplest example is the Python

46:36

example. Most people have never

46:39

internalized the fact that it takes, you

46:41

know, maybe on the order of a hundred

46:43

more uh CPU instructions to do an ad in

46:45

Python than it does to do it uh in an

46:48

equivalent language like C for the same

46:49

piece of text, just A plus B compiled in

46:52

two different, you know, in two

46:53

different languages, right? And so just

46:55

understanding even just that is enough

46:58

for you to kind of go like, "Oh, okay.

47:00

A, now I kind of understand why if I'm

47:03

using Python, I kind of have to use

47:05

libraries to do things." And those

47:07

libraries were written in C. Because

47:08

it's like if I'm ever going to do any

47:10

operations on a on a large number of

47:12

things, I can't do it in this language

47:14

because the amplification factor is so

47:17

high on each operation that it just, you

47:20

know, kills the performance immediately.

47:21

whereas these other languages don't have

47:22

that, right? And so understanding those

47:26

orders of magnitude and what's actually

47:28

going on, I think that allows the

47:30

programmer to know, okay, if I think

47:33

through what I'm doing right now, can I

47:35

afford the super slowdown that I'm going

47:38

to take? And usually I don't think you

47:41

have to be a performance expert to make

47:43

that decision. You could usually know

47:44

like, okay, is this a part of the code

47:46

that can afford to be 100 times slower

47:48

than it should be or not? Right? And uh

47:51

you know most people can I think make

47:53

that decision fairly logically. And if

47:54

it's not then now you know like oh okay

47:56

if I'm in Python then what I got to do

47:58

is either I got to go find a library

48:00

call that will do these sorts of things

48:02

and structure around how that library

48:04

works or I should maybe get something

48:07

like Syon or something where I can do

48:09

compiled stuff inside my Python and make

48:13

my uh code work around calls out to that

48:16

kind of code. You know, you now have the

48:18

tools you need upfront to make sure that

48:21

when you write the program, you've put

48:22

the parts that needed this and you've

48:25

structured the code in such a way that

48:27

you are only paying the 100x on things

48:29

that you know are very infrequent or

48:32

happen like only uh you know once per

48:34

every so often things like that right

48:36

that's I think the biggest thing is just

48:38

the knowledge and once you know you can

48:41

start to make much better decisions in

48:43

any language because it doesn't take you

48:45

very long you know a simple le search or

48:47

you know asking an AI or whatever is the

48:50

common practice that you're going to do.

48:52

A simple bit of that once you know what

48:55

you're asking for will get you this

48:57

information back very quickly. Right?

49:00

You just have to know that you should

49:01

have been thinking about it.

49:02

>> Now, as a software, you mentioned it's

49:05

good to understand how the CPU works. As

49:06

a software engineer who is not a games

49:08

developer, I'm not doing low-level

49:10

stuff. What does that give me? because

49:13

for the most part even in academia or or

49:17

in computer science you know there is

49:18

some level of of some basic CPU theory

49:22

taught but usually we just kind of we

49:24

stop at the code okay maybe you look at

49:27

the assembly but you rarely go further

49:28

than that the folks who you know you've

49:32

you've taught and they they learn these

49:34

things what do you see them get out of

49:37

this that they wouldn't otherwise

49:39

>> so you're talking about specifically the

49:41

knowing the CPU part

49:42

>> knowing about the CPU, knowing about the

49:44

details about a CP because because you

49:45

mentioned that that's also part of it,

49:46

right? It's not necessarily just

49:48

stopping at assembly.

49:49

>> So the reason for that is more the other

49:52

way around the the reason to learn the

49:54

assembly language is so that you know

49:56

what the CPU is doing. So it's the CPU

49:58

part that's actually important and the

50:00

part that's important about it is that

50:03

the CPU is basically you can think of it

50:05

as a little machine whose internal

50:09

gearings we are not privy to because for

50:12

the CPUs that we care about. So you know

50:14

an M series CPU in a Mac a Zen core CPU

50:18

in a server uh or in a laptop or an

50:21

Intel you know core series those sorts

50:23

of things. These CPUs are not documented

50:26

at the level where you're going to be

50:28

thinking about how each little

50:29

individual part works. And to that end,

50:32

it's unclear that you would have time to

50:33

do so anyway because these are massive,

50:35

very complicated machines that we're

50:37

talking about, right? But from a high

50:39

level, from a more blackbox perspective,

50:41

they are machines that we can think of

50:44

in relatively straightforward ways once

50:46

we know kind of what their core

50:48

instructions are that they tend to

50:50

execute.

50:52

And they break down into a couple

50:54

different categories. There's how does

50:56

data move into and out of a core. And

51:00

this is basically how like load store

51:01

units work, how the cache levels work,

51:04

L1, L2, L3. Some we have like we have L0

51:07

now sometimes things like this. How does

51:10

that work and why? What is the

51:12

granularity of it? What is the policy?

51:14

How does the CPU go about actually

51:16

working with those things? Understanding

51:18

that part of the machine is crucial

51:20

because when you're working with a lot

51:21

of data, the the difference can be

51:23

massive if you structure it in one way

51:26

versus structuring another way, right?

51:27

Again, architectural decisions that have

51:29

nothing to do with hotspots, they're how

51:31

all the data is laid out and what the

51:32

access pattern is, right? Things that

51:33

are very hard to change sometimes. So,

51:36

that's one part of the machine you want

51:37

to understand. Another part of the

51:39

machine you want to understand is how

51:40

the instructions flow through it. And

51:43

you, you know, a lot of people have

51:44

heard about like branch misprediction or

51:46

things like this. eye cache misses.

51:48

There's words that you might hear, but

51:49

you're not really sure what they mean.

51:51

They're all actually pretty simple to

51:52

conceptualize. Sometimes they're they're

51:53

harder to pin down exactly how they work

51:55

because branch predictors are, you know,

51:57

getting more and more complicated and so

51:58

on, but you can still categorize the

52:00

behavior of them and understand how code

52:02

flows through it and when you might care

52:03

and when you won't. And then finally,

52:05

there's the execution unit scheduling

52:07

part, which is about knowing what's the

52:09

raw sort of throughput for any

52:11

particular type of operation.

52:12

floatingoint multiplies, integer

52:14

additions, division, whatever it is that

52:16

you might want to know. Right? Once you

52:18

learn a little bit of assembly language,

52:19

you understand what it's reading, you

52:21

understand how it turns those assembly

52:23

language instructions into micro

52:25

opterations, which it actually does, and

52:27

how they get distributed through that

52:28

machine. That flowchart that they put

52:30

like basically up on the we've announced

52:32

the new Zen core, that flowchart, you

52:35

can look at it and go, I know the

52:37

performance of this machine roughly,

52:39

right? Not exactly because like I said

52:42

there's all these little edge cases that

52:43

if you really want to be a crazy

52:44

optimizer which again I don't really

52:46

advocate people do. I don't think it's

52:48

important that they be like crazy hyper

52:50

optimizers. If you like to do it great

52:52

it's a lot of fun but it's not the

52:53

important part. Just look at the C like

52:56

okay I see what the CPU should be

52:57

getting in terms of like what I could do

52:59

with this size data load that size data

53:01

load. This is what I could probably get

53:03

out of it for if I was doing a bunch of

53:04

like how to do a bunch of like math ops

53:06

on it you know. And and I think that's

53:08

that's just something that should be

53:09

kind of par for the cars to software

53:11

engineering. You go to school for four

53:12

years to learn this. There's no reason

53:14

you can't learn this in a few months.

53:16

It's not that hard.

53:17

>> Yeah. Plus, I guess just from a

53:19

craftsmanship perspective, like we

53:20

should know our tools. We should know

53:22

the machines that we're programming.

53:23

Obviously, we know that our code will be

53:25

if you're doing web, it'll be running on

53:26

all these different things or if it's a

53:28

if it's mobile on all these different

53:31

phones, but from a conceptual point of

53:33

view, like we should be able to know

53:34

what's going on. So I I feel there's a

53:36

bit of a pride as well. Like if if

53:37

nothing else, you would learn a bunch of

53:39

stuff. Like I I know some of it, but I'm

53:41

now getting motivation to learn more

53:43

about it.

53:43

>> I do think there's a craftsmanship

53:45

angle. I think there's a a large number

53:46

of people who maybe don't feel fulfilled

53:50

when they I' I've certainly heard from

53:51

lots of people who when they write

53:53

something and it's just kind of this

53:54

amorphous highle thing, they they don't

53:56

get as much satisfaction out of it. And

53:58

then when they learn how they can look

54:00

more deeply at what's going on, they

54:02

feel much more satisfied. even if they

54:05

didn't change what level they were

54:06

programming at, they feel much more

54:08

satisfied that now they know what

54:09

they're doing, right? And it's like, oh,

54:10

I see and I understand why this thing

54:13

was happening this way and this thing

54:14

was happening that way, that's very

54:15

satisfying, right? So there there's an

54:17

aspect of that. I also want to emphasize

54:19

another part which is that it's a

54:20

percentages game. If we convinced enough

54:24

library maintainers that this stuff was

54:26

important and the libraries all get a

54:29

lot faster, all of a sudden all the

54:31

people using the libraries code gets a

54:32

lot faster and so on and so forth. If

54:34

the APIs start changing to make it

54:36

easier to optimize the libraries because

54:38

people now thought that through, right?

54:40

Like it's infectious. The more people

54:41

are doing performance, the less people

54:44

need to do performance, [laughter] if

54:45

that makes it kind of paradoxical,

54:47

right? Well, plus plus I I I I do think

54:49

that right now there's still an edge in

54:51

in just being performant again and you

54:53

mentioned but there are categories of

54:54

software that is just winning by being

54:56

much faster and to do that you need to

54:59

do this and if you know how to do this

55:01

maybe you're going to spot opportunities

55:02

as a software engineer maybe right now

55:05

you're not as happy in your position but

55:06

maybe start something or do a side

55:08

project that turned into a full-time

55:09

thing and so on and so forth. So like I

55:11

feel there's like and worst case you

55:13

just learn like net new knowledge which

55:15

will probably not be as outdated with AI

55:18

which we we'll get into later but this

55:19

stuff it it feels it just feels very

55:21

interesting right like kind of it moves

55:23

your brain. It does and thankfully like

55:26

uh it's also not that hard to update

55:29

your knowledge because again you get

55:31

these presentations that that the CPU

55:33

companies give and they're like here's

55:34

the changes we made. So you kind of are

55:36

aware every time a new thing gets you

55:38

know there's little tiny things that

55:40

creep in that you don't that you know

55:42

but again there's people out there who

55:44

are running lots of microbenchmarks that

55:46

you will find out about and they often

55:47

uncover these for you as well right uh

55:49

so so I I wanted to talk about games

55:51

you've been you've built games for like

55:54

decades at at this point can you give an

55:58

overview for those of us who are not in

56:00

the games industry how is a game

56:02

typically built from the games that you

56:05

know of that you've observed or or you

56:07

worked on especially trying to compare

56:10

for you know like in typical SAS or

56:12

distributed system or or something we're

56:14

building a a website or service is kind

56:16

of you plan this stuff you you know

56:18

we'll we'll do an estimate we'll build

56:19

it in a few months or a few weeks we

56:21

deploy it and then we monitor it and

56:23

then we keep tweaking it and then you

56:25

know fast forward 5 years later it's now

56:27

this like gigantic thing with

56:28

microservices but but it keeps evolving

56:30

right like it's we do this like a lot of

56:32

prototyping thing for games It's pretty

56:34

obvious right from the get-go as we're

56:36

talking like there there will be a

56:38

launch but can you when you're inside or

56:41

when you when you join a game studio

56:43

like what would you observe there in

56:45

terms of what the process is like and

56:47

how it's different or or how it feels

56:48

weird compared to like this I guess I

56:50

don't know traditional software SAS

56:52

software whatever development that is.

56:53

So, I guess what what I would say is

56:55

unfortunately I'm probably the wrong one

56:57

to ask because my knowledge is outdated

57:00

at this point because one of the things

57:03

that has happened to games recently is I

57:05

feel like they've moved closer. I don't

57:07

want to necessarily say entirely in

57:09

development practices but at least in

57:12

terms of the nature of the product has

57:16

changed somewhat dramatically to be more

57:19

like something like SAS where you know

57:23

if you take some of the most popular

57:25

things that are being in terms of

57:26

dollars let's say so I guess maybe

57:28

popular is kind of nec might be hard to

57:30

say specifically but let's just say

57:32

revenue generating so if we were to

57:34

measure the total games industry revenue

57:37

and you look at what are the largest

57:39

slices of that, you're seeing things

57:41

like Fortnite, like Roblox, like Grand

57:44

Theft Auto 5 online, etc., etc.,

57:47

Minecraft.

57:48

These things are starting to look a lot

57:51

more like an always on live service kind

57:55

of we ship incremental features to our

57:57

customers uh kinds of things. And so I

58:01

would actually say that, you know, I I'm

58:04

I'm the wrong one to ask about what that

58:06

actually looks like from the inside

58:08

because I haven't actually gone and

58:09

worked at one of those companies. I have

58:11

friends there, so I hear things, but I'm

58:13

not the right one to like give it an

58:14

accurate picture of it. But I just would

58:16

point out from my perspective, the game

58:19

industry practices look different today

58:21

than they did when I have a more

58:22

intimate sort of experience with what we

58:25

were actually building. But c can can we

58:27

talk about it when you were building

58:28

games which was you know 10 plus years

58:30

ago when I understand these were the

58:32

games where they were built they were

58:35

launched you know maybe they got a patch

58:37

or two and then they were kind of you

58:38

know the team moved on they were

58:39

disbanded. It was this time box thing

58:41

that was a lot of development a big

58:43

launch and and either it it was it went

58:46

big huge hit or you know a huge failure

58:49

right and then the studio goes bankrupt.

58:51

So how did that work? because I feel

58:53

that's a world where okay today a bunch

58:55

of games don't have those constraints

58:56

but it has a bunch of constraints and

58:58

I'm interested in in what worked in

59:01

those constraints. So in the early days

59:05

you didn't have licensable engines. So

59:08

up until sort of the point like nowadays

59:11

like this is why I say it's a lot

59:12

different now than it used to be. You

59:13

know nowadays you think of web

59:15

development like I'm going to go go grab

59:16

like a thing like react and I'm going to

59:18

make this thing or whatever. I'm going

59:19

to go grab an off-the-shelf database

59:21

thing, Postgres or Oracle or I don't

59:23

know like what would be the thing of

59:24

choice, right? But

59:25

>> by the way, just definitely Postgress

59:27

and not Oracle for most people.

59:28

>> Okay, sorry. Sorry. [laughter] Postgres,

59:30

uh I didn't want to slight anybody

59:31

there, so I apologize. So, okay,

59:33

definitely Postgres, sorry, Oracle.

59:35

Yeah.

59:35

>> Um, so you're going to go use some kind

59:37

of a variant of of one of these offshelf

59:39

databases and so on. That's more, like I

59:41

said, what people might be doing

59:42

nowadays, too. Like they'll grab the

59:43

Unreal Engine. They're not going to

59:44

develop an engine on their own. They'll

59:46

grab backend server stuff from people.

59:48

It might even be some Postgres in there,

59:50

right? Like, who knows? In the earlier

59:52

days, none of this stuff existed for

59:53

games. I actually worked, like I said,

59:55

in middleware at the time. So, I was

59:57

actually sort of one of the people who

59:59

was working at the time on maybe

60:01

changing that a little, like producing

60:03

code that would get reused throughout

60:04

games, which was actually fairly rare.

60:06

>> And and and so and so back in the day,

60:08

every game built their own rendering

60:09

engine, for example.

60:10

>> Correct. And so,

60:12

>> yeah. Yeah. Yeah. Uh and so really early

60:15

on, right, if you if you rewind the

60:17

clock far enough, uh then yeah, the the

60:20

degree to which people were reusing code

60:24

for their thing for like their rendering

60:25

engine, it'd be like cuz I got some code

60:28

from like Dave or whatever who was or we

60:31

were both at Atari and somebody wrote

60:33

this good routine so we used it, right?

60:35

There was that kind of thing, but there

60:37

wasn't like this sort of set uh engine.

60:39

And the time when that sort of maybe you

60:42

could say first started happening a

60:44

little more widespread was with things

60:46

like what ID Software did where they

60:49

sort of started having like oh you know

60:50

like someone's going to build something

60:52

with the Doom engine or someone's going

60:53

to build something with the Quake

60:54

engine. There was also the uh the build

60:57

engine at the time uh made by Ken

60:58

Silverman and some things like that. So

61:00

there were there were some early cases

61:02

where a few people would make a game,

61:04

but they were making a game very much

61:06

like that. Like if we did the Doom

61:07

engine, we're going to make a game very

61:08

much like Doom. So it really was the

61:10

case that for most games, people were

61:12

rebuilding most of the things from

61:14

scratch, at least for their studio. And

61:16

studios often their existing code base

61:19

was kind of part of the value of the

61:21

studio, too. Like if you are uh think

61:24

Blizzard and we just built Warcraft 1.

61:26

Well, rolling all of that knowledge and

61:29

code into Warcraft 2 is a huge advantage

61:31

for us because everybody else who wants

61:34

to build a competitor to Warcraft 1 has

61:36

to do all of that from scratch. They

61:38

have to make the path. They have to make

61:39

the level editing tools. They have to

61:41

make the rendering. They have to make

61:42

whatever. And so, you know, that was how

61:45

things were traditionally done.

61:47

>> No wonder the games industry is so

61:49

secretive compared to the rest of the

61:50

software engineering industry. Like

61:52

seriously,

61:53

>> used to be

61:54

>> used to be at least. Yeah. maybe now

61:55

it's changing

61:56

>> and so there were two really big risks

61:58

typically uh when you started a game

62:00

project in in those days one was the

62:03

engine risk would we be able to make

62:06

something that would be technically able

62:08

to do what we need to do for this game

62:12

and that risk comes in a lot of flavors

62:14

one will it happen at all two will it

62:17

happen fast enough for us to actually

62:20

reliably build the game on it right one

62:23

of the things I mean I don't how

62:25

detailed an answer you're looking for

62:26

for this question. So stop me if I'm

62:27

going down too many tangents, but one of

62:30

the things you also have to remember is

62:31

that at that time, and this is sort of

62:34

still true today, but at that time it

62:35

was very important, there was no way to

62:38

really buy something all that much

62:40

faster than what you had. There was not

62:42

a huge strata of PCs that you could, you

62:44

know, buy or anything like that. So the

62:46

rendering engine, there wasn't like a

62:48

way your level designers could like be

62:50

playing on a faster thing than the

62:52

consumer would have really. you can only

62:54

have the machine that you have now and

62:56

if this game comes out in a year that's

62:57

sort of roughly what the consumers might

62:59

have or a little bit but you know so

63:00

there are people who started doing

63:01

things like buying SGI workstations

63:03

because those were actually faster

63:05

enough right and and things like that is

63:07

what you know you kind of had to do uh

63:10

and so on so anyway so there was a huge

63:12

engine risk and some games just failed

63:14

because they couldn't produce a thing

63:15

that could technologically do what they

63:17

needed you saw houses who survived on

63:20

technological prowess you had ID

63:22

software that was kind unrivaled at

63:24

making those kind of first-person

63:25

engines. You had Bullfrog who had this

63:27

engine that the pseudo3 engine that they

63:29

did for like the racing games, Magic

63:30

Carpet, Dungeon Keeper, like they were

63:32

all based on this, you know, one core

63:34

tech and all the sorts of things.

63:36

There's that engine risk that was huge.

63:38

And how do you mitigate it? You didn't.

63:40

You were just grit, right? Because there

63:42

wasn't a way to buy one off the shelf.

63:44

So, you were just kind of uh gritting

63:45

your teeth. The other big risk, and this

63:47

one is still somewhat true today, but

63:49

it's just much less because you can

63:50

start, you could do prototyping early.

63:52

The risk is, is the game any good? Like,

63:54

what are we building? Is it interesting?

63:56

Is it fun? And when you think about this

63:58

problem of we can't even really run the

64:01

game as it will be cuz we're just

64:02

building this engine and we we don't

64:04

even really have a way to test the game

64:05

super well. And we can't really build

64:07

much of a final level because we don't

64:08

have level editing tools yet. Those are

64:10

just coming online. trying to guess what

64:12

you are actually going to be shipping in

64:14

terms of gameplay is incredibly hard and

64:16

there are games famous games um I want

64:19

to say like Thief the Dark Project a

64:21

very famous game looking glass game uh

64:24

it was formative in the stealth genre

64:26

launched a franchise which was Thief you

64:28

know I want to say uh everything I heard

64:30

from people on that team was that like

64:31

the final core gameplay only sort of

64:33

came together like right at the end

64:35

right and so the game just could have

64:38

been a lot more could have been polished

64:39

a lot more but it just the timing of

64:42

these things coming together was so hard

64:43

and so it really was an incredibly

64:46

different thing and nobody really had a

64:48

way um around it. Eventually, there was

64:51

sort of this push towards something.

64:53

Well, it was basically early vertical

64:54

slice prototyping where as games started

64:57

getting bigger and people were like, we

64:58

can't keep doing this, especially if

65:00

we're going to be putting millions of

65:01

dollars on like this is not like an

65:03

option, right? They started to move

65:04

toward this thing about look what we're

65:06

going to do is we're going to focus the

65:07

entire studio on building one vertical

65:10

gameplay slice as fast as we can, as

65:12

hacky as we can. Whatever we have to do,

65:15

do that. prove that that is engaging to

65:18

play and then start building out

65:21

everything else because we simply can't

65:23

afford to not know what that thing is

65:27

and then we can start building like

65:28

spreadsheets that'll schedule what are

65:30

the assets we need cuz now we actually

65:32

believe in the thing we can see it

65:34

running and it fills in all those

65:35

details right and that I believe you

65:37

know I'm not a game historian so take

65:40

what I'm saying with a huge grain of

65:41

salt that I believe was a pretty big

65:43

paradigm shift for the industry when

65:45

they started going okay we got to

65:46

actually know and it became much less

65:49

seat of the pants after that if you

65:50

will.

65:51

>> Now I'm interested in your observation.

65:52

I know you're not a game historian but

65:55

you were in the industry and you still

65:57

remain connected to it. What happened

65:59

when game engines became widespread.

66:03

they became not only licensable like you

66:06

we're talking about like Unreal Engine

66:07

for for larger studios but ones like

66:09

Unity or or God do which now amateurs

66:12

could also afford or I mean amateurs in

66:14

the sense that you're a college kid or

66:17

or you do some side project you can

66:19

already afford the license and you can

66:20

build stuff because now that risk is

66:22

gone for clearly the studio so that risk

66:24

is eliminated and it also I guess it now

66:26

opened up so much more people who who

66:30

can now have a shot at creating a game

66:32

because you no longer have to either

66:33

have this massive amount to license this

66:35

super expensive game engine. You no

66:38

longer have that risk. The only risk is

66:40

is it fun. What have you observed happen

66:43

in terms of both for the industry for

66:45

for for development pace those kind of

66:48

things. And the reason I'm asking

66:49

because I I I wonder if there's going to

66:51

be a parallel with AI where okay, you

66:53

know, like you needed you needed to have

66:54

an engineer who was

66:56

>> right. I I I feel games might give us a

66:58

bit of a a hint of what we might expect

67:01

at the broader industry.

67:02

>> So that is actually I would say that's a

67:04

brilliant analysis of the situation for

67:06

for not having lived through games and

67:08

for noticing that. Uh that's that's

67:10

impressive. I'll say that first. Uh and

67:12

I totally agree with that. I've I've

67:14

said to people in the past who have

67:16

asked about sort of AI impact on games

67:20

in that sense and I've sort of said as

67:23

much I've said like the licensable

67:25

engine thing kind of was our AI

67:28

transition already unfortunately and uh

67:31

I regret to inform you that the news is

67:34

not probably that positive. So there are

67:37

some uh definite positive things that

67:40

happen early on because as you say uh it

67:42

opens up the ability to make games to

67:44

people who could not have uh marshaled

67:47

the technical sort of uh the sort of the

67:50

technical staff necessary to produce a

67:52

competitive engine. And so giving them

67:55

the ability to make games is a pretty

67:58

important thing. and it allows a bunch

68:00

of people to make sort of some artistic

68:02

expressions that made they just wouldn't

68:04

have been able to do

68:06

early on. That tends to be a net

68:08

positive because you just have some more

68:10

games coming out. Maybe some of them

68:12

aren't that good, but ex, you know, some

68:14

of the existing games aren't that good.

68:15

That's not that different, but then you

68:16

get some really cool games coming from

68:18

some sources that just simply wouldn't

68:19

have been able to do it. Thumbs up.

68:22

problem is it rapidly kind of

68:25

accelerates into this kind of a nasty

68:28

scenario where you just have massive

68:31

numbers of releases. And I think at this

68:33

point we're at the point where I want to

68:36

say Steam games are in the like tens of

68:39

thousands or hundred thousand per year

68:42

or something like that. It's it's so

68:44

massive that there is no way that your

68:47

game will be organically noticed anymore

68:49

pretty much period. So essentially it's

68:52

this really nasty problem where you just

68:54

have the market flooded with products

68:58

and there you know it used to be that if

69:00

you made a quality game if it was fun

69:03

people would find it because there were

69:04

so few games that someone would play the

69:07

fun one and tell people about it and it

69:09

would get purchased. Right? Like word of

69:11

mouth or just exposure on a storefront

69:13

would be all you really needed to get,

69:16

you know, sort of the word out about a

69:17

game. You didn't need a huge marketing

69:19

budget or anything like that. Fast

69:20

forward to today where we have this sort

69:22

of massive influx of games. Again,

69:24

pre-AI, it's just because now the

69:27

barrier to entry is very low.

69:30

Uh, and you really need a strategy to

69:33

make sure your game gets found. Is it

69:36

possible that sometimes,

69:38

you know, a small indie game with no

69:40

marketing plan or nothing will get

69:42

discovered uh and become a huge hit?

69:45

Absolutely. It does still happen once in

69:48

a while. the chances that you will be

69:50

that game are like zero. So, you kind of

69:53

now need a marketing strategy, a real

69:56

marketing strategy, uh, and going into

70:01

the market for games without one and

70:03

expecting to sell any significant number

70:05

of copies, uh, above, you know, maybe a

70:08

few thousand at best is really unwise.

70:11

If you want to hit reasonable numbers of

70:13

sales of a game, you have to have an

70:15

idea of how people will find out about

70:18

this about this game.

70:20

>> So, if I'm getting this right, it sounds

70:22

like the game itself being good as table

70:24

stakes, but not enough on its own,

70:25

right? That distribution, marketing,

70:28

getting people to hear about the game is

70:29

much more of the differentiator because

70:31

there's just too many good games out

70:33

there and now they're easier to create.

70:36

>> I think that's exactly right. And uh and

70:39

that's just the unfortunate reality of

70:41

it now. Was that a good trade? I don't

70:43

know. Um but that's what happened. And

70:46

so that's where we are in the industry.

70:47

Now, there's this other thing that I

70:49

heard about which is how new games not

70:51

only compete with other new games, but

70:53

with old games as well, right? Like the

70:55

other day, I spent a few hours playing

70:56

Death Rally, which is a game from the

70:58

'9s. And every year, there's more and

71:01

more good games to play. They all take

71:03

away from the time that the new games

71:05

have.

71:05

>> Yes. And that uh problem will only get

71:08

worse because one of the things that the

71:10

game industry could rely on in the past

71:12

that is much harder to rely on now is

71:15

that older games would look dated

71:18

technologically in ways that consumers

71:21

cared about. And we have now kind of

71:23

also crossed the threshold where there

71:26

is a segment of the market where people

71:31

really do care about the latest like ray

71:33

trace lighting and all these sorts of

71:34

things. and you know more photorealistic

71:37

rendering or whatever it is. But a large

71:39

portion of the gaming market by revenue

71:42

doesn't really care what the game looked

71:44

like all that much uh in a sense that

71:47

whatever we're doing today is good

71:49

enough. So 10 years from now if the

71:52

games look much better for some reason

71:54

no one will really think of that as a

71:56

huge differentiation differentiator in

71:58

terms of sales. You go back to 1995 and

72:02

technological advances were a huge

72:04

differentiator in terms of sales. You

72:06

come out with something that you know

72:07

looks good that takes advantage of the

72:09

hardware of that day and boy did it look

72:11

cooler and feel more responsive and all

72:12

these other things as compared to

72:14

earlier titles, right? And so that's

72:17

also going to increase the degree to

72:19

which the thing that you're talking

72:20

about will happen. I can go play an

72:22

older game because it doesn't feel

72:24

obviously dated in an audiovisisual way.

72:26

I don't have to be an appreciator of

72:28

retro gaming to go play something from

72:31

2017. It just looks fine probably,

72:34

right? So, there's that. The other thing

72:36

that I'll just mention, which we kind of

72:38

already touched on, but that ties

72:39

directly into your point, is that also

72:42

live service is such a prominent thing

72:44

now. People are just logging on and

72:47

playing Fortnite for several hours or

72:49

something. that's also taking away from

72:52

the possible revenue that might be spent

72:54

on buying some indie game or some new

72:56

AAA game even. So you have these sort of

72:59

incumbents, people playing Minecraft,

73:01

spending their time playing Minecraft,

73:02

spending their time playing um League of

73:04

Legends or Dota and that's taking up a

73:06

huge amount of their time that's it's

73:08

it's zero sum, right? They can only they

73:11

can only spend their hours in certain

73:12

places just like Netflix or anywhere

73:14

else. They have to start thinking about,

73:15

you know, they're competing with

73:16

everyone else for entertainment hours.

73:18

Okay, so I need to ask you this. GTA 6,

73:22

how is that in 2026 at a time when we

73:25

have better tools than we have ever

73:26

before and we can build software and

73:28

games faster than before? Like how do

73:31

games take 10 plus years to develop? Is

73:33

this some kind of outlier or has AAA

73:36

game development taking many many years

73:38

just not changed at all? What do you

73:40

think is going on here? So from a

73:42

player's perspective, I can understand

73:44

why someone would look at it and go,

73:45

"Wow, Grand Theft Auto 6 has been in

73:47

development a long time. How does that

73:49

make sense?" Or, you know, something

73:50

like this. From a business perspective,

73:53

you have to understand that Grand Theft

73:54

Auto 6 is not a game that they are

73:56

selling to players who are going to play

73:58

the game. That's not what it is from a

74:01

product standpoint, right? What Grand

74:03

Theft Auto 6 is from a product

74:04

standpoint is a replacement of Grand

74:07

Theft Auto 5. Grand Theft Auto 5 at the

74:10

time was, if I'm not mistaken, by far

74:14

the most revenue generating

74:16

entertainment product in existence. The

74:20

online part of that game was generating

74:23

like billions of dollars. And like I

74:25

said, not a game industry historian, so

74:28

you know, take what I have to say with a

74:29

with a huge grain of salt, but Grand

74:31

Theft Auto 5 was kind of like Fortnite

74:33

before Fortnite, if you will. They were

74:36

a huge huge live service revenue

74:39

generating product. So from Rockstar or

74:43

Take 2's perspective, right, Grand Theft

74:46

Auto 6 is not just let's try to get out

74:49

the next Grand Theft Auto as soon as we

74:51

can cuz we'll make money selling that

74:53

title. It's a we are going to replace

74:56

the most profitable thing we have ever

74:58

built, which is still generating a ton

75:00

of money for us, with a new thing. And

75:03

you can better believe that they want to

75:05

make sure that they are going to do that

75:07

right because the last thing you want to

75:10

do is ship a new product that

75:14

cannibalizes something from your old

75:16

product and then is less revenue

75:17

generating. Right? So I'm sure that

75:20

their planning around Grand Theft Auto 6

75:22

is not just about trying to produce a

75:24

Grand Theft Auto that their fans will

75:26

love and will buy as the original

75:28

singleplayer gaming experience that it

75:30

was. I'm sure they care very deeply

75:32

about that. Just from a reputational and

75:34

from an artistic standpoint, I'm sure

75:36

there's a lot of people on those teams

75:37

who care about that. But from a business

75:39

standpoint, I am sure there's also been

75:41

a tremendous amount of thought and work

75:44

put into what does the live part look

75:47

like? And that's a huge undertaking, you

75:51

know, that I'm sure that they've been

75:53

planning for quite some time as well.

75:54

So, it's a massive massive thing that

75:56

they're doing here. How well will it

75:58

succeed? I have no idea. But it is not

76:00

just a new Grand Theft Auto is I guess

76:02

the way that I would look at it. Grand

76:03

Theft Auto 5, I think, was somewhat of a

76:05

surprise to them. I don't think they

76:07

knew it was going to generate that kind

76:10

of online revenue. I mean, maybe they

76:12

had hopes, but I don't think they knew

76:13

that it would be that kind of a massive

76:15

money maker that it was. And so, this is

76:19

the first product really where they know

76:21

they will have the audience. For Red

76:23

Dead Redemption, they kind of tried to

76:24

do Red Dead Redemption 2. They did a

76:26

similar thing where they tried to have

76:28

the online thing. It didn't I don't

76:29

think it hit nearly as big as Grand

76:30

Theft Auto. Grand Theft Auto 6 is the

76:32

first time they're shipping a true

76:35

update to what is their flagship. And

76:38

so, you know, it's equivalent to like a

76:41

relaunch of Google search or something

76:43

like that is what they are doing here.

76:45

Uh and so I I you know, I'm sure if I

76:48

was in charge of that project, I would

76:50

be sweating bullets. So, I'm sure that

76:52

they are putting a lot of thought into

76:54

it. Uh, and it's a very massive

76:55

undertaking, I'm sure.

76:56

>> I'd like to switch gears to

76:57

SoftwareCraft. You made this video

76:59

titled Clean Code Horrible Performance,

77:02

an essay/v video showing how Uncle Bob

77:05

Martin's polymorphism based refactoring

77:07

pattern runs about 1.5 to 15 times

77:11

slower than a plain table switch

77:13

version. Can we talk about the responses

77:15

to this piece?

77:17

>> Well, I guess I can put that in context.

77:18

So, that is sort of from that course on

77:21

the Substack. So, it kind of goes with a

77:23

bunch of other videos that are part of

77:24

like the Substack thing. I guess the

77:27

first thing I'd say is I feel like the

77:29

response to it was very positive. I was

77:32

kind of surprised. There are plenty of

77:34

people who didn't like it. Don't get me

77:35

wrong. It's controversial to be sure,

77:37

but I was surprised at just how many

77:39

people were enthusiastic about it as

77:41

well. But what I would say is it's

77:43

really I I don't really think it's

77:46

should be so controversial because

77:50

there's one thing where people want to

77:52

just use the term clean code to mean

77:54

code that they like or think think is

77:56

written properly and that's not

77:59

something you can argue against, right?

78:00

Because that's just, you know, I

78:02

probably have a version of what I think

78:03

is clean code and obviously I don't

78:06

think that's bad, right? Like it's it's

78:09

my idea of what good code looks like. So

78:10

if your idea of clean code is just

78:12

whatever you want it, you know, whatever

78:14

you happen to think are good programming

78:16

practices, I might agree with those

78:17

programming practice, I don't know. So

78:19

in this particular video, I was talking

78:20

specifically about the things that were

78:22

advocated that are like very specific

78:24

things that are said like don't have

78:26

functions over a particular length or

78:28

these sorts of things, right? Uh things

78:30

should not know the type at runtime or

78:32

whatever, right? There's all these like

78:33

kind of rules about it. Preferring

78:34

polymorphism always, right? If you look

78:37

at those things, they're kind of just

78:40

bad programming practices. I I don't

78:41

really know how else to say them. They

78:43

don't mesh well when you put them

78:46

together. In isolation, some of them

78:48

might be fine. So, for example, if you

78:50

really prefer lots of small functions,

78:53

that's actually fine if the compiler can

78:55

see all those functions and know that it

78:57

can safely inline them and collapse them

78:59

as necessary. This is a this is a part a

79:01

lot of people missed about the video I

79:03

guess because it's a pretty short video

79:04

so I didn't explain anything in detail

79:06

but a lot of redundant code happens when

79:09

you have lots of tiny you know little

79:11

these little tiny functions and if

79:13

they're all virtual functions in C++

79:15

let's say the compiler can't know for

79:16

sure which ones of them are being called

79:18

and so on even if you put things like

79:20

final in them there's all people have a

79:22

lot of weird beliefs about how the code

79:24

works you can just go do this testing

79:27

when you have lots of these little

79:28

functions if they're all like statically

79:31

defined and aren't virtual calls if

79:32

they're just known calls like or just

79:34

member functions. When I say static, I

79:36

kind of mean just known to the to the

79:37

translation unit, not external. The

79:39

compiler can put those together,

79:40

collapse all of the redundant code and

79:42

actually produce something reasonable

79:43

that will run pretty fast out of that.

79:45

It can also do things like widen the

79:48

code path if it needs to vectorize to

79:50

like run in SIMD and stuff. The compiler

79:52

has all these options to take what is

79:54

fundamentally not particularly great

79:56

code in terms of how you would want it

79:59

to run at runtime, but it might be able

80:00

to turn it into that because you know

80:02

compiler optimizing uh optimizing

80:04

compilers are pretty heroic these days

80:05

and the sorts of things they can do. If

80:08

instead you use all of these, you know,

80:10

things that were recommended, you

80:11

completely block out the compiler from a

80:13

being able to do those things. Because

80:15

if it can't tell what it's doing at

80:17

runtime, if it has to leave open the

80:19

possibility that you substituted in a

80:20

different class here or something like

80:22

that, then you end up in a situation

80:24

where the compiler can't do any of that

80:25

work. And people mistakenly think that

80:27

this is just because like virtual

80:29

function calls cost too much or

80:31

something like that. That's not what it

80:32

is. It's not the cost of the virtual

80:34

function call. We could talk about that

80:35

as a separate thing. Um because you you

80:38

can analyze that cost as well. It

80:40

doesn't have much to do with

80:42

specifically whether it's virtual or

80:43

not. has to do with a lot of things like

80:44

branch prediction and how much stuff is

80:45

getting pushed on the stack and whatever

80:46

else, right? But it's the cost of the

80:49

compiler not being able to do any

80:50

optimizations. That's the actual cost.

80:53

And that cost can be severe. I showed

80:55

only I think a pretty mild degra

80:58

degradation compared to what you would

81:00

actually see in production if you really

81:01

had a huge number of things doing this.

81:04

And I think it landed pretty well. It,

81:06

you know, it's a very widely viewed

81:07

video and a lot of people seem to really

81:09

like it. I thought it would be, you

81:11

know, probably even more controversial

81:12

than it was. So, I was pleased with

81:14

that. Um, but yeah, I mean, all that

81:16

stuff remains true today, I guess, is

81:18

what I'd say. And I think it's good for

81:20

people to hear because they need to hear

81:21

opposing viewpoints. I think you can

81:23

write code that is maintainable and easy

81:28

to read that doesn't follow those

81:31

principles in that way and that doesn't

81:33

have those problems. I don't think you

81:35

have to do those things. So I think it's

81:37

worth exploring other options that are

81:39

still maintainable, that are good code,

81:41

but that allow the compiler to do the

81:43

right thing.

81:44

>> What is your take on test-driven

81:45

development? You know, when you write

81:48

the test first, then you write the

81:50

business logic. you you you've talked a

81:51

little bit about about this as well

81:53

because it's it's a practice that used

81:55

to be super popular in the you know like

81:58

especially when you're building services

81:59

some of those things especially in the

82:00

2000s kind of got a little bit out out

82:03

of fashion and now it's unclear if it'll

82:05

come back or not with uh with agents or

82:07

not.

82:07

>> I don't have that much of a spicy take

82:09

on that one. My take is very pragmatic

82:11

which is that if you can identify tests

82:14

that will save time in total that's

82:18

usually what I try to emphasize. In

82:20

other words, if the amount of time it

82:22

takes to create and maintain the tests

82:24

will actually save us total development

82:27

time because they will identify bugs

82:28

that would be hard for us to find uh in

82:30

production or in or would be very costly

82:33

to get to if they uh got out then great.

82:36

And I've used them before like I talked

82:38

about working at RAD game tools. I had a

82:41

regression tester that I ran on like the

82:43

core libraries there that I had written

82:45

for the you know they're not really

82:46

called libraries but the core like

82:47

routines to make sure that you know

82:49

anything that I could be testing for our

82:51

customers I sort of was and so I think

82:54

there's good times for testing. I would

82:57

say the part that I don't like about

82:58

test-driven development is the

83:00

testdriven

83:02

part. I don't think development should

83:04

ever be driven by tests. I think tests

83:06

are a thing that you should be aware of.

83:09

You should know what your options are

83:11

for testing and you should make

83:12

intelligent engineering decisions about

83:15

tests. Now could that decision be that

83:18

for this particular project we are going

83:21

to drive it primarily from the tests?

83:23

Yes, that could be a decision that you

83:26

make. But you shouldn't really think of

83:30

development as something that is

83:32

primarily test-driven like by default

83:34

cuz that might be a very bad decision

83:36

for some other project where it just

83:38

ends up costing you more to have done it

83:40

that way. So like with most things I

83:42

would advocate for a pragmatic approach

83:44

to testing. You should understand the

83:47

cost of testing, the cost of developing,

83:50

maintaining the test, and the cost to

83:52

your codebase if it makes it harder to

83:53

change your codebase because tests have

83:55

to be rewritten and you therefore don't

83:56

make changes you should make. All of

83:58

that stuff should be in your brain and

84:01

you should make an intelligent decision

84:03

about what your testing strategy is. If

84:06

that decision intelligently made turns

84:08

out to be we are going to have a lot of

84:10

testing on this project, that may well

84:13

be a good decision. I don't think

84:14

there's an absolute thing you can say

84:17

about how many tests there should be.

84:19

Some projects probably shouldn't have

84:20

very much. Maybe some projects should

84:22

have a lot. And I think knowing which of

84:24

those you are doing is part of being a

84:26

good software engineer is I guess what I

84:28

would say.

84:29

>> You mentioned being a good software

84:30

engineer. But before we get into what is

84:32

a good software engineer, what does good

84:35

code mean to you specifically? So good

84:37

code to me usually means that you have

84:41

written a something that is as

84:44

straightforward

84:46

to what the machine actually needs to do

84:48

to solve the problem as it can be and

84:52

also hopefully that you have I guess

84:55

I'll say properly

84:58

identified ways of breaking it into

85:01

easily digestible pieces and named those

85:04

pieces in ways that are easy for someone

85:07

to understand especially yourself

85:08

because you are very likely to be

85:10

someone who's going to have to modify

85:11

it. So that's the way I tend to code. I

85:14

try to identify what do I actually need

85:16

the computer to do. I try to write as

85:18

simple as possible the thing that will

85:20

do that and then I try to put that in

85:23

terms that are you know I would say

85:26

least redundant. So you know I don't

85:28

want to see the you know the equation

85:30

for uklidian distance scattered

85:31

throughout my code. I want to have a

85:33

function that's like compute that

85:34

distance and I want to use it right. I

85:35

want I want it to then be nicely broken

85:38

into the pieces that it represents and I

85:40

want those pieces to be reassembbleable

85:43

properly by the compiler in a way that

85:44

will produce code that runs very

85:47

efficiently. Right? And so that's what

85:48

I'm usually trying to do when I'm trying

85:50

to program. And for me, I have never

85:55

really understood the sort of mentality

85:58

of there's a difference between code

86:01

that is like well architected by some

86:04

principles and code that runs quickly

86:07

because in my experience usually the

86:09

code that is architected properly is

86:11

also the code that runs quickly. And

86:13

yes, there is a point where if we decide

86:16

that something absolutely has to get as

86:19

close to theoretical maximum as it

86:22

possibly can, yes, we will start to make

86:25

that code harder to read and modify

86:28

because we are now like really over

86:30

specializing it for this piece of

86:32

hardware or whatever. That's true. But

86:35

that point is like, you know, way out on

86:37

the curve. It's not the common case.

86:40

Most of the time, assuming you just want

86:42

code that runs pretty pretty darn well

86:44

on most hardware, the simple readable

86:47

version of the code is actually very

86:49

fast. It's only once you think you need

86:51

to have 27 factories and 8,000

86:53

microservices and all these things

86:55

running that it starts to be this thing

86:58

that's like good architecture, but also

87:00

like hard to modify, hard to read, run

87:03

slowly, right? All these things. So I

87:05

tend to think of like good code there's

87:07

like this nice nexus of runs pretty

87:10

pretty darn well easy to read easy to

87:13

maintain isn't as close to theoretical

87:16

maximum as it could be but it's close

87:18

enough and the the paths towards

87:21

theoretical maximum have not been

87:22

foreclosed. We left the door open with

87:24

the way that we wrote it so that if

87:26

someone really needs to come along and

87:27

boost its performance it's set up to do

87:29

that. Right. And related to this, what

87:32

is a good software engineer to you? Is

87:35

it just someone who writes good code or

87:36

it goes beyond that?

87:38

>> I would say it really depends on the the

87:42

environment a little bit because I think

87:45

I've seen a lot of different kinds of

87:47

good software engineers. And so I would

87:49

liken it more to a uh you know, if you

87:52

want a sports analogy, you'd imagine

87:54

something more like a baseball team

87:56

where it's like what's a good baseball

87:58

player? Well, it's like are we talking

88:00

about a pitcher or a designated hitter,

88:03

right? Uh and it changes quite

88:04

dramatically. So, there might be some

88:06

things like, hey, if someone's pleasant

88:07

to work with uh and and you know,

88:10

doesn't you know, goof off all the time

88:12

and actually gets their work done. Those

88:13

are obviously things that we would say

88:15

are true of any software engineer, you

88:17

know, there are some general personality

88:19

traits that might be positive. But when

88:21

you're talking about things that are

88:22

more specific to just software

88:25

engineering and not just being a good

88:26

employee or something like that, I would

88:28

say I've seen a couple different kinds.

88:30

I've seen people who are like the

88:31

utility infielder. There are people who

88:33

just like they can identify and go and

88:36

try to fix a problem and succeed. Even

88:38

if the codebase is kind of wacky and out

88:40

there, they're good at getting the lay

88:42

of the land very quickly of identifying

88:44

something that's going on. and they're

88:46

not afraid to go in and like, okay, this

88:48

is kind of this code base is kind of

88:49

ugly here. It's okay. I'm going to patch

88:51

around. I'm going to do what I need to

88:52

do and get things done. That's a great

88:54

engineer to have around. I've also seen

88:56

great engineers who are the exact

88:58

opposite of that. They are just like, I

89:01

take this one particular problem that we

89:04

have and eight months later, I have

89:07

ground out every last thing there is to

89:11

know about this. and some sometimes to

89:14

the point of like producing new

89:15

algorithms that no one's even known

89:17

before, right? That are like these, you

89:18

know, breakthrough things, right? And

89:20

that's a great software engineer to have

89:22

on a project if you happen if you're

89:23

going to be having that kind of thing.

89:25

And so I've seen a lot of different

89:27

people that I would consider great

89:28

software engineers and they aren't all

89:30

the same person, right? So I think that

89:33

it's kind of important if you're asking

89:35

it from the standpoint of like, hey, you

89:38

need to put together a team to go build

89:40

this project. What's a great software

89:41

engineer? I would say the best advice

89:43

you could give someone in that position

89:45

is think about the roles. Think about

89:48

what kinds [snorts] of roles there are

89:50

going to be here and don't think great

89:52

software engineer. Think great that

89:55

role, right? Who is going to be a great

89:57

pitcher? Who's going to be a great first

89:58

baseman? Who's going to be a great

89:59

outfielder? Who's going to be a great

90:00

this that the other thing? Great third

90:02

base coach, whatever it is, right? And

90:04

that's what you're trying to put

90:05

together if you're trying to build a

90:07

team to me.

90:07

>> Yeah. So, like it's just not one

90:09

sizefits-all. But I I still want to push

90:11

you a little bit like what are things

90:13

that are you think are non-negotiable

90:15

for someone to be a great software

90:16

engineer? I you know we we talked about

90:18

the things that we talked about which is

90:20

a recurring theme with you is just going

90:23

deeper and deeper and understanding the

90:25

next and next layer you know like

90:26

understand if if you're doing web

90:28

development understand react once you

90:30

understand react understand what's going

90:32

on in the DOM go all the way to assembly

90:34

once you've done there understand how

90:36

the CPU is doing operations and branch

90:39

predictions and some of those things

90:40

like to me that's a skill of like

90:43

curiosity driving deeper crafts whatever

90:46

you call you know, there are different

90:47

ways we could do it. But along these

90:49

lines, what are those traits that you

90:51

think no matter, you know, what kind of

90:52

role we're talking about, but if you

90:54

think back of of some of the different

90:56

types of roles that you work with, like

90:58

do you see some overlap that that they

91:00

all had something? I would say that it's

91:03

pretty unusual, I guess, that I can't

91:06

think of someone I would think of as a

91:08

great software engineer who like didn't

91:11

know how to like read assembly or

91:13

something. That is true. It might be

91:15

that having that curiosity about how

91:17

things work and and knowing at some

91:18

level what's going on is kind of maybe

91:22

something that's going to be very common

91:23

to a great software engineer. But I

91:26

would just underscore the point. The

91:27

degree to which they are employing that

91:29

knowledge may vary quite a bit. For some

91:31

of them that may be their bread and

91:32

butter and they're doing that all day.

91:34

For others it's just really a thing

91:36

where because they know how a computer

91:39

works, they're not making those stupid

91:41

architectural decisions that come back

91:42

to bite us later. Right? And that's

91:44

great, but they may not really be doing

91:46

all that much actually at that kind of

91:49

level or or thinking about at that

91:50

level. They're just going like, "Yeah, I

91:52

know we got to kind of push, okay, this

91:53

stuff's going to have to be done in

91:54

batch because I just kind of know that

91:56

that's, you know, how the machine's

91:57

going to have to handle it. So, we'll,

91:58

you know, I'll make sure I I write the

92:00

code that way or whatever." Yes. But, so

92:03

there's a little bit of that. The other

92:04

thing that I would uh say maybe is

92:07

actually like not being dogmatic about

92:11

things that they haven't actually

92:12

themselves proved out is probably a huge

92:14

one. I find there's a lot of like

92:16

received programming wisdom that's just

92:18

nonsense. Like clearly no one's ever

92:20

tested it and if they did they would

92:21

have found out that it's that there's no

92:23

actual basis for it. Doesn't necessarily

92:25

mean it's false. It's just there's no

92:26

like there's no actual tangible way you

92:28

can demonstrate. And sometimes it is

92:30

like you could demonstrate that there

92:31

are actual concrete downsides to this

92:35

received wisdom, right? And so in order

92:37

for it to be received wisdom, you should

92:38

have to be able to at least demonstrate

92:39

concrete upsides, which often times

92:41

cannot be done. So I would say people

92:43

who actually focus on what works in

92:47

practice is a huge plus and you could

92:51

apply that anywhere into anything,

92:53

right? Not just saying, "Oh, the flavor

92:56

of the month is that we're writing

92:57

everything with classes and virtual

92:59

functions and hierarchies or whatever."

93:00

It's like, did you actually determine

93:02

that that results in less code or that

93:03

the code actually is mermaid? Like, did

93:04

we do any testing to figure out if this

93:06

is helping us rather than hurting us?

93:08

And the answer oftentimes is no or if if

93:10

it was at all. It was extremely shoddily

93:12

done and you would not take those uh

93:14

results as conclusive in any way. And so

93:16

it's like being more skeptical about

93:18

coding practices and actually trying to

93:20

focus on what is working in practice and

93:23

what we can demonstrate and measure in

93:25

some kind of a uh repeatable way is I

93:28

think a really great thing for a

93:30

software engineer to have as well. So

93:31

people who don't tend to fall prey to

93:33

that just like I watch some presentation

93:35

and someone at Google says always call

93:37

me MEMS set or never use if statements

93:39

or whatever it is like if that's the

93:41

level that you're thinking at then I

93:43

probably am not going to put you in that

93:44

category of of really good software

93:46

engineer because that's not how it

93:47

works.

93:48

>> Plus it's not that hard to try these

93:50

things out or in or set up or or do run

93:53

an experiment. Now, the the final topic

93:56

I wanted to touch on, which I

93:58

deliberately didn't get into until now,

94:00

is AI and how it's changing your work.

94:03

And I'd like to start with that, like in

94:06

in the work that you're doing at Molly

94:08

Rocket with this this project that is un

94:10

yet unreleased, how are you using AI

94:14

tools, if you're using them at all?

94:16

>> We are not using them at all.

94:18

>> So, you're you're you're doing it just

94:20

like before. You're writing your your

94:21

code. What made you decide to to take

94:24

this path?

94:25

>> Well, we're a little bit different

94:27

obviously uh in the sense for two

94:29

reasons. One um is that we you like I

94:33

said we are kind of we have like sort of

94:35

two projects here and the substack is

94:38

our primary focus and this other one is

94:41

a thing that we're doing because we want

94:42

to do it. And when you think about that

94:44

perspective it's like well why did you

94:46

want to do it? Well, the reason that I

94:48

want to program like things in a game is

94:51

because I want to program them.

94:53

>> If I just wanted an AI to program them,

94:55

I probably, you know, first of all, we'd

94:57

probably just go use a licensed engine,

94:58

right? Like I wouldn't I wouldn't even

95:00

bother asking AI to do it. I'd just go

95:02

get the Unreal [laughter]

95:03

Engine,

95:04

>> right? Or something like that and so on.

95:06

So, uh I think a little bit of that

95:08

decision is probably not that relevant

95:09

to your audience because it's more about

95:11

what do you want to do? Like what why

95:13

are you spending this time, right? It's

95:15

a philosophical question, not a

95:16

productivity question. So, it's not like

95:18

I evaluated it and said, I don't think

95:20

this will save us time or I or you know,

95:23

or I have questions about the

95:24

copyrightability of it or the ethics of

95:26

it or all the sorts of things that you

95:28

could rightfully evaluate AI on. It

95:30

wasn't necessarily that. It's more just

95:33

like this does not further the goals of

95:35

the project to use it. So, it kind of

95:37

was a non-issue at that point. Right.

95:39

stepping out a little bit more uh to a

95:42

broader philosophical framework about

95:44

AI. I guess what I would also say is I

95:46

think that if you regardless of what you

95:50

think will happen with AI in the future

95:52

because obviously we don't really have

95:54

any way to predict what it will look

95:56

like 10 years from now. It's anyone's

95:57

guess really. I think there will

96:00

probably also be at some point point a

96:04

notion of like traditional handcrafting

96:07

that will come into play because we've

96:09

seen this in most other times when you

96:11

automate something. So, if you automate

96:14

making furniture and you have like IKEA

96:16

or whatever, that doesn't mean that

96:18

there isn't some weird guy down in the

96:21

industrial district of your city making

96:23

crazy wood tables with iron and welding

96:25

and something. And that that's just a

96:28

thing that people are still doing and

96:30

some people want that table. I don't

96:32

necessarily have an explanation for it

96:34

and I'm not trying to argue that it has

96:36

more or less value, but it's just

96:39

something that happens, right? And so if

96:41

I imagine what I want, what I love about

96:44

computers and what I want to do with

96:46

computers, and you asked me, move that

96:49

into some other context, which of these

96:51

people would you be? My answer is

96:53

always, I'd be the organic farming guy.

96:55

I'd be the guy who's making the weird

96:57

table in the industrial district. I have

96:59

no interest in managing a division at

97:02

IKEA. I literally couldn't care less

97:04

about that, right? And so I think for me

97:07

another reason why I'm not that

97:09

interested in pursuing AI is because I

97:13

would like to be part of whatever the

97:16

set of people are who are going to keep

97:18

this traditional craft alive just cuz

97:21

that's something humans do. Not because

97:24

we're trying to say that that's the

97:25

right business case, right? If that

97:27

makes sense.

97:28

>> Yeah. And and at this point there's a

97:29

bit of a tradition if you will even if

97:31

we assume that these machines will do as

97:33

good or better than cumizit for like

97:35

what 60 plus years we've we've only

97:39

exclusively handwritten software because

97:41

that's how it got done right like a a

97:44

lot of us anyone who started coding

97:46

before 2023 or the end of 2022 or

97:48

probably honestly 2024 when these things

97:51

have gotten like decently good you just

97:52

wrote it by hand a lot of it or tap

97:55

complete still counts.

97:56

>> Yeah. I and and I guess I would say like

97:58

again it's just you know why why do that

98:01

right is the question it's like I don't

98:03

know why humans do that humans do that

98:05

because it's something humans do right

98:06

humans like to do things themselves

98:08

sometimes you know people can buy a hat

98:13

they can buy a a wool hat trivially or

98:15

they can buy whatever and then someone's

98:17

out there knitting a hat right now

98:19

that's just it's just something humans

98:21

do they like to make things by hand

98:23

sometimes and at varying levels of

98:25

handmadeness You know, there's some

98:27

people just buy the the wool or whatever

98:30

or buy the pre-made yard. Some people

98:31

raise the the sheep or whatever and

98:33

shear it, right? Like you can go

98:35

arbitrarily far down. You could find

98:36

somebody who's going all the way, right?

98:39

Even further than probably I would ever

98:41

go if I was in that thing. So, you know,

98:43

you could imagine someone making their

98:44

own hardware these days, right? Uh I'm

98:47

not doing that. And so that's kind of my

98:49

my take on it. Um, so I'm kind of the

98:51

last one to ask about, you know, AI

98:54

coding or what you might want to do with

98:56

it. I I really have no nothing of value

98:58

to add.

98:59

>> Yeah. But I am interested in asking you

99:01

through the lens of the games industry

99:03

and and we touched on on

99:06

games engines arriving and and now so

99:09

many more people can make games. Not

99:10

everyone, but it's it's a lot easier to

99:12

enter. What are you observing in terms

99:15

of most people outside of who are still

99:18

handcrafting code because they want to

99:20

are are using these AI coding agents for

99:22

for two reasons. Either it's either it's

99:24

it just makes sense and they realize

99:26

well this thing can now generate code as

99:28

good as I did which was a turning point

99:30

in January. I I I had that turning point

99:32

actually myself or some are actually

99:34

just pushed with corporate mandates of

99:36

like you need to use these tools and and

99:38

eventually they kind of get on board

99:39

whether willingly or or unwillingly. But

99:42

so many folks are are having AI write

99:44

the code for them. They're, you know,

99:46

they're prompting it, but they're doing

99:47

it. What do you observe of the effect

99:51

having, you know, from your vantage

99:52

point? May that be on on quality,

99:55

craftsmanship,

99:56

on just output, speed, etc. What are you

100:01

seeing? I think it's a little too early

100:03

to assess to be honest because kind of

100:06

as you pointed out obviously there's

100:08

been people who maybe uh you know we

100:12

might derogatorily call AI shills who

100:15

have been saying that it was producing

100:17

as good a code as humans for you know

100:20

two years now or something like that

100:21

right

100:22

>> but in reality the people who opinion I

100:25

would trust more none of them thought it

100:28

was really all that usable until more

100:30

much more recently Right. And so we

100:33

really haven't they haven't had very

100:35

many months to actually be figuring out

100:38

how to use this thing or to determine to

100:40

what extent they can use it and how what

100:42

it's best at, what the workflow looks

100:45

like that makes it produce the best

100:46

results. It seems like at the moment I

100:48

would say probably need to give it at

100:50

least another six months if not another

100:53

year or something to let everyone kind

100:55

of shake out like what what are actually

100:58

the best ways to use this thing. I know

101:00

tons of people in the game industry are

101:02

using it. So I know that they are um

101:05

doing various things with it. Whether

101:07

those things are the same sorts of

101:10

things they will eventually think are

101:12

the are the way they like you know like

101:15

the the things that they're doing right

101:16

now may be like oh that was kind of dumb

101:18

like you shouldn't have used it that way

101:20

you should do this other thing with it

101:21

and it's way more productive or

101:22

something. So I feel like it's probably

101:24

too early to assess. Uh we haven't seen

101:28

any real like obvious like oh wow like

101:30

you know the the you know Fortnite ships

101:33

once a week now and it's bug free like

101:35

nothing particularly interesting has

101:37

happened in terms of output there but

101:39

again it's been what like 5 months or

101:42

something. So it's just it's way it's

101:44

way too too early to see how it actually

101:46

gets integrated into a reliable process.

101:49

Right.

101:49

>> Yeah. and and there I I know there are

101:51

some companies who are now tying up

101:53

let's say agents fixing bugs but that's

101:55

only a few months old the oldest

101:57

software that's widespread that is

101:59

written close to 100% by agents is from

102:02

the labs open AI's codeex and entropics

102:06

cloth code but even there it's been

102:08

since November or or some parts of it

102:10

December so like maybe six months and

102:13

it's a it's different right that is a

102:15

product they're selling so there's uh

102:17

I'm not sure we'll we'll we'll know for

102:20

sure like is it truly 100% how much you

102:22

know there there's a

102:24

>> marketing angle or not but there's a

102:26

there's a self bias there so like I

102:28

would put those aside in terms of

102:30

trustworthiness and you're right that

102:32

the rest we just we just don't really

102:33

have the information it'll be I'm sure

102:35

there's so much experimentation so but

102:37

to to your point it takes time to bake

102:39

right to see the the impact

102:42

>> most of these things are currently

102:44

presented as tools meaning a human has

102:47

to operate them at least in some way

102:49

like at least setting it up to do what

102:52

it's going to do and therefore

102:55

uh you have to give it some time you

102:58

know you know nobody currently is

103:00

selling a product where it's just like

103:01

oh just turn this thing on and it will

103:04

just ship Fortnite by itself forever and

103:06

you can just get rid of all your

103:07

engineers like no one's actually selling

103:08

that product yet right we could evaluate

103:09

that product because we'd be like did

103:11

anyone do it did it start shipping

103:12

Fortnite on its own right so if it's

103:14

still something where humans have to

103:16

kind of figure out how they want to like

103:18

slotted into what they're doing, then

103:20

it's entirely possible that the reason

103:23

that we haven't seen some big uptick in

103:26

productivity uh that would be obvious to

103:28

an external observer is because it's

103:31

going to take a while for people to like

103:32

shake that out or maybe the AIs need to

103:34

get a little bit better. Maybe like

103:35

we've got to go through some more update

103:37

steps or you know whatever. I'm not

103:38

sure. So there's all that's on the

103:40

table. Then there's another possibility

103:42

which is that it actually already has

103:45

worked but just the productivity boost

103:47

isn't as big as would be obvious if

103:50

people got 10% more productive. That

103:52

would still be pretty impressive because

103:55

it's hard to get a 10% across the board

103:57

uplift. I've said this before on

103:58

podcasts. I'm like if you have a tool

104:00

that can give everyone 10% off of that's

104:01

great. Almost no one would know, right?

104:03

It's like you can't it's not really

104:05

externally observable that clearly if

104:07

that's what you got, but it may have

104:09

happened, right? So, it's really hard

104:11

for all of those reasons. At some point,

104:14

if the AIS are really fantastic and

104:17

people figure out how to use them really

104:19

well, it should be obvious. It should be

104:22

like five people are now shipping

104:23

Fortnite instead of 5,000 or whatever,

104:25

right? But, but until that point, it's

104:27

really hard to know because it's just

104:29

like especially if it was small, it'd be

104:31

hard for us to see.

104:32

>> Well, this is anecdotal, but I'm getting

104:34

a lot of data points and messages from

104:36

software engineers and managers. One

104:38

impact it's having is there's this kind

104:39

of like AI fatigue/burnout for from

104:43

software developers who are like look I

104:45

am good at coding. I've always been good

104:47

at it. I I enjoyed the the work to

104:50

various extents. But since this AI thing

104:53

happened since the end of the year,

104:54

beginning of the year since it's

104:56

actually I'm now prompting and now all

104:58

my code is generated whether that's

104:59

corporate mandates or it's just faster.

105:02

I'm starting to lose my drive like why

105:05

am I here? like anyone could do this and

105:08

I think there's a sense of like I'm

105:10

using a lot less of what I'm capable of.

105:13

There's all this pressure from above to

105:14

be more productive with it and it's I

105:17

think we should like I I'm seeing more

105:19

and more signs that it's it's what do we

105:21

call it burnout, AI fatigue, etc. loss

105:23

of motivation. I haven't seen a

105:25

technology or I don't remember

105:27

technology having this widespread impact

105:29

like everywhere. I'm hearing from folks

105:31

at some of the leading like kind of not

105:34

AI companies per se but like you know

105:36

big enough like database providers who

105:38

are now hugely into AI and they're

105:40

powering a lot of the things traditional

105:43

companies modern everywhere. Have you

105:45

observed some of this thing and

105:48

would you have any any advice or any uh

105:52

pointers to folks who are feeling like

105:54

this right now? I guess I would say

105:56

observed. No. Uh heard about. Yes. Uh I

106:02

guess is what I would say. Like I have

106:04

talked to people who have been like such

106:07

and such has been having a really hard

106:09

time with this or such and such has been

106:10

having like there's there I've

106:12

definitely heard that interacted

106:14

directly with someone. Not currently.

106:16

No. Uh, and part of that is is probably

106:20

largely because most of the people I

106:22

talk to have a fair amount of latitude

106:26

with what they do and how they do it. A

106:28

lot of the people that I talk to on a

106:30

daily basis are able to make their own

106:33

decisions about what they want to do

106:34

with AI and so on. And so I don't

106:37

necessarily hear from as many people who

106:39

are going to be in a position where some

106:40

manager told them this is just what you

106:43

have to do. This is very interesting

106:44

because one thing that keeps coming back

106:46

and Armen Ronacher was telling me the

106:47

same thing on the podcast is he's he's

106:50

observed that autonomy like at your work

106:53

how how autonomous you are at your work

106:54

like how many decisions you can make on

106:56

how what you work on how you do your

106:58

work the people who have a lot of that

107:01

are typically like oh great I can use

107:03

this for this like I can use this tool

107:05

but the people who are told you know

107:07

like in beforehand you're given a ticket

107:10

or the PM tells you this they don't have

107:12

much wiggle room and Now those folks are

107:14

seeing it way more as a threat because

107:15

of course subconsciously or consciously

107:17

they're thinking well this thing could

107:18

automate my my job. It's now or or it

107:21

made it made from that little effort I

107:23

had to do that it took it away as well.

107:25

So I wonder if there's a connection

107:27

here. I mean that sounds totally

107:28

logical, right? Uh if you're somebody

107:30

with a high degree of autonomy then when

107:32

are you going to reach for an AI? Well,

107:34

whenever there's something that you

107:35

didn't want to do, right? So kind of by

107:38

definition, I think at that point you're

107:40

going to have a much more positive

107:42

experience with it because worst case

107:44

just doesn't work. In which case, I

107:45

guess that's not great. You're going to

107:46

be like, "Ah, this thing was kind of

107:48

crappy." But assuming that it's able to

107:49

accelerate some part of that, that was

107:51

great. It's like, "Hey, I didn't want to

107:53

do this thing already. I had this AI do

107:55

it for me and now I have the thing."

107:57

That's just a positive experience for

107:58

them, right? Whereas, yeah, if you're

108:00

just told like you had this thing that

108:01

you wanted to do, and you were told you

108:03

can't just do it yourself. You have to

108:04

do it with the AI. Uh, you know, and by

108:07

the way, we just had layoffs or

108:08

whatever. You know, a lot of that stuff

108:11

obviously could totally change your

108:12

mental reaction thing because now it's

108:14

not you deciding to use an AI because

108:16

there's something you didn't want to do

108:18

that you thought the AI could do for

108:20

you. Now it's you just being told that

108:22

you're supposed to be using this AI to

108:23

automate whatever your job used to be.

108:25

You can see pretty obviously why that

108:27

would have different psychological

108:28

effects on people, right? So, so I guess

108:30

it it might be just an idea for folks in

108:33

this situation that now it you might

108:35

want to evaluate your current position

108:38

or if you're interviewing your next

108:39

position based on how much autonomy will

108:42

you have because the more autonomy

108:43

you'll have, the more likely you're

108:45

going to have control over how you're

108:46

using this stuff, how much you can

108:48

experiment versus being given a mandate

108:50

that I don't know, we're expecting you

108:51

to have this output increase or output

108:54

change, whatever that is. I I I wonder

108:56

if this will re-evaluate some of you

108:58

know like what is considered an

108:59

attractive position because like for

109:00

example big tech was considered a great

109:03

place to work because high compensation

109:05

pretty clear expectations like easy to

109:08

understand career advancement but now

109:11

they're the ones who are starting to

109:12

measure uh your AI usage which is going

109:15

to like giving a kind of a bit of a

109:16

handcuff of what we're expecting you to

109:18

do or there's where you might have there

109:22

might be mass layoffs which again you

109:23

have no control over right like again

109:25

one more or or inside of metaphors

109:27

reassignments of like you will now do

109:29

labeling for x months.

109:31

>> I mean you could sort of think of you

109:33

know could we coin the phrase are you

109:36

using an AI to do your job or is an AI

109:38

using you to do to do your job right

109:40

like because at some point it definitely

109:43

it definitely felt like meta for example

109:45

uh from from your reports on it and I

109:48

have seen the same thing said by other

109:50

people so it does not sound like a a one

109:52

source kind of a thing. It sounds like

109:53

this was kind of just accepted as fact

109:56

that they kind of just were using you as

109:58

AI training, right? Like that's what you

110:00

were kind of, you know, you're just

110:01

there to train the eye to do it so that

110:03

we don't need you anymore, right? And so

110:06

thinking about that from a from a

110:08

perspective of choosing your job. Uh it

110:10

does make some sense if you do if you

110:12

have any latitude, right? Uh but yeah,

110:14

>> as closing, what are one or two books

110:16

that you would recommend that had an

110:18

impact on you? I'm gonna uh have a hot

110:21

take here if I if I might because it's

110:24

sort of a it's sort of a a push I've

110:26

been on recently.

110:28

I don't think people should uh

110:31

necessarily take a book recommendation

110:33

from me. I want to recommend that people

110:36

read a paper. I'm trying to get more

110:38

people to just to just read papers

110:41

because I realized I read a ton of

110:44

papers. Like I am constantly reading

110:47

papers on things that I am interested

110:49

in. Like if I'm going to go do some

110:51

programming in a in an area that I

110:53

haven't done before, I will read a ton

110:55

of papers. I'll crawl the references on

110:56

papers. I'll read a survey and go gather

110:59

all those references and read those

111:00

references and crawl them back. And I

111:02

find that I learn a ton that way. And I

111:04

feel like a lot of programmers just

111:05

don't do that. And so my recommendation

111:08

would you don't have to read a specific

111:09

paper. I'm not going to give you a

111:10

specific paper. Read this one. Just

111:13

think about the domain you're

111:15

programming in. Do a search on Google

111:17

Scholar for some part of that that

111:20

you're interested in. Try reading a

111:22

paper, following the references, see

111:23

what you think. I think it's a great

111:25

thing to do. And I get a tremendous

111:27

amount of not just enjoyment from the

111:30

education of it, but also just like more

111:32

knowledge about what I'm doing. pretty

111:34

much every time I do this, even if it's

111:36

just to learn a little bit more about

111:37

the historical record of how things got

111:39

discovered, but a lot of times it's just

111:41

like I learn about whole new techniques

111:43

I just was not aware of. Uh because

111:46

there's way too much out there for any

111:47

one person to know. Uh and and I don't

111:50

know to what I again since I don't

111:52

currently use AI in my workflow, I

111:55

couldn't say. But my assumption would be

111:57

that AIS would also be very good at

111:59

helping you find some papers to read if

112:01

you were interested as well because

112:02

that's you know chewing through a lot of

112:05

uh the technical record is something

112:06

that they do. Uh and so maybe you could

112:08

even ask your favorite AI uh to to

112:11

suggest a paper that you might like

112:13

based on some things that you tell it. I

112:15

don't know if they're good at that, but

112:16

I'm guessing that's something they could

112:17

do.

112:18

>> Casey, thanks a bunch for this this

112:20

conversation. This was great.

112:21

>> Thanks so much for having me. It's been

112:23

a pleasure. I've been wanting to talk

112:24

about performance with Casey for such a

112:26

long time, and I'm glad that we finally

112:28

made it happen. I kind of wish the

112:29

industry had more people as excited and

112:31

interested in high performant code as

112:32

Casey is. If you made it to the end of

112:35

this episode, you might just be [music]

112:36

one of them. I appreciate that Casey did

112:38

not beat around the bush. If you care

112:40

about performance, you want to be able

112:41

to read assembly and [music] spend some

112:43

time reading it. Reading assembly is

112:45

several times easier than writing it. If

112:46

you can read assembly, you can see

112:48

what's happening at the machine level.

112:50

And it's a lot easier to understand, for

112:51

example, why a programming language like

112:53

Python is much slower than something

112:54

like Rust or C when you see the assembly

112:57

code for simple operations. I was

112:58

chuckling when Casey talked about these

113:00

blog posts about how we rewrote our

113:02

services in a new language and got 10x

113:04

performance improvement and how those

113:05

rewrites are usually not about the new

113:07

language with fixing the architecture

113:09

that caused the performance issues to

113:10

start with. And although we did not talk

113:12

much about AI, I found it amusing for

113:14

Casey to say that the games industry had

113:16

its AI moment years ago when [music]

113:18

game engines became accessible to pretty

113:20

much anyone wanting to build a game.

113:22

Before large teams were needed to build

113:24

both a game engine and a game, and now

113:26

teams of one or two can create

113:28

full-blown games. After a brief spike of

113:30

positive effects with lots of new good

113:32

games released, [music]

113:33

games have flooded the market in such

113:35

great number that it's now impossible

113:36

for a new game to become a hit

113:38

organically. So marketing and

113:40

distribution becomes mandatory even for

113:41

[music] great games. For more deep dives

113:43

related to game development and

113:44

performance software, check out the link

113:46

that Pragmatic Engineer deep dives on

113:48

these topics. If you've enjoyed this

113:49

podcast, please do subscribe on your

113:51

favorite podcast platform and on

113:53

YouTube. And a big thank you if you also

113:54

leave a rating on the show. Appreciate

113:56

it and see you in the next one.

Interactive Summary

The video features a conversation with software developer Casey Muratori, focusing on his long-standing argument for prioritizing performance in software engineering. Casey explains why modern software is often unnecessarily slow, the importance of understanding the machine level (including assembly and CPU behavior), and why many common programming adages like 'premature optimization is the root of all evil' are often misunderstood or misused. He also discusses the history of the game industry, the impact of accessible game engines, and shares his philosophical perspective on the role of AI in coding, emphasizing the value of human craftsmanship and the necessity of architectural planning over later optimization.

Suggested questions

4 ready-made prompts