WEBVTT

0:00:15.083 --> 0:00:23.660
<v A>Programming Throwdown Episode 173: Mocking and Unit Tests. Take it away, Patrick! I had a realization.

0:00:24.465 --> 0:00:56.700
<v B>I have too many headphones. I also have too many. Okay, all right. So I was thinking about it, and I don't know how I want to approach this. We can approach this like a lot of different ways, but I was just thinking about how many different kinds of headphones I have in addition to just, like, no one. All right. So I was trying to think about—so, so I do. I've been talking about it; we're going to talk about a little later. It's my book of the show spoiler alert, but I've been running, so I have a pair of running headphones that don't cover your ears because one gets really uncomfortable if you run for a long time and there's something in your ear, but also then you can't hear traffic. So I have these like bone conduction headphones for when I run. Wait, when I?

0:00:56.815 --> 0:01:01.152
<v A>What? Wait, what is that? I've never heard of bone conduction headphones.

0:01:01.152 --> 0:01:37.517
<v B>So it's kind of silly. They're just like they focus on like vibrating a piece of plastic that goes just in front of your ear, like your—I guess that's your sinus bone. And then so like for podcasts or like the gist of music, it's not a hi-fi experience, but it presses in front of your ear versus in your ear canal. So it's not shooting music into your ear. If you didn't know this—wow, this is like snakes feel vibrations through their like bottom of their jaw. If you put your chin up to, like something, you can hear with your ears, yes? But you can you can vibrate the inside of your ear without like sound waves injecting into your ear canals. Okay, okay, that's amazing. They

0:01:39.424 --> 0:03:35.399
<v B>use the same thing in um like places where you can't talk loudly. They'll like have walkie-talkies that use bone conduction as well. I think that's where the technology actually developed because the sound signature externally is a lot lower to other people. These ones aren't that great, like if you were standing next to me, you could probably still hear it, and I can still hear it through my ear canals as well, but I can also hear it through not my ear canals. Um it sounds cooler than it actually is. Are these really expensive? No, we're like okay, about super cheap ones you can buy even cheaper no-name ones, but I have the—I think Shokz is the okay, not endorsing them; I've not tried more than one. I just have one pair. I bought them on eBay um because I'm uh anyway, so just Bluetooth. So I go from around. All right. Then I have like when I fly, I have—I have iPhone, so I have Apple AirPods Pro with the noise canceling, and you know you put them in, but I only really use them for flying because I know the battery is not great, and so if I use them all the time and again, I'm kind of cheap. So like I don't want to like burn through the the, you know, life cycles of the battery. So but when I fly, they're amazing because you put them in, you can put them in transparency mode—don't do that on the airplane—but you can also, you know, do the noise canceling. And that's just like my noise canceling uh if I am listening to music like at my desk when when you know people are around or whatever, I do have desk speakers which are pretty nice. I'm not doing speakers; it's another episode. Um but but I have, you know, like more hi-fi headphones. So I have in-ear—they call them um I don't know if I don't want to use that term because I don't know if that term is is is a is a super appropriate, but um headphones that come from China that you can order on AliExpress or whatever and they're like good bang for your buck. So there's like brands like KZ or um there's people like this guy Clinical; he does like in-ear monitor reviews, so I'll buy some, you know, 20 or 30 dollars, have like three or four of them—this like HEXABASE, this like other like in-ear, you know, ones. But then I also have a biodynamic like large DT 770 with the, you know?

0:03:35.399 --> 0:04:19.821
<v B>headphone amplifier that sits on my desk that I've soldered together from this, you know, plans online with PCB. So anyways, like wow, this is amazing—the over-ear with the thick quarter-inch jack plug, you know? But they're high impedance, like 770 ohms, I think, or something very high. Uh no, no, that's too high. But it's like 200 to 350 something. Large amounts of impedance; you gotta, you know, have something strong to drive them. Um and then I realized I don't even have any of the like the normal like old school, you know, growing up it was always like the cheap headphones earbuds. Like, yeah, right. I have either the like thicker in-ear monitor style or over or the wireless, but yeah, too many. I think I like in a month I probably use at least five or six different pairs of headphones.

0:04:20.108 --> 0:04:59.781
<v A>I feel like headphones are kind of our, you know, generation's shoes. You know, like I never was into like the Nike Air Pumps back in the '90s. Like I kind of was—I was too young for that. Well, I mean, maybe. Yeah, but you know that that was popular when we and I were like seven or something. Yeah, we kind of missed the boat on that. Um but for us it's headphones. Yeah. I also have um I have USB-C earbuds. Um one thing I noticed is like yeah, I guess my my uh headphone snobbery is that I don't want the 3.5 millimeter jack, like the analog. I only want

0:04:59.967 --> 0:05:00.895
<v B>digital.

0:05:01.165 --> 0:05:44.517
<v A>I have a USB-C uh set of earbuds or or earbuds. Um I have these—he's like uh I don't know what they are, but they're these actually use a 3.5 millimeter, but you know you're at your desk and it's a very kind of like like uh there's not a lot of motion or anything, right? As opposed to when you're running with your phone, but I'll actually run with my phone in my pocket, a USB-C connector in the phone and then the wires going to the earbuds. And yeah, they are kind of like a sweaty mess. So yeah, I probably need to do better there. But then I also have for for the airplane when I travel, I have a pair of like over-ear headphones that are really nice because they don't you know they're not touching like they're only touching your head, your skull.

0:05:44.517 --> 0:05:47.031
<v B>around your ear. So it's very comfortable, but apparently

0:05:48.651 --> 0:05:55.367
<v A>I need these bone conduction ones. That's not induction. Conduction. Conduction. Yeah, I forgot also.

0:05:55.367 --> 0:06:00.717
<v B>When I mow the lawn, I have ear protection Bluetooth headphones. So I think I have to—oh man, I have yeah. I

0:06:01.341 --> 0:06:07.011
<v A>Actually, use those for that too, but I don't have. They're not ear protection. That's interesting.

0:06:07.754 --> 0:06:15.955
<v B>Yeah, I have ones that—yeah, they're like work, work like job site noise reduction because I noticed lawn equipment is very loud, so um and if...

0:06:15.955 --> 0:06:45.975
<v A>We could do meta on top of meta here. Um, I was going through all the Spotify comments. Thank you in general folks for comment on the show on Spotify, on other places. Really, I do know read them. And basically, the number one comment is like a variety of ways of saying thank you. We like the show and so thank you, we like doing the show. The number two comment theme is, 'Oh my god, how does it take so long to get to the topic?' And so I will just...

0:06:45.975 --> 0:06:47.039
<v B>tell everyone right now.

0:06:47.580 --> 0:06:51.500
<v A>It takes about half the show to get to the topic. That's what—that's what we do.

0:06:51.500 --> 0:07:06.900
<v B>I maybe we should split it into like I don't know, we're not going to, but yeah, it's like really two shows in one. It's the like casual and in some podcasts do that mix in the stream. They'll have a one kind of show and another kind of show. We really do have two shows; we just squish them together.

0:07:06.900 --> 0:07:33.445
<v A>Yeah, you know, I wonder if it would be better if we put the show title in quotes because I listen to—I don't think that makes a difference. Well, I listen to like this guy, Sebastian Meniscalco. He's a comedian. He's hilarious. He's Italian. He tells a bunch of Italian jokes. As a fellow Italian, I can kind of relate. Um and you know, he'll have the thing like 'Trains' will be the show title, and they won't get to trains until like two hours in, but...

0:07:34.947 --> 0:07:44.835
<v A>But it's in—but it's in quotes. I think the quotes are where it's at, so because they're quotes, you know that like it's not going to be just hit you over the head with 'Trains'.

0:07:46.118 --> 0:08:08.562
<v B>Yeah, I mean, the other comment is—I interrupt Jason a lot. I apologize. I do it. It's a latency thing. Is my excuse, but really, I don't feel like that at all. Oh, I don't. Okay. Um also, a correction: I mixed up the guy who 3D prints speakers. I think his thing is Hexabase. The Criticals headphones was the TrueHi-er Hexa. So I'll have to self-correct. So I'll have to feel bad about it later when I...

0:08:08.882 --> 0:08:12.848
<v A>go to sleep. That's the third most comment—most frequent comment. No.

0:08:12.915 --> 0:08:18.880
<v B>I always feel bad. I often do realize that I say things incorrectly. It's just like what are you gonna...

0:08:18.880 --> 0:08:35.089
<v A>do about it? Yeah, I mean, I think that's—that's totally. We definitely say a lot more correct things and incorrect. We're batting people. Oh, go ahead. I'll continue the trend of doing incorrect things. I will show Patrick something that nobody else can see, so you're just gonna have to...

0:08:35.089 --> 0:08:36.020
<v B>Give an audio.

0:08:36.540 --> 0:08:59.963
<v A>Secret, but this is my Nintendo Snitch. Um, so for all people at home you can't see this. What this is is I took a Nintendo Switch controller, the Joy-Cons, which are just Bluetooth controllers that can plug in anything. I got a Wave Share LCD panel and then I have a Raspberry Pi. Uh, that's like mounted into that. Wait, and then I have

0:08:59.963 --> 0:09:18.610
<v B>it up and showed me that it's like eight inches thick, like on the front. It looked exactly like I just thought he was holding up a Switch. I thought he was gonna be a Yuzu, you know, news section, but like we didn't add that anyways. Uh, no, actually he is holding up a—it is yeah blue box that's like eight inches. Yeah, I 3D

0:09:18.762 --> 0:09:45.205
<v A>printed this box. And so then the the the Wave Share LCD panel actually comes with speakers. It plugs into the Raspberry Pi, and then on the Raspberry Pi is this obscenely large battery pack. Uh, this thing probably has a zillion hours of battery life, but it weighs like a ton. Um, and then the battery pack has a like a two-prong connector that I connected to this button that I guess people use for like boats, but

0:09:45.897 --> 0:09:49.035
<v B>it still works. It's a marine grade waterproof button. I have.

0:09:49.035 --> 0:10:03.261
<v A>A marine grade waterproof button on this 3D case, but if I hold the button down it turns on. I'm not going to do it because it's—it's uh and it boots into RetroPie, and I have all the NES, SNES, all those games on there. Oh, what? Okay, but yeah, does it

0:10:03.261 --> 0:10:04.037
<v B>have a fan?

0:10:06.450 --> 0:10:09.707
<v A>It does not have a fan. It's all passive cooling. Oh, okay. So the thing

0:10:09.842 --> 0:10:16.560
<v B>that the joke for people who have the Steam Deck is when the fan starts running it produces like this very particular odor that's

0:10:17.166 --> 0:10:18.094
<v A>that gives you

0:10:18.094 --> 0:10:22.580
<v B>cancer? No. I'm probably—I assume it's just like thermal paste or whatever, but yeah.

0:10:24.186 --> 0:10:36.775
<v B>You—I smell the vent like you just like hold it up and you're just like, oh, it's the smell. I'm playing a good game because the guy's working hard, you know? The little okay, sorry if you want my Decks out there. They know what.

0:10:36.893 --> 0:10:55.658
<v A>I'm talking about one time I opened a wrench set from Harbor Freight, and it had this really nice smell of like is it the plastic or the rubber, the TPU that they use on the handle of the wrenches? And then I got a cold right afterwards. I was pretty convinced I had SARS or something, but I still

0:10:56.164 --> 0:11:16.549
<v B>If you ever open surplus military stuff from like a really long time ago, it also has like this particular varnishy smell from some of the oil that they preserved all the stuff in. Yeah, yeah, okay. Anyways, now we're people are definitely—I was gonna say hanging up. This is not a phone call, so they're not hanging up, but they're just if

0:11:16.549 --> 0:11:20.025
<v A>This is real time. You just see in real time the ratings plummet.

0:11:20.025 --> 0:11:21.932
<v B>Yeah, all right. We'll jump

0:11:23.012 --> 0:13:21.860
<v A>into news. We'll cut our losses. My news article is Texas A&M University Physics Festival. I went here with my kids; had an absolute blast. You know, if you're not—if you don't live in Central Texas, it's probably not convenient, but the real thing that I wanted to post about here beyond just having a ton of fun is this is really a win for social media. I'm not on Facebook or any of these things; I am on YouTube. I consider YouTube to be like the closest thing to social media for me. The only time I really go on Facebook or other social media is if people reply to our show, so you know we post the show through an app called Buffer. If anyone makes a comment on the show replies the show or anything, I definitely read it, and we have some several interesting threads, but I personally just don't have it in my routine to go on any of these things. But I do go on YouTube, and YouTube recommended me this video from this Physics Festival last year, and it really dialed in and knew that I would like it, knew the kids would like it. And we watched it. We did—we enjoyed it; had a good time. And it was local, so I said, 'Hey, let's look it up.' We found out when the next Physics Festival was, which was this past weekend, and we've been eagerly waiting for the past few months. And then we went last—last—last weekend, and you know what I came away thinking about? It I think about was, you know, there's so much of a stigma about social media and all the damage it does and everything, and I'm not discounting any of that, but here was an example where, you know, I got recommended something from YouTube that I never would have even thought in a million years to look up because we were watching a bunch of science things, and it happened to be kind of local, and it turned into like a real-world day trip that we had a lot of fun. And so it's kind of like a win for.

0:13:21.860 --> 0:13:24.884
<v A>Social media that you know often these things go unnoticed. Oh yeah, that's—that's

0:13:27.027 --> 0:13:27.837
<v B>Cool. Yeah, yeah. And

0:13:29.060 --> 0:14:22.420
<v A>If you if you—if you have some time folks out there check out if there are any kind of like physics or math festivals around you. When we lived in the Bay Area, there was a university—I think it was San Jose State—one of them had a Physics Festival, and I'd go every year. It was a lot of fun, and you know basically they just do cool experiments. It's a lot like being in high school physics or chemistry again where your teacher blows stuff up, lights the ceiling on fire, stuff like that. Over the weekend, they made solid nitrogen, which you can only find naturally in like gaseous planets like Jupiter and Saturn and stuff, but actually they made it right there in front of us. So, so yeah, really, really cool, a lot of fun, and glad I found out about it.

0:14:22.420 --> 0:16:04.605
<v B>It looks like there's actually a map at least for the United States of universities on here that have Physics Festivals. So I see one sort of near me, so I have something to do after the show. Nice, very cool. My topic, which is a topic in itself, and I'll probably not talk about that topic too much, but talk about something slightly different. Anyways, there was a YouTube video from a Rust convention conference from Lars Bergstrom, who's a Google Director of Engineering, and he said something which I don't—I don't know viral like I don't know what the bar is for viral to Jason's point, I guess, like being on social media. I think I saw this one, I don't remember, on Hacker News or Reddit, but you know got a lot of people engaged about it. And we're talking which he had a slide in the slide deck which was the thing that got passed around saying that—I'm going to sort of summarize here, but basically that at Google they collect statistics and that the Rust teams programming and Rust at Google were about as productive or maybe even a little more—I don't remember. I think it was saying about as productive as the ones using Go, which Go is the language Google developed, and that they were 2x more productive than those using C++. So basically, I guess he—I don't know whatever the equivalent of lighting a Molotov cocktail and throwing it into the internet was. This is not his words, and these are not mine, and this is interesting itself. And I was we actually had a couple other C++ articles in here, but I took them back out so maybe some other time. But there's this sort of feeling going around and everyone kind of always has these battles like what language is better than another. And so from some of the commentary that was interesting.

0:16:06.225 --> 0:16:42.861
<v B>Is that just metrics around like programmer efficiency are so subjective and difficult? Like you would think it's relatively easy, but just the amount of like this relatively straightforward statement—like is this meaningful? Is this useful? Is this something that like you should incorporate into your beliefs about like selecting a project, a language for a project, or a project to learn? Or is this just noise? Or is you know for everybody on one side, you can probably find somebody on another side. And just even the metrics were, you know, these teams doing greenfield programming, you know, just exactly starting

0:16:42.895 --> 0:18:39.000
<v B>a program from scratch? Are they doing maintenance? I guess he was actually saying that, you know, that there some of this was for people basically porting from C++ to Rust and that they find which again is difficult is like C++ maintenance is very expensive and difficult. That is like to fix or add features to existing code bases takes—you know—some unit time rather relative to, you know, adding features, but then people bring up, 'Well, maybe C++ the things implemented in them are themselves the more difficult tasks.' And so, you know, adding a click box on a website is a different task than, you know, changing the compression scheme of, you know, BigTable or whatever, right? So it was just an interesting discussion that even in a company with as many very talented engineers as Google to sort of like understand what should they do, what about by—like what about what people know and don't know? Do you incorporate the cost to cross-train people in these other languages? Like is it if you go, you know, if you have C++, they also have a lot of Java, Rust, Go. Now they've got like how many Python, how many different languages do we want tools, infrastructures, and expertise in? This is like a very high-dimensional design space to be in, and it is very interesting to watch as things play out over the years and years. And my preference is for sort of like learning—it's great to dabble your toes this podcast others in lots and lots of languages and then be slow on your sort of like core core expertise, like what you're actually picking up and committing to and taking jobs in, and that kind of stuff. Um could you picking wrong is very expensive. And you know picking just something that doesn't get support or it gets killed or dies off, which we can point to many things around that, probably even we've covered on the show. But just yeah, it's very interesting to watch as this long game plays out and people try to take measurements and sort of prove or disprove the status quo, and

0:18:39.000 --> 0:18:51.634
<v B>Sunk cost fallacy and you know all of those things about how to make decisions going forward. So anyways, there it is this person, Google Director of Engineering, saying that for them and their measurements that he was finding great value in Rust. Yeah.

0:18:52.765 --> 0:19:43.520
<v A>I mean, I exactly. You covered it. I mean, I think there are so many confounding variables. It's like, you know, the language that we just started using—we're so much more productive than the one where we have 20 years of technical debt, you know? I mean, it's it's like a it's like a ton of confounding variables. Um, I actually um there's an amazing set of Markdown files in a GitHub repo dedicated to teach people who are C++ engineers about Rust, and it goes through assuming you're really good at C++. Um, I went through that and gave me a really good handle of Rust on Rust. Um I've yet to need Rust or C++ for a new project. Um but when I do, I think I'll I'll give Rust a shot. Um But yeah, I mean, I think

0:19:46.039 --> 0:20:55.412
<v A>you know, all languages will evolve over time. It's good to know as many as possible so that when you go—so part of I think learning so many languages is that it frees you from making language a big reason for picking a job. Um you know, like uh you know my story after you know I finished my college degree. Um and uh and I went kind of like looking for my first kind of post-graduate job. Um You know, I ended up like writing JavaScript, and I never really done it before. I'd only ever done C++ and Python. Um But you know, I think that if I had made language a big reason for choosing a job, I think I wouldn't have necessarily got the best job. So it's good to know a bit about everything. And yeah, take all of these things the big helping heap of of uh of salt, but um but uh but yeah, I do think that you know eventually like Rust go these things will eventually take over C++. That's how it kind of how I'm reading it. I mean, what's your take?

0:21:00.104 --> 0:21:34.157
<v B>Patrick, oh, I don't know enough quite yet. I mean, to be clear, people still program like there are still assembly code needs to be written, you know, not as much as it used to. C is still written probably not as much as it used to be. I think some languages once they reach, you know, a certain level of critical mass, they probably don't go away, right? And what you see is—I don't want to say like it's a zero-sum game because I think every year more software is written, but I think what you see it is like the relative portion of new code getting written. I don't know. Again, this is a hard

0:21:34.157 --> 0:21:37.000
<v A>metric. Yeah, when you're talking about percents, it's always a zero-sum game.

0:21:37.000 --> 0:23:21.550
<v B>Yeah, and so okay, yeah, fair, fair enough. But I think C++ market share is probably not going to see new highs, right? Um I think I think market share it'll it'll continue to be a core part of, you know, some call it deep infrastructure or whatever for a very long time. There's a lot of really great, you know, high-performance software that that exists in it, you know, and a lot of expertise in doing those kinds of things, you know. And so I think that will continue. But yeah, I think you're right. I think for a lot of stuff it doesn't need to last for 10 years, and so, you know, it you know that expertise for how to maintain and use that, you know, doesn't there? And you know, I think Rust and Go they're using Rust, you know, for parts of Linux and trying to—I think that's a great inroad to see it, you know, being used in software. And uh we almost talked about the White House memo on C++. I think that's another one is just like by default, you know, just adding an extra layer of memory safety that that is difficult in C++, although it has gotten much better. Um yeah, I do I think C++ probably won't ever see new highs, but I think there's some places where nothing else is even in consideration right now. So if you go to a game studio and you're writing a game engine or—I mean, maybe I'm wrong. Those people there's so much, you know, you said tech debt, I guess, but like the reverse, like what do you call? Like tech inertia? Like there's so many utilities and math libraries and optimized spatial indexes and all of that stuff, and it's all in C++. It would be a massive investment to port all of that to something else or write good, you know, adapters for. And all that stuff is continually getting improved, and so it's a it's a huge sunk cost to just switch um to another language. Yep, that.

0:23:23.085 --> 0:23:25.229
<v B>was a non-answer, very long-winded non-answer.

0:23:25.240 --> 0:23:47.723
<v A>Yeah, I think you're totally right. Um I think uh yeah, I think you really can't go wrong learning as many languages as possible. So if you're if you're if you're really into C++, you have nothing to worry about. Um If you are learning Rust and this is day one, you have nothing to worry about. Um I think all these languages are going to be popular for

0:23:49.326 --> 0:24:28.695
<v A>a long time. Um All right, my next news story is is is cosine similarity really about similarity? So let me kind of paint this picture for everyone. So um in AI and machine learning you have to or maybe just in computers you have to represent things with numbers, right? So yeah, just taking a really big brush here like if you have an image, right? That image at the end of the day is a bunch of pixels, and each pixel has an RGB value. And so it comes down to numbers, right? So that that image is represented as numbers and ultimately as bits, right. Um

0:24:30.332 --> 0:25:26.425
<v A>but you know you might want to do things like say are these two pictures similar, and you have to have some kind of like semantic understanding of similarity. Uh the joke that always comes up is I think this was like some joint project with the military and MIT like 80 years ago or something, but they trained this classifier that took in pictures of tanks and tried to predict whether it was a friendly or enemy or yeah, friendly or unfriendly tank. And um they collected a bunch of friendly tank data. Um they moved all the friendly tanks out of the way. They brought in all the enemy tanks. They flew over them. They collect a bunch enemy tank data later in the day train their model, and their model ended up being a time-of-day predictor, right? So because they had done one collection and then another at different times a day, the model learned, oh, and the sun is setting, it's an

0:25:28.180 --> 0:26:52.760
<v A>enemy tank, right? Um and so you can't use just raw pixels to, you know, you can't draw some distance function between raw pixels to say whether two images are semantically similar because of all these other effects, right? So what you end up doing is creating what's called an embedding, which is just like a semantic projection of a picture. And the way you do this is you have a bunch of humans tell you whether these two pictures are the same or not. And so now you have this data set that says here's a picture A, here's picture B, and yes they're the same, or no they're not the same. So in the case of the tank example, you'd get two pictures hopefully at different times of the day but of the same tank, and and a human would say, 'Yes, those are actually the same semantically, the same thing.' Um Once you have all these this data set of of triples of image one, image two, and whether they're the same or not, train a model, get an embedding. And so now you have a point. So you actually have a you know a function that takes an image and turns it into a single point in some high-dimensional space, and so presumably, you know, two points are closer together if they represent the same thing. Um

0:26:55.238 --> 0:28:35.340
<v A>now here's where it gets interesting is what if you have a point that's like a dog and you have another point that is like maybe maybe one picture is a dog, but the dog is far away. So there's there's, you know, like an empty road or maybe like a green screen, maybe it's literally just a white background and a tiny dog. And then you have another picture that's like a bunch of dogs filling up the whole screen, right? The second thing is like very very dog, you know, the first one is less dog, and so but but they are aligned in that they both represent the same concept. The second the first one is just much more extreme or much more emphatic saturated version of that concept, right? Um So people when they're doing these recommender systems, this paper came out of Netflix when they're trying to recommend movies and stuff. If you see Rambo, they want to recommend some other kind of action movie, right? And they don't want to not recommend something that is like maybe a little bit less actiony than Rambo but is directionally aligned, right? So that's where this cosine similarity came from. So the deal with cosine similarity is you're just looking at the direction from the origin to that point. And so, you know, if the direction from the origin to Rambo if that that direction is the same as the direction from the origin to Top Gun, then they'll recommend Top Gun to Rambo and vice versa, right? Um what

0:28:38.192 --> 0:29:01.868
<v A>they're afraid of is if something is not too actiony, then it's just going to get recommended a whole bunch of other things that are that don't easily fit into any other category, right? So something that's like a little bit Rambo-y might get recommended to something that's like a little bit Barbie or something, right? And it just wouldn't make any sense. So cosine similarity is supposed to like prevent that when you're close to the

0:29:02.779 --> 0:29:06.964
<v B>Origin, but TLDR it doesn't work very well. They did a bunch of studies.

0:29:06.964 --> 0:29:15.960
<v A>I've always been very skeptical, so I'm kind of glad to see this paper come out. In general, it's good to read papers that affirm all of your pre-existing beliefs.

0:29:17.460 --> 0:29:18.810
<v B>Confirmation bias. Confirmation.

0:29:18.810 --> 0:30:11.697
<v A>Bias. But it's a fascinating deep dive into this, and there's—there's you know other similarity metrics that work better. And in general, when you're dealing with all these complicated embeddings and stuff, you know the this idea of like direction, it kind of falls apart at high dimensions. And so it's one of these things like intuitively you could kind of picture in your mind like a clock, and yeah I want like you know the two hands of the clock to be pointing in the same direction. But all your intuition falls apart when it gets to like you know 100-dimensional spaces, and this is just another example of that. Anyways, really fascinating paper. I feel like it's pretty accessible too, so it's pretty good. There might even be YouTube videos that explain it in better detail than reading the paper, but I had a lot of.

0:30:13.975 --> 0:31:49.791
<v B>Fun reading. Yeah, I think the struggle for me or so so interesting. I have to check this out because I'm curious what other alternatives they provide. But the thing you're mentioning where you have a vector that represents high-dimensional space and just even saying those words is something that always feels like just out of grasp for intuition for me, but when you read something that's like what is the volume of a unit sphere as you move up in dimension? So like you know in 2D you have a circle, in 3D you have a sphere. You have like 4D and you keep going up, and you start to get what I'll say is like very unintuitive. I mean, you can kind of just know it as a fact later, but it's unintuitive that like the number that's attached to the unit—so obviously like you get like meters and meters squared, meters cubed, meters to the fourth, which we stop losing, but the number that goes in the front, the behavior of that number as you go up in dimensions, like starts growing and like starts shrinking, and then it gets like smaller and smaller and smaller. Like the geometric stuff that you start thinking about like because someone drew you a picture early on doesn't always work when you start getting like like you're saying like to very high-dimensional spaces. You're not even talking like like more than finger and toes dimensions, right? Like you may have a vector which is a thousand dimensions, and it's like your ability to reason about distance in that is probably like not super intuitive. And so yeah, being careful about this, like you can't explain the concepts, but it's also like you said some things that you think should be really obvious could stop working for non-obvious reasons if you're sort of trying to build from intuition at least as a—I'll say a lay person in the field, like.

0:31:51.107 --> 0:32:01.640
<v A>Myself. Yeah, that sounds right. I think um I think it's very hard to have intuition about these spaces. I mean even researchers, you know, and so it's a lot of it is empirical and trial and error.

0:32:01.640 --> 0:33:00.312
<v B>My last news article is about the XZ utility supply chain attack. Well, that's a lot of words. So if you miss this, this news is pretty interesting because I think folks have warned about this for a really long time, and this one is notable because it actually was prevented. And they're still not 100% sure about, you know, the intentions and what was going on here, but basically there is a library XZ that does compression, and it's used by a ton of Linux utilities. And a researcher or a researcher—an engineer at Microsoft who does a lot of work on databases. Oh, I'm not sure I want to say that Andre, and then it's F-R-E-U-N-D. I'm not sure how to say the last name. Do you want to try? Me neither. Okay, I thought you were leaning in like you were gonna say it. Okay. So pretty like it's just one of those things I've always seen, right? And I don't know that I think.

0:33:02.573 --> 0:33:51.848
<v B>Frond Broyd. I don't know. I'm gonna look it up while you like re-end. Okay. Um yeah, Last ChatGPT, I guess. So they were doing some, you know, examination of, you know, some performance issues, and they were actually using tools you would use Valgrind, and they were having performance issues with SSH, and they were trying to figure out what was going on, why is it taking an abnormally, you know, like longer than it should? And they were trying to run it down, which in itself is very observant because most people are like I don't know like I'm on a sort of pre-release build, like who knows it could be flaky for many reasons. But they were—they were going to run it down, and so they ended up you know sort of running to ground and figuring out that there was you know SSH depended on another library which depended on XZ for some of its, you know, compression that it was doing, and that a change in there had triggered it. And people basically like

0:33:53.519 --> 0:35:52.840
<v B>That thread started to get tugged on and like unwound, and it turned out for basically several years that someone had started contributing to this package, and then they had done a couple sort of like weird but not super so like problematic things. Like oh, let's turn off some of the performance monitoring for a certain configuration of the software, like fuzzing. And then through a sequence of sort of unrelated seemingly unrelated steps, we're able to get code that would allow you know basically a back door to be installed to where if you sort of knew the special sort of key to send to SSH, like you could basically start to include your own payload and then run code. And yeah, basically it would be like anything that had SSH would just be you know a huge problem and be susceptible to this backdoor. And it's one of these stories where it's not so it seems like SSH was being targeted by something that was like two layers upstream, right? And this is why they sort of call this this supply chain attack, which is if you think about software you're writing and think about the libraries that you depend on, and then the transit of the libraries those libraries depend on, the libraries those libraries—those like. And so you hear this, you know, people at least, and and sort of people I work with, you know, oh, it's so funny, you know, NPM broke because there was a left justify or I forget what that, you know, a white space, you know library that all these people depended on, and it got you know it got broken, and you know NPM went down. And ha ha ha, like it's funny, but this was very serious. Someone had worked for years to basically open up the possibility of installing backdoors in SSH, and so it wasn't even something that was detected in the action itself. Someone just happened to be paying attention that code was taking a little longer than it used to, and basically found this out before it got widespread. If it had become widespread, the amount of work to sort of roll it back or sort of like find all the places and roll the upgrades for like it would have been sort of months where this would have existed.

0:35:52.840 --> 0:36:27.655
<v B>And if it had you know gone a long time without being found out, who knows how like many versions would have you know had this in it. And no, no necessarily like call to action for all of us to go just it's just like food for thought, I guess that hey we actually depend on for software so many things that you just can't possibly sort of be paying attention to and watching, and even if you are, if there's a determined, you know, opponent on the other side, like the sneakiness that they could be working with, just like it almost becomes mind-boggling. Um yeah, this is wild. So the

0:36:27.655 --> 0:36:55.660
<v A>Way they pronounce the name is Frying. Ah, there we go. Thank you. But yeah, this is really fascinating. I highly recommend folks go to the show notes and read this article from Artist Technica because it has some really interesting infographics. Actually, the whole article is extremely well done, but uh yeah, I actually we actually interviewed someone a while back just on this topic, but um I hadn't heard of such a high-profile attack like this.

0:36:57.000 --> 0:36:58.874
<v B>Until now. Yeah, this is relatively recent.

0:37:00.527 --> 0:37:06.113
<v B>And the curious thing would be there's no way this is isolated, right? Like there's no way like this one was found and I don't

0:37:08.391 --> 0:37:53.160
<v B>know. Call it just like sneaky suspicion. If we found this one, you got to imagine that there are 10 more, 100 more. I'm not gonna, you know, there's the chance that this is the only one. Especially, I mean, again, I don't think there's concrete evidence of this that, you know, it being a state-sponsored attack or whatever, but let's say it was the chance that this is the only place they were doing this, and it got to be approaching zero, which means there are probably others of these out in the wild today or already having that we just haven't found yet, or you know, haven't discovered. And so for cybersecurity, this is a, you know, talk of always about security and depth, right? Like thinking through multiple layers and making sure that, you know, you don't just rely on one system to protect you. And it just, you know, brings that to even more of a prominence.

0:37:54.764 --> 0:38:50.603
<v A>Yeah, I mean this is fascinating. I'm just speechless because I'm gonna have to read this in more detail afterwards, but absolutely unbelievable. Yeah, I mean, you know, I mean this is kind of a side topic, but I do have folks, you know, come in with pull requests for EternalTerminal and they add flags and they update the README and all that. I'm extremely grateful for that. But it does show that you really have to be vigilant. I mean, in a sense, I'm a bit fortunate in that I'm like benevolent dictator of EternalTerminal, so I see every pull request. But at some point, we'll have to find somebody to manage that who will be vigilant, and this just can't happen to that library. It's just kind of a wild way to—well, in a sense, I mean this would have affected EternalTerminal because we're still using OpenSSH, yeah.

0:38:51.092 --> 0:38:52.729
<v B>I think also the like the the

0:38:54.282 --> 0:40:09.520
<v B>thread of like I'm gonna, you know, sort of years in advance put in some code in some place that isn't, you know, we're going to talk about unit tests today, and I put some code in some unit tests maybe people aren't paying as much attention to. But then later, and sort of everyone knows that, and that's probably fine, right? It's just a test. But then later someone, you know, then saying, 'Oh hey, this code over here, I'm going to put into a common utils thing so we can use it.' You know, it's useful in tests, let's just use it in our main library too. And now because you're like, oh, that code's been there a while, like it's sort of tested, there's nothing wrong with it. So you get this like it's credible by like maturity, which, you know, like we never run into a problem with this code before. So you forget that we've never really thoroughly reviewed it. So maybe now it gets into a code that normally would have had a more thorough review, but because it's vetted code except that it wasn't. You sort of slowly get this, you know, upgrading of privileges through the stack where like code can kind of move from place to place if you're not careful about like even in your own codebase your provenance. Like this code came from test. If it moves out of test, it has to undergo fully thorough review no matter what. You know, I that's not a policy that I would imagine most teams probably run with.

0:40:10.270 --> 0:40:13.240
<v A>Yeah, yeah, this is totally wild. Wow, fascinating.

0:40:14.151 --> 0:40:15.045
<v B>All right.

0:40:15.045 --> 0:40:25.137
<v A>Yeah, my mind is just blown. I'm just reeling from that. So folks would definitely read that on to book of the show. What's your book of the show, Patrick?

0:40:25.154 --> 0:40:44.509
<v B>Well, I already foreshadowed it, but I read a book I've been running. I'm more trying to, you know, be fit as, you know, it's always a good goal for everyone. And this is by Matt Fitzgerald. This book's a little bit older now and it sort of shows his date a bit, but it's called 80/20 Running. I think at the time this was a very substantial change

0:40:46.720 --> 0:42:43.600
<v B>to the way sort of—I don't say like anyone can go run, right? Like you got a pair of shoes, right? Over and just go out and jog. But like you want to sort of like get kind of serious about. We were talking headphones, you know. I just go on Amazon and buy headphones if you want to like what is a good, you know, what's the knee in the curve of the value to performance? You know how much what's the best headphones I get for $300? You can do research if you're going to be like that, like me with running. Then you're sort of thinking like, 'Hey, I can go out and run, but what's the best way? What's the best way to get better?' Do I have to get better? No, I mean, but I want to get better. Like this is good. Are you trying to train for a marathon or anything? I mean, I did run a half marathon. I'm not currently training for a marathon. I might at some point. I'm not doing it right now, but just trying to be able to run for, you know, at any distance, just run faster than I have before. So for longer distances, you're normally you can't run as fast, right? So you—you can start fast and then slow down, but you try to kind of pick the speed you can go, you know, 10 kilometers or 10 miles, or, you know, as you're sort of working through these just, you know, improving over time. And I've mentioned before, you know, tracking it through various websites and a running watch and this kind of stuff. You can—you can see your improvement, and you can also see, you know, resting heart rate going down, your VO2 max going up, so things which correlate with longevity and health. You can also see improving. So part of it is if you just run the same thing all the time, it becomes easier and easier to you. So the health benefit starts to go down as well because you need to be—oh, I see. So if your if your heart rate doesn't go up at all, right? Like, you know, if you've never walked and you start walking, and it's going to be a lot of work, but then you keep doing it, keep doing it unless you're, you know, keep pushing a little bit now that you have to go all out or even race. But, you know, you're you just need to kind of always be exerting your body a bit. And so this book, though, 80/20 Running, talking about that—an observation from elite people and an encouragement to even amateur runners that, you know, to spend 80 percent of your running at what they call

0:42:43.600 --> 0:44:11.211
<v B>the so-called easy pace. If you get into, you know, heart rate monitoring—to call it like Zone Two, but basically go at a pace that you could talk at. And then 20 percent to do at, you know, what I would have done when I was younger? Just like run as fast as you can until you're, you know, got a stitch in your side and you're killed over puking on the sidewalk. You know, reserve that for, you know, 20 percent. And the thing isn't to sort of run the same, but run it slower. The idea too is like if you want to get more and more at the high speed training, it comes with a commensurate increase in how much time you spend at lower speeds. So an interesting book. It is much more accessible now that it's the entry price for getting something to monitor your heart rate is really cheap. You can either just get a strap or a watch if you already have a phone, you know, that will pair with your phone and tell you what your heart rate is. So you can watch it. Nearly everyone can do it. You know, it's not a barrier to entry really in my opinion anymore. And this is something that elite folks, you know, struggle with being able to do. You couldn't target a specific heart rate because they didn't know what it was, and like running with your finger held against your neck—it's probably not a great way to count while you're how you're running, but yeah. Um it was a very interesting book if you if you're trying to get, you know, into running or serious about running and running 5Ks, 10Ks, half marathons, marathons, and how to do it in a way where you are effective at getting better and not getting injured. And this is a good book. Not very techy. I kind of come up with a good tech angle for it, but this is what I was reading about.

0:44:11.532 --> 0:44:17.472
<v A>So oh that's awesome. Yeah, I guess like I mean you know goes without saying take care of yourself. You know, I think.

0:44:19.328 --> 0:46:16.480
<v A>Patrick and I—I mean, we're definitely not pro athletes by any remote stretch of the imagination. I have zero hand-eye coordination. But like, you know, we do take care of our body. I think it's really truly important. And I think, you know, I think a lot about my dad who is, you know, in his 70s and he's still just completely active. You know, like, you know, and he talks about things slowing down his body and stuff, you know, at that age. But he's still walking around. He's still doing all the same hobbies and everything. If you want to have that kind of a life for that kind of a duration, you have to put in some effort to stay healthy. All right, my book is a movie-making nerd, so I used to love watching this guy's name is Angry Video Game Nerd is the name of the YouTube channel. The gentleman who plays Angry Video Game Nerds, James Rolfe. You know, I've watched these shows for many many years. Had a ton of fun. I saw the book come up in Amazon. I thought, let me buy it and really just support this person who I thought has made a lot of great content. I went into it pretty skeptical, so I thought, oh, I'll read the first couple of chapters and then, you know, I'll just delete the book. But yeah, I felt like my job was done by buying the book. But it was amazing actually. The first part of the book was phenomenal. You know, he has a very interesting background. He struggled a lot with anxiety and mental health and these things as a young child, and so he went to like a special school. Like a special education school for most of his grade school. He didn't go to a traditional school until high

0:46:16.480 --> 0:47:16.684
<v A>school um even that was like a really big decision where people didn't know what happened um you know i just i don't know it could really uh it really related to you know i think when when i was like really into computers and programming and all these things at a really young age and at a time when you know like 1980 nobody's really into into any of that stuff um but i think that you know it kind of connected the book really connected with me on that level of like being really young having like so in this case you know despite the fact that the the videos are all about um video games and everything that the james rolf is actually not like a really hardcore gamer or anything he's really a movie producer who found an interesting topic and and 90 of his movies up until he got popular with this one were horror movies and things totally unrelated to video games so so his his passion is movie making video making um but

0:47:18.777 --> 0:48:58.744
<v A>but just seeing someone kind of have like a really strong passion very early in life and like uh all the all the challenges there and the anxiety that he went through and everything i thought it was amazing read i will say it kind of falls apart at the end uh in the sense that you know if someone says hey you know i've reflected on myself uh for 30 years and here's my conclusion that's very different than like a month ago you know like it's like it's like when the book ends it's like yeah you know last month you know i made a movie or something and it's just that part of it it kind of fell a little flat you know i think it's it's a kind of book that ideally someone would write like when they're very at the you know kind of at the end of their story and this person is probably the same age we are patrick so he's probably in their 40s kind of in the middle of their story and so because of that the book could really end in a good way uh um a really conclusive way but um it is worth buying just for the first first half of the book um and and another thing i actually i never this is actually my first time ever doing this i think ever in my life i emailed james rolf and i said hey you know the book like really spoke to me um you know i i thought it was awesome you know and uh you know i didn't hear anything back i thought well you know this person doesn't really read their email i mean we barely keep up with our email and his videos like a hundred times as popular um but then he wrote me back like a few months later it's like a week ago he wrote me back just like you know thanks for the kind words so um so i thought that was super cool um and uh yeah i thought the book was was a great

0:48:59.740 --> 0:49:06.034
<v B>read awesome i have to check out i didn't i don't think i know anything about them so this is a new uh new have you ever

0:49:06.034 --> 0:49:10.962
<v A>seen the uh angry video game nerd he like breaks nintendo cartridges and there's crazy stuff i don't think i have

0:49:13.544 --> 0:49:41.539
<v B>this this is one of those crazy things like you run across and i don't i haven't looked them up but i uh if i open youtube it's gonna start playing audio so i'm trying not to do it try to resist the urge um but you'll run across someone it's like i have like you know three million followers like how do i not have i never bumped into this before the recommendation algorithm or whatever i guess i'm just too cosine dissimilar from whatever topic that this person is in so i maybe they need the netflix algorithm at youtube and i'll uh i i would start getting recommended these videos yeah

0:49:41.775 --> 0:50:05.789
<v A>i'm trying to think how i got recommended it i really can't remember it's been so long but uh um i don't think that it randomly showed up because i'm kind of with you like if you were to look at my youtube now it's all like physics stuff science stuff geeky stuff right um i i feel like probably this came from a friend but uh but either way it's uh it's a

0:50:07.864 --> 0:52:00.100
<v B>lot of fun time for tools of the show all right what's your all right i'll kick us off i have been one so we talked about before satisfactory dyson sphere program right dyson sphere program yeah uh the factorio these are i guess you call them factory games uh you were recommending cuba factorium i have it on my steam wish list although my backlog's way too long um but uh so i have been wanting something to play on the go i mentioned you know being on an airplane um and you know just having downtime i do have a steam deck but it's kind of a thing to take out you know you can't just play it for a few minutes um and i had bumped into before you know in searching factorio for iphone of course there's no factorio on the iphone and i don't blame them uh it would be it would be kind of not the right fit um people always were recommending this web app shapes uh s-h-a-p-e-z um and i tried it on the web you know kind of like okay recently i i don't think it's been around that long they made a port to ios and android and so i picked it up and yeah it is it as a game i i much prefer dyson sphere program or factorio um but again they wouldn't play well on an iphone or or even i do play factorio on my steam deck but because it's that good um shapes isn't that good in my opinion but it is fun it is it does scratch that same itch and it is mobile so if you've never played chase before i don't know how to do an android on ios i think it's free to download and they give you a pretty generous demo that you can sort of play through i think factorio is the same way um anyways a pretty generous you you definitely get the gist if you're not liking it don't buy it but if you're like yeah yeah this is good um you know i don't remember a few dollars to to sort of do the in-app purchase to unlock it um and yeah play so shapes not really a tool but definitely fun

0:52:00.437 --> 0:52:07.660
<v A>yeah i'd be really curious how it works on the phone like how do you get conveyor belts to go the direction you want and everything

0:52:08.301 --> 0:52:44.279
<v B>i mean in general you click and it kind of puts it randomly but when you click the second time to sort of like connect them it it sort of figures out the orientation so it can be really fidgety like if you have oh this is if you have like two an output and two inputs separated by only a single square so like you know you have an output and then you have an input to oh this is very hard from video uh not video anyways if things are very very close to each other it's very difficult for it to determine what you're trying to do but it knows like oh if you're clicking you're probably connecting an output if there's an output in a adjacent square and then if there's an input

0:52:44.279 --> 0:52:46.034
<v A>in an adjacent square that's probably where

0:52:46.034 --> 0:53:26.740
<v B>you want to go so in general that gets you through the vast majority of cases but there are times where like there's two outputs that it could go to and it won't always choose the right one and i have hit some glitches with the tunnels like not like they look connected but they're not connected and so you have to like delete them and put them back in again um but yeah overall still i i don't know of any other game that is that cosign similar to uh factorial i gotta just keep using that one anyways that it's in that same direction than this and so it has helped me with this uh desire of mine and it was one of those ones where sometimes you want something and you get it and you're like that's not really what i wanted uh this one was not that so i've been enjoying it

0:53:26.804 --> 0:53:28.424
<v A>Oh, very cool. I'll have to check it out.

0:53:29.909 --> 0:53:35.477
<v B>It is better on a tablet than a phone, I will say, but again, I have my phone with me all the time and not so much the tablets, yeah.

0:53:36.119 --> 0:53:37.182
<v A>That makes sense. I have...

0:53:37.399 --> 0:53:38.319
<v B>Not tried it on my watch.

0:53:42.936 --> 0:53:45.180
<v A>Like zoom in? You have to use a little crown.

0:53:45.180 --> 0:53:47.155
<v B>To zoom while you're running? Yes, that'd be great.

0:53:47.307 --> 0:54:07.540
<v A>My tool this show is I can't believe we haven't covered Dwarf Fortress. No way! Speaking of things that cause anxiety or Fortress—you know, a game that has absolutely no saving but you will like frequently destroy yourself. I didn't...

0:54:07.540 --> 0:54:12.959
<v B>Know? You couldn't save? Wait, I've never played it before. I know I've read a much about it, but I've never played it. It's like...

0:54:13.902 --> 0:54:17.850
<v A>Minecraft, where you know the world persists and so you can't really go back. So...

0:54:19.504 --> 0:55:13.268
<v A>Like in Minecraft, you know if you accidentally burn your house down, it's gone. I mean, you can like, you know, obviously go in the file system and do stuff, but generally speaking, it's like it's gone once you make a mistake. But yeah, so Dwarf Fortress is on Steam. It's been on Steam for a while. Your Dwarf Fortress was free for many, many, many years. I think 11 years it's been in development. They went on Steam. They've sold enough copies to make them—I think something like eight or nine million dollars between the two of them, which is great. Um, they yeah, they asked Tarn Adams, you know how do you feel being like a millionaire? And his answer was like, well, you know I would have made twice as much if I had just gone to Google or something like that. It was pretty funny. He's like, but you know, um, you know I'm pretty happy to be making half of a bay.

0:55:13.504 --> 0:55:15.546
<v B>Engineer salary or something over 11 years.

0:55:16.035 --> 0:57:12.844
<v A>Oh dear. His answer is hilarious. He also panned all the game studios who are doing layoffs—really harsh, actually surprisingly harsh. I've talked to Tarn about AI stuff in the past and extremely like nice, charismatic, just really mild-mannered person. I don't know very much about the games industry so I don't have a lot of context, but in his interview he was extremely fiery about the games industry layoffs and how they are you know not treating their employees really well, which is endemic. I mean, I remember that being a problem when we were looking for our first job like 20 years ago. But regardless, so Dwarf Fortress is out. I tried the Steam version. It's very well done. It fixes a lot of the user experience issues you know of the keyboard-only version. It's not like a radical departure, you know. So, so like I wouldn't say if you're just if you're looking at it completely materialistically, you're not really getting your money's worth out of the Steam version. If you go and play the console version for free, it's it's not that different. I went and bought it, of course, because I've had so much fun playing Dwarf Fortress off and on for like a decade. The least I could do is throw Tarn like I don't know seven bucks or whatever it costs, but I would definitely recommend folks picking it up. It's a ton of fun. It has a high learning curve from a user experience standpoint. It got kind of eclipsed by RimWorld in my opinion. I feel like the UX on RimWorld is just so much better, and I do play RimWorld a lot more, but Dwarf Fortress is still a ton of fun.

0:57:13.452 --> 0:57:42.190
<v A>There's still really esoteric interactions between fluids and waters and dwarves and all of it. Um the funniest thing that ever happened to me was my dwarf crossbowman was blinded in both eyes but still wanted to be a crossbowman. And when he trained, the shots went anywhere, and like about one out of a hundred times while he was training his crossbow, he would kill like a

0:57:42.190 --> 0:57:43.658
<v B>horse or another dwarf or something.

0:57:43.759 --> 0:57:55.015
<v A>And even when he's not injuring the other dwarves, you could see the arrows just go randomly when he's training, which is hilarious. Um so very fun game, highly recommend.

0:57:56.753 --> 0:58:37.580
<v B>Yeah, this is a genre that you know, you just mentioned, RimWorld. People also say Oxygen Not Included. Yeah. Um and in Dwarf Fortress, I haven't dipped my toe into this yet. I don't know whether it's—I think the learning curve is too high or I'm too scared to waste all the time, but they're on my perpetual like one day I will waste time. I mean, spend, invest, invest my time and also generating epic stories. Dwarf Fortress and Eve Online are the only like games I've ever seen people like. I'm sure there are others, but that I just routinely get surface to me like just epic stories about. Um and yeah, both very complex games. Yeah.

0:58:37.580 --> 0:59:46.677
<v A>One thing about RimWorld I'll say for folks out there if you want to get started in this genre: get RimWorld. And there's a mod that lets you—so by default, there's like slow, medium, and fast time, you know? Most games have this. Like you could play in real-time or 2x real-time. Forcs. There's a mod that'll let you do up to like a thousand x real-time, and you wouldn't do that much, but basically lets you elapse time as fast as you want. Um I'm the type of person—I don't know if you're this way—but if I'm playing these like real-time strategy games, I'll want to basically like pause, do a bunch of strategic work, and then unpause. And I kind of turn it into a turn-based game, like when I used to play like Baldur's Gate One, for example. It was a real-time strategy, but I was just pausing all the time. It's basically turn-based. So I was doing the same with RimWorld, but then when you unpause it, you're going kind of at real-time, so you're just—you're just sitting there waiting to pause it again, kind of waiting for something interesting. And so instead of doing that, just make it like really turn-based by letting yourself go like 20x real-time. Hmm.

0:59:49.883 --> 1:00:13.420
<v B>I appreciate what you're saying. I don't—I don't know. I don't think I've ever done this before. I'm a pretty impatient gamer, so I think I would probably just suffer with it sucking at real-time and then complain about it. But yeah, all right. Well, for those of you who are wondering when the topic would show up.

1:00:15.263 --> 1:00:21.169
<v A>It is time unit tests mocking. Let's jump into it. So Patrick, what is a unit test?

1:00:21.760 --> 1:02:20.880
<v B>A unit test is code that you run to test a unit of functionality in your codebase. I didn't look that up; that's Patrick's definition off the cuff. Um but I think unit tests are one of those—I have never run into someone. I'm sure they are out there who has said they do enough writing of unit tests. Unit tests are supposed to break down your code into a single manageable chunk of functionality and no more, and then you put that thing under test. Um and you know, you can go hog wild with that statement, and you can end up in a sort of bad place in the design space in my experience. But I think you can go the opposite way and say, 'I'm never testing anything.' Make some excuse for it, and then you can have code that is just completely unmaintainable and it's very difficult to make changes confidently because you don't know what is going to break because you don't test anything before you ship it. We've talked about Continuous Delivery, Continuous Integration. You can't really do that unless you have some kind of testing, and unit testing is an important part of that in my opinion. Um and there are certain things that really cry out to be unit tested. Um And that doesn't make it easy though, especially as you start layering up functionality. It can be without foresight, and some of the stuff we're going to talk about—it can be very difficult to um test something that depends on something that depends on something else because getting the inputs just so that and you know it really exercises the thing you want to write your test for, and finding the corner cases you want to test can just become uh very difficult. I'll also say that you know I have run into codebases where it's a requirement to have full branch coverage, even right? So every if statement, you get to both the true and false. You know, for every for loop, you know, you have to test every single bit of the code in every path, and that is important in some context. I will say it is very hard from a maintainability.

1:02:20.880 --> 1:03:23.183
<v B>standpoint because if you want to make relatively simple changes, especially refactorings, you can end up with just an enormous mountain of like unit tests that have to also be changed. And so I will say I do think you can take unit testing too far. Um maybe that's a controversial statement, but just in practice I've seen that to be true. Um And you can also get the—I need to hit a quota of unit tests and so I'm going to write useless unit tests rather than the harder but more useful unit tests I should be writing, and so you can get people who—I don't want to say game the system. They're like, 'This code's not going to get accepted unless there's a unit test.' So I'm going to write a unit test that isn't really actually testing much or is testing stuff that's not frankly very useful rather than the extremes or the areas where it might break, or, 'Oh, this code if I test it this way is going to throw an error,' and I don't want to do with error handling. So I'm not going to test that part.' So I will say that being real with yourself and your team about what purpose unit tests are serving in your codebase is really important.

1:03:23.740 --> 1:03:47.078
<v A>Yeah, totally. I think if you're just getting started and you're doing maybe a personal project and you don't feel like you want to write unit tests, a good sort of—I won't call it a compromise because compromise makes it sound like you should keep doing this, but a good stepping stone to writing unit tests even in your personal project is just to like be really aggressive about failing. So for example, maybe there's

1:03:48.630 --> 1:04:26.279
<v A>a place where you take a list of IP addresses and you do something with it. Well, like if the list is empty, you know what should happen? Well, maybe you say yourself, 'Well, this should never be empty.' Well, fine. So put like, you know, if list empty then throw an exception, crash the program.' Right? Exactly. And if you put this all over the place, guess what? Your program is going to be constantly crashing. So be really frustrating. And so then you're going to say, 'Well, you know, I need to—you know, I can't deal with it like this. I need to before I ship it.' You know, get it to crash. And that's what a unit test really is all about. That's a great.

1:04:26.279 --> 1:04:48.580
<v B>Tip actually. Yeah, there's a separate thread there which we should just not go into about what happens when you encounter unexpected input. Should you report it? Should you throw exceptions? Should you just crash? And it's a separate topic that's also a very controversial and thoughtful thing about what do you do when you encounter an input that do you check it? Do you expect it? Do you anyways?

1:04:48.580 --> 1:05:39.044
<v A>Yeah, I mean maybe you write a unit test. Um so you know what I've heard, and this is again we're speaking for experience here, so this is not an academic exercise, but I've heard basically of three kinds of tests: you have unit tests, which is what we're talking about today; there's regression tests where you're testing kind of a broader piece of software like that has many branches and many if statements. And so it's it's testing like a bigger piece where you don't expect to really get high coverage but you're expecting to see kind of interactions between different modules. Then you have system tests where you're you're really like you're calling, you know, into main with like a certain input and expecting a certain output. That's more like a black box thing. Um how do you break down tests? Is it similar? Is it different? Yeah.

1:05:39.263 --> 1:06:51.032
<v B>I think that sounds about right. In a similar vein, I guess it is. And this will lead into sort of the other part we want to talk about. I think when it's small enough, you are able to create truly synthetic data and, you know, at each module you purposely construct something. When you get to some level of complexity—I don't know, make something like FFmpeg. So FFmpeg has all these math functions, right? You can feed it synthetic data to those math functions pretty easy. Whereas synthetic—like what is what would it mean to synthetically generate like an, you know, MP4 video that goes into FFmpeg and check that the, you know, AVI with MP5, I don't know, is that a thing? A codec coming out the other side? Like how would you if you think about that? The syntheticness of the data is best when you kind of keep it small. And when you get to so-called like golden data sets or just making sure it doesn't crash—right? Make sure you give it some input and your program does something but doesn't crash or throw an error. Um that's when you start to move off of unit tests onto some other kind of test, and being careful about which goes in which bucket. But I think it's similar to what you're saying; it gets to be a regression test or just a full end-to-end test.

1:06:52.146 --> 1:07:30.284
<v A>yeah that makes sense um all right so when you're writing unit tests you will eventually run into this problem where you want to unit test something and that thing makes an rpc to a database or checks the system clock or does one of these things and you will say to yourself like how how can i unit test this right and so the wrong thing to do is to like only run your unit test at like 7 58 p.m and it only passes at that time that that is uh that is not robust you're going to have all sorts of problems um you know you

1:07:31.920 --> 1:09:01.223
<v A>might also have your unit test you know actually query the database this is also a problem because if your database goes down your unit test starts failing um your unit test might query data that might not exist tomorrow and your unit test will fail for that reason right and so as patrick said the unit test we're not testing my sql like my sql is good you know they have a bunch of people testing it already you want to just test your code that calls my sql and so what you need to do is is you know test your code but um you know not test the my sql part which is right in the middle of your code and there's really two ways to go about this you have faking and you have mocking um now faking is is uh pretty clear um so for example let's say you um have a function that gets the you know the time of the day and does some stuff to it right so instead of calling like the you know time function the low level kernel you know time function to get the time inside of your code inside of your function ideally you pass in the thing that gets you the time so you pass in could be a function pointer or you could wrap it in a class but imagine you pass in like a clock handler class and

1:09:03.012 --> 1:09:26.535
<v A>the real clock handler just calls the time function and returns but you could pass in anything any class that you know inherits from this clock handler task so so you could make a a fake clock handler class that extends the clock handler class except when the when when it asks for a time it always gives you you know 1980 or something

1:09:29.303 --> 1:09:44.541
<v A>um and so now you have uh this ability to have a repeatable you know time every time i call the time function i get exactly the same thing and so my unit test now is totally repeatable that's that's faking and that uh is one way to

1:09:44.946 --> 1:10:16.148
<v B>do it i think uh also i i think i believe this is called dependency injection so dependency injection is like like you're mentioning is that you're injecting the thing you want to depend on rather than it sort of like being inherent so rather than a class owning an instance of my sql you pass in a pointer to a my sql like object and you know you're injecting the dependency normally at construction time or at execution time i also has benefits for other reasons but it is definitely useful for for testing yeah

1:10:17.144 --> 1:11:14.265
<v A>totally totally makes sense yeah i mean you know if this function is already taking like the my sql client then you don't have to do a whole lot but you're right if if um if you're using for example a my sql singleton then you're going to have problems right because you have to somehow fake out that singleton and um and that's actually a good segue to mocks so imagine you have a singleton and you want your um you want you know that singleton call to be faked out um you can't really create a fake singleton i mean maybe you could with some really clever pointer stuff but generally you know you can't just replace that singleton with something else but you can use kind of a mocking system to handle that um so patrick how would you describe the difference between fakes and mocks so the

1:11:15.615 --> 1:12:25.461
<v B>way i've seen it before is the mock and and this is probably wrong so you're gonna have to you know step here is the mock is generally a way of trying to use reflection or automated uh method sort of mirroring mocking right so you have an object and rather than sort of like you're saying a fake whereas i custom build another class and then i have some you know interface that i'm inheriting from or some you know abstract class instead you're saying hey i have an existing class i am going to script the way that that class is called and i'm just going to create a sort of automatically generated version of that that looks the same and so you can uh sort of via various mechanisms depending on languages you can lie to the runtime and say hey this is that class except you've said expected this function to be called and then that function to be called and now you're you're sort of like testing two things you're testing that the output is correct but you're also testing that the interaction with that object is correct at the same time because you've scripted this mock which is is you could do in a fake but you would have to do it sort of from scratch yourself rather than using a framework for

1:12:26.507 --> 1:13:59.980
<v A>doing yeah i think you did a great job yeah basically uh a mock is just taking fake to the next level so um yeah so just continuing the the time analogy yeah i think you had a great way of explaining it if you know if i create the fake clock and i just return 1980 every time you know that's great my unit test will pass or whatever but what if there's a bug later where somebody maybe uh this gentleman jatan who's trying to like illegally break into ssh maybe he goes through and takes your function and tries to like literally make it return 1980 all the time and not even call your clock handler um you know your unit test will just continue to pass it's not going to catch that so ideally you know a fake clock handler you know you could in the unit test say hey here's my fake clock handler and i expect the get time function to be called exactly once um and you know the way you would implement that under the hood if you're using fakes is you know the fake clock handler keeps a count of how many times you know the get time function was called when you call get time it increments that count returns 1980 and then at the end you could check the count right so again you could do all of this with fakes what mock does is do all of that for you so mock keeps track of all the times all the functions were called that you're interested in um it just has all of that scaffolding done for

1:13:59.980 --> 1:15:15.055
<v B>you um yeah i guess like to try it which which is difficult i'll try another way to motivate it if you have a logger which do tend to often be singletons or whatever your code may have a contract that says you need to take the square root of this value but if you can't okay it's negative because you know you're not supporting complex numbers you should return an empty sort of optional nullable thing but also log an error to the logger that unit test is going to be difficult to write unless you mock the logger because now you want to test two things you want to test the return which is normally what you think about with the unit test is controlling the inputs and checking the return but here one of the inputs actually needs an additional action performed on it right the logger could be an input but it needs to have a function called on it and so this is where you know you're not just checking how often it's called you're also checking like it may be part of the contract that in an error the error needs to be cleared from the mysql connection and so if you if you cause an error to happen you need to you need to make sure that it gets cleared and if your code maybe has returns an exception too early and doesn't clear it then the next piece of code can't continue and so then you the mock is going to help you there be prepared to check those

1:15:16.320 --> 1:15:53.648
<v A>things right yeah that totally makes sense um another thing that mocks will do is and this is kind of language dependent but sometimes it'll save you from some of the like inheritance problems that you can run into so you know like python for example has magic mock and um you know python is not strongly typed which makes this a lot easier um but um but yeah you can run into some you know kind of challenges when you're trying to fake certain things and magic mock will will just kind of take care a lot of that for you magically as the name suggests

1:15:53.749 --> 1:15:56.972
<v B>So it'll do some weird Python voodoo which

1:15:56.972 --> 1:16:58.262
<v A>I've definitely never dove into, but it will basically allow you to stub out things that might be really difficult—like global function calls, you know, crazy things with polymorphism. So, you know, I would say as far as maybe jumping over to we've kind of explained what they are going over to sort of how to use them. I think as a beginner, you know, we talked about failing often in your functions, you know, like before just using the first element of a list, check if it's empty and if it's empty, just fail—like fail really loudly. You know, that's a nice stepping stone to unit tests, and then unit tests will kind of naturally lead you to mocks when you start, um, you know, kind of testing things that that uh. So I'll give you another example: networking, right?

1:17:00.794 --> 1:18:43.000
<v A>So when you make a networking call, you can get a whole bunch of different errors. You could get, you know, error the network wasn't initialized correctly. You could get uh, you know, SIGPIPE, you could get EPIPE, you know, both of those meaning like different parts of the connection died—like the connection to the kernel could die if you're trying to create too many TCP connections; the connection from your machine to another machine could die. That's EPIPE, and it can get, you know, really difficult and cumbersome to kind of catch all of these and handle them the right way. And so your your um your magic class, your magic uh, you know, NetworkHandler class will just get more and more and more complicated. Um, and you can actually see this in Eternal Terminal where I have a I have a fake—I think it's called FakeNetworkHandler or no, FakeSocketHandler class, and it's just obscenely complicated. Um, and so I think, you know, most of that complication could be burned down by using a mock. And so, you know, being really aggressive on failing when you get things you don't expect will kind of naturally lead you to fakes, uh, you know, to unit tests and fakes. Um, and then fakes will lead you to mocks as long as you know about them. Uh, you know, I think this is actually a kind of a meta point, but you often see people—and we're definitely guilty of this—like just doing the hard thing because they don't know about the easy thing. You know, are they? This is one of these examples where you can end up making really complicated fakes because you don't know about mocking libraries that are doing a lot.

1:18:47.747 --> 1:18:50.059
<v B>Of that for you. Yeah, I maybe it's a language thing. I will

1:18:51.764 --> 1:19:10.340
<v B>say um Java builds were pretty complicated, so using mocking in Java for me was—I don't know, it's like a no-brainer—but it wasn't any worse than, you know, oops, we were already jumping through. I will say I have not used mocking in the C++ stuff; like getting a unit test sort of thing set up was I don't want to say bad enough and requires maintenance.

1:19:12.773 --> 1:19:59.860
<v B>Yeah, but we tried to do the mocking thing for a while, and just the way that it requires you to sort of do it at the build time and interrupt and it just as the juice isn't worth the squeeze. Like it was very difficult for us. So I think I will say knowing about it is very important because there is a bridge, and depending on the kind of thing you're interfacing with, that trade-off could be very different. Um, if you, you know, have one thing faking it could be an option. If you have, you know, 15 different services that all have like different kinds of return codes that they could give you and this kind of stuff, right? Then that grows, and and the trade-off becomes different. But I think dependency injection, unit testing, and mocking—whether you do roll your own whether or I guess mocking versus faking—whether you roll your own or use a like existing framework or library.

1:20:01.778 --> 1:20:19.719
<v B>It, I different ones of them have different balances, but I think it is one of those things that with experience and with your build setup and in your instance your answer may be different, and sort of making a blanket statement can get you into sort of complexity you didn't want to be in.

1:20:19.719 --> 1:21:13.007
<v A>Yep, totally agree. Yeah, I think, you know, Java is so verbose um and prescriptive that I think mocking makes more sense because every fake class is now adding like hundreds of lines of code. And C++ you know where you can kind of do various tricks. Um yeah, I used I used Google Mock at Google, but uh um but yeah, I mean if I you're just I'm thinking about it critically now, like if I went back and used fakes, I think uh it would be pretty much a wash. Um so I think for C++, mocking is, you know, you can get away with a lot more using fakes, and so that makes mocking less useful. Um for something like Java where you can't really get away with a lot, um I think mocking, you know, becomes more useful there. We didn't

1:21:13.767 --> 1:21:50.385
<v B>put it in the title, but I I will say dependency injection is one where I've never used a framework. There are frameworks for it. The concept, I think, is important to understand and know, but I will say the frameworks come—there is an appeal, but there is a hurdle to jump over uh before using them. And sort of like in the extreme, you know whether you inject a PostgreSQL or MySQL client, you know, at runtime via config is kind of cool, uh but you know the the trade-off, the the cost of doing that is they are in my experience they've been—they're

1:21:50.672 --> 1:23:06.036
<v A>pretty cumbersome. Yeah, I mean, I've always despised dependency injection frameworks. So we used uh the Java one; you probably use the same one. Um I forgot what it was called, but you know it's just such a pain. Um you know in general things that like generate code or like code paths—not things that generate code, like Protobuf is amazing and it generates code, right? But this kind of thing where like you read a config file and it like you know just autonomously spins up different classes depending on the config file, it's just always so much more trouble than it's worth. Um you know, and then you have like uh you know this decorator dependency injection, but you still have to kind of say what you want to inject. Um Yeah, I'm not a big fan. I mean, I think the concept extremely important, right? Like, you know calling the Unix time function in your function directly is going to make that function now almost impossible to test, right? So the concept of trying to keep things stateless and and passing in different handlers—um that's great. Uh but the dependency injection of frameworks, I personally haven't had a good experience.

1:23:06.036 --> 1:23:06.840
<v B>with them.

1:23:08.483 --> 1:23:11.504
<v B>Yes, I think juice is the one is juice that's

1:23:12.111 --> 1:23:15.520
<v A>Right, oh man, I'm starting to get PTSD now. Um, so yeah.

1:23:18.237 --> 1:23:20.532
<v A>I'm not a big fan of juice.

1:23:21.629 --> 1:24:42.848
<v B>I think we—we wove it in. I will say if you get to the point where you think you're going to write one of these yourself versus using a framework because the framework is too big of a hurdle, I think you got to have a sit down like, are you just suffering from Not Invented Here? I'm not saying that. I'm just—you got to really be honest with yourself there. Yeah, that's slightly different. So writing something that's a series of macros or, you know, code generators whatever yourself is a large undertaking and likely you end up in a very similar destination unless you know that there's some reason you're not going to pattern match to one of the existing solutions. You're likely to end up with the same trade-offs that they do. Um, that isn't the same as choosing that one of those frameworks is too heavyweight for your situation and so you're going to sort of do it manually. I think that is a valid trade in this space—not in all space, but like in this space. I think you know this is a valid trade. I've never seen someone—well, I shouldn't say never—I do hear people all the time for serialization say that they're just going to do it manually and that go very wrong rather than use ProtoBuf or an existing sort of, uh, you know, serialization library. So I wouldn't say the trade is the same here, but I have seen people do sort of dependency injection and mocking and, you know, testing and faking sort of on their own, and it can be the right tool for the job.

1:24:44.012 --> 1:26:13.940
<v A>Yeah, yep. I mean particularly if you're doing faking, you're almost certainly doing it homebrew, right? Because at the end of the day it's just a class that extends your class. Um yeah, it's a good point. I think that's a really good dialectic. I think you know if you're doing serialization/deserialization, you really don't want to write that yourself for a number of reasons. You know, one, if you mess up serialization and now you have this bad data that you can't fix it. It's like if you went out—like imagine you're building like an automated AI stethoscope or something and you're harvesting a bunch of data to improve your product. Well, if like you collected the data, you know, you didn't serialize it correctly and all that data is bad, well, like you're just out. Um and if you already ship the product, you're just toast, right? So on the flip side though, um you know testing hopefully is one of these things that is like very agile, very repeatable, and so you know switching testing frameworks isn't a big deal. You're not really out. Um you know a bunch of time and energy it's not something you can't recover from. And so yeah, starting small building yourself up to eventually using, you know, fakes and mocks and getting more and more dependencies kind of injected versus using a bunch of singletons—these are all things that you can improve over time, and so you don't have to jump into some like commodity solution.

1:26:16.200 --> 1:26:19.845
<v B>I'll also just throw out the word at cryptography: Don't do your own.

1:26:20.048 --> 1:27:07.980
<v A>Cryptography. Oh my gosh, yeah. Do not ever do your own crypt. I actually um there was a set of cryptographers or security engineers or something who evaluated Eternal Terminal and they were like kind of rude. I mean, I—I'd just to be frank, I mean, I don't know if you're listening, but they were uh they were like a little bit just kind of like harsh. But then they saw that basically I was just calling LibSodium. They're like, okay, they kind of went away, but I could understand. I think if you if you build your own cryptography, you're just kind of asking for it. Do you remember the um I was translating all the programming throw-in episodes to Hindi? Yes, which is something folks should check out. We probably talked about it.

1:27:08.310 --> 1:27:09.947
<v B>Right. Yeah, yeah. We briefly. Yeah. Okay.

1:27:10.319 --> 1:27:23.228
<v A>But um so I went back and listened to the first episode as part of doing this. Well, the first thing we talk about is actually uh Sony trying to implement their own cryptography and there's oh, is that?

1:27:23.228 --> 1:27:25.101
<v B>When the PS3 keys got hacked? Yeah.

1:27:25.253 --> 1:27:38.196
<v A>That's right. There's a place they were supposed to return a random number. They returned five or something. Yeah, I think ProtoBuf, LibSodium—don't try and compete with these. There is.

1:27:38.635 --> 1:27:49.232
<v B>Something interesting about oh no, that's a whole never mind. We don't have that like current gen consoles and the keys and I will say they seem to get jailbroken whatever you want to call it like it.

1:27:50.987 --> 1:28:20.333
<v B>takes a lot longer than, you know, back in PS2, PS3, whatever DVD like these kind of things that you know needed a key and the key was like I don't know. I'm not it's not my space, but it just seems I hear a lot less of the news about, you know, private keys for what is it now, the Xbox X? Anyways, yeah, you don't hear those those news articles as much and so somebody somewhere must have upped their game or they've learned from their lessons, and I don't think the same situations apply. Yeah, I.

1:28:21.869 --> 1:28:32.517
<v A>I think they've upped their game. I mean, I think that they have hired a lot of people who like used to work on bank software and these kinds of things, and they just don't mess around anymore, I guess.

1:28:33.664 --> 1:28:39.604
<v B>Say, like if you're one of those people, reach out. It'd be cool to talk to you, except that like you probably aren't allowed to talk about anything interesting. Yeah, exactly.

1:28:39.672 --> 1:28:42.440
<v A>Yeah, like when you retire, reach out to us.

1:28:44.228 --> 1:28:47.991
<v A>I saw someone—now we're getting pretty meta—but I saw someone on LinkedIn. Um, they...

1:28:49.746 --> 1:29:17.877
<v A>Uh, they recently left a job, and it was like one of these things where you buy and sell stocks, like what's it called? Quantitative trading, okay, something, but hedge fund trade. Yeah, and uh they basically had to not work for a year, and they literally put in their LinkedIn job history: 'One year waiting for non-compete to expire' was their job title for that year. And uh yeah, I guess that's still a...

1:29:18.315 --> 1:29:27.968
<v B>Thing. Yeah, I think there's like they call the alpha or whatever, which is the not explainable market return advantage your trading strategies have. Um so the verse that...

1:29:27.968 --> 1:29:31.360
<v A>which would be beta, just you know market goes up.

1:29:31.495 --> 1:30:31.907
<v B>We go up. Um alpha, the alpha that you have has a half-life to it. So if you work at one of these, you know, big hedge funds or private head fund, or your head fund just wants to seem like they're as good as everyone else, you have this like knowledge at that moment: 'These are the trading strategies we're running; this is what we're looking at.' They want that. You know, they're basically willing to pay you to keep you from taking that to another firm because again, like they'll just—then you would just take it to those people. It'd be very hard to prevent you from doing it, and then the opportunities will close because now you have someone who's in there bidding with the same knowledge as you, and so the prices will go up. And so yeah, I think in the finance industry, those things are especially—those trading are very common whereas like you or I, like if we left, someone could sue us if we when that happens in the news from time to time, like you know, you took a trade secret, but there's not this like at the moment. These are things that are directly being exploited to extract profit, and other people knowing them is instantly detrimental to our bottom line. Yeah, I...

1:30:32.920 --> 1:30:36.632
<v A>Didn't realize they paid you for that year. That's pretty awesome. I don't like.

1:30:38.420 --> 1:30:50.723
<v B>Golden parachute. I think. I don't know how it's either, like when it's worked in, but it's something you kind of know going in. Basically got it makes sense. I've never had one of those offers if anybody wants to like pay me a year to not work.

1:30:50.723 --> 1:32:16.330
<v A>Reach out. Yes. Yeah, that sounds awesome. Um sign us up. Well, any last thoughts about—I'm trying to think if there's things we didn't quite come oh, and kind of an adjacent thing. Um if you haven't already, out there check out GitHub Actions or, you know, it's amazing. You know, I use that to run all the unit tests on Terminal, terminal every time anybody submits a pull request, it runs kicks off like 12 GitHub Actions that go and run a bunch of tests. Um and in general, it's like it's free compute, free compute from GitHub. Uh, I mean, don't use it to mine Bitcoin or anything like that; they'll ban you. I've heard of people trying to do that and getting permanently banned from GitHub. Getting permanently banned from GitHub would be absolutely destructive. I mean, I guess you could always make another email account. I don't know really how they enforce that, but it just sounds like one of the worst things that could happen to an engineer. Uh, so don't do that. Um but you know, as long as you're being—you're being honest about what you're doing, GitHub Actions are amazing. I have GitHub Actions to build MAME and MAMEHub. Um it takes like about two hours on a four-core machine or two core machines, and so um so uh it's it's a phenomenal product, and so you know once step one: write unit tests; step two: use GitHub Actions to kick off all your unit tests.

1:32:17.511 --> 1:32:41.828
<v B>Yeah, I guess I do have one other thing before we—we think our patrons, I guess—is we didn't talk about it, but code coverage tools. Um you know, I spoke about not going for branch coverage. I will say not to overstate it: if you write unit tests and you never run or attempt to run code coverage, it's sort of like debugging by print line versus, you know, using an interactive debugger.

1:32:43.667 --> 1:33:00.306
<v B>Think you're testing one thing, and you run code coverage and you realize you're missing whole swaths of functionality. Or but it's just running them hand in hand if possible. It's just like a completely different experience than writing unit tests with no feedback on what lines are actually running in your units. Yep, yep.

1:33:01.724 --> 1:33:06.803
<v A>Yep, totally agree. Um yeah, I mean maybe that's a whole another show, but there's

1:33:06.803 --> 1:33:10.020
<v B>I was gonna say, I have to drop that late, but I totally blanked on.

1:33:10.020 --> 1:33:42.375
<v A>Yeah, amazing code coverage tools. You know folks, Google it. You can find them. There's they integrate really well into GitHub, same kind of thing. They run automatically; you don't have to do anything. And yeah, that's—yeah, we should definitely do that as a separate topic, but that's a really good point. You know, and the other thing too is you want to have some kind of validation, you know, when you run a when you write a unit test, you want to see that it actually made the code a little bit safer. So code coverage is a good way to just give you a number.

1:33:42.375 --> 1:33:42.730
<v B>of them.

1:33:45.835 --> 1:33:47.033
<v B>thank you to our

1:33:47.691 --> 1:34:12.582
<v A>patrons. Yeah, thanks folks out there. A lot of interesting emails. Someone asked us to cover Laravel, which I haven't heard of in years, but I guess it's still popular. It's like a web framework type thing, so we might have to go off and do some homework on that. But yeah, tons of email, tons of great support. Thank you for folks out there. Uh no, we're not going to just talk about the show topic. That's not going to happen. Are we going

1:34:13.341 --> 1:34:19.197
<v B>to put up a countdown timer to when ChatGPT just generates all these podcasts automatically? Oh, how do you

1:34:19.872 --> 1:34:21.542
<v A>know they're not generating this one are?

1:34:26.099 --> 1:34:39.210
<v A>You a robot? Um all right folks. It was really great covering another cool topic. Shoot us more topics. You know, a lot of these topics come from you, so you know when you email us that turns into shows. So thank you so much. Keep doing it. Thank you.

1:34:41.303 --> 1:34:58.960
<v B>to everyone who lasted this long. Music by Eric Barndoller.

1:34:58.960 --> 1:35:18.740
<v A>Programming Throwdown is distributed under a Creative Commons Attribution-ShareAlike 2.0 license. You're free to share, copy, distribute, transmit the work, to remix, adapt the work, but you must provide attribution to Patrick and I, and ShareAlike in kind.

