#014 - Building the Best Tools and Tests with The Primeagen

Download MP3

The Primeagen
===

The Primeagen: [00:00:00] Hold on one second. There's a fly right in front of me. Hold on. I got this. Go. We got 'em.

Lane: how old were you when you first started coding?

The Primeagen: When I was a young buck, sixth grade there's this game called Grail Online, or Graal, as some people called it. It was effectively a Zelda, super Nintendo Ripoff.

Let's see, online. I don't know if I could find it, but anyways it was, oh yeah. Oh yeah. This game was just great back in the day. So I was like sixth grade,

and you could,

you could actually,

here you go. I, I think I got a little, little image right here. Like this thing right here. It's just like

a very,

Lane: is like some RPG maker

Prime: Yeah.

So some of the very old ones, the ones that do not look cool, like this right here, this even that's too new, right?

So it's it was some of the old, old stuff. And you could, there you go. Like this right here. There you go. And you could just make your, ah, look at that. That one's perfect right here. This one you could just, you could just make your own levels. And then there's these things called NPCs and the NPCs.

I didn't know [00:01:00] what an NPC was, but I learned that's a non playable character, right? not just someone who makes really out of context tweets. It's actually a reference to something in the nineties apparently. And so I, I started looking at the code in them cuz you could like double click 'em and there's like a script.

And I knew nothing about code. I knew nothing about

Lane: Wait, so hold on. Back up. This is like an executable game, like

where does this

Track 1: play. And there's a l there's a level editor and I started

playing with the level editors when you click on NPCs, that a script would come up.

And so I thought

Lane: it.

Track 1: I can figure that out. And so I figured it out and I figured out what if statements

The Primeagen: were, and while Loops and,

Track 1: and all sorts of stuff.

And started making my own little, little, guy started playing with some math functions, all that kinda

Lane: Was it growl specific or was this like a programming language we would recognize?

Track 1: You if you looked at it, you'd go, I know how to, I know how to use this. I know how to use this.

It, it fits right in with say Java or JavaScript or c or anything like that. It just has no concepts of like point I at least I didn't, I don't know if it did. I'm older now and I understand those concepts, but back then I didn't have [00:02:00] any idea.

So it

is what it

Lane: And you've maybe lost the source or haven't gone back and checked,

Track 1: Oh not only have I lost the source, but that was like Windows 98 material. There's, I, I'm not even exactly sure if I could even find it.

Lane: What, what year were you in sixth grade? When was this?

Track 1: Right around Windows 98 99, somewhere right in there,

Lane: Okay,

cool.

Track 1: 2005 high schooler. That's when I graduated. So whatever that is, that means 2001, I think I just got done from eighth grade to ninth grade. By the way, eighth graders, worst people on the earth. So that must mean, so then, yeah, yeah, yeah. About sixth grade was right around that 99, 98, 99 time.

So there you go.

Lane: Yeah, middle school is definitely the worst, the worst part of my

life. It's not even close, actually. So I get that sentiment. Middle of the.com bubble, you are in sixth grade learning to code with, with some unknown language. Pretty cool. What, where did you go from there? Did you, did you code during high school?

Track 1: not really. I took a coding class like senior year or something like that. Built a little blackjack, game Q basic. Shout out [00:03:00] to Qba. I was pretty good at it. I had a real, I had a real bug though. I'd had a production grade bug in that one, which was, if you call, there's, if I remember this correctly, I could, I haven't touched Qba in 20 years.

Okay. So just forgive me if I get some terminology wrong, but I think there's these things called they weren't modules, I think they were called declarations, where you could effectively define a couple functions or something, and then you can pass state around. And if you call from declaration to declaration, it keeps increasing the stack.

So you can't, so I had this effectively, I just had a loop that I was running, calling from declaration to declaration, doing stuff. So I'd wait for input, then I'd call the next part, then I'd call the next part. And I just created a nice little spaghetti monster and did that. But if you played the game long enough, you'd get a stack overflow cuz it, it just kept adding to the stack.

And so I had to rewrite my entire program to become like a a, the main file, main function, wild loop and then do it in kind of like a not spaghetti style and like refactor. And I did it and it was really, it was, it was a good experience. [00:04:00] I really got a whole new perspective on stuff where it's like I just went from a spaghetti into like maybe more of just like calling things out one at a time.

Lane: Yeah, that's cool. I don't think I en encountered the process of refactoring like for a very long time. Like when you're learning to code, I don't know, maybe, maybe people are smarter than I am, but what I was learning to code, like the last thing on my mind was like keeping the code clean and refactoring things was like, does it work?

Done? All right, send it.

Track 1: Yeah.

Lane: that's cool that you had that I guess it was a bug, but you had to restructure your code to get it fixed, which is.

Track 1: Yeah. I've always, I've always felt like I had an eyeball for, for APIs. I don't know, I always I liked things that felt good when I programmed them. It wasn't like a pain in the ass to do it. And so I'd always find myself, even when I was just learning how to program, like refactor things into into different methods.

Now how I approached it was crazy, right? I've, as I started to learn to code and went to college at some point in my life, I, I, I swear I made a video game with C that had seven layers of inheritance. Crazy, right? Just, just [00:05:00] nutty. But I still did it. I still tried it because I was like, this is what you

The Prime: do.

It's OOP it's enterprise.

Track 1: We're making video games, X and A, let's go. And so it was really, really disgusting what I made. But nonetheless, I've always wanted to try to make it so that there's this weird obsession I have where I want to be able to call something in a single line, do the thing.

Like I want to be able to write

really simple imperative code or a procedural code at the very end. That's, I think

my ideal situation is simple procedural code at the end.

Lane: And when you say at the end, you mean like at the like top level of whatever program it is. So like the main

game loop or The http handler or like

whatever.

Track 1: the side effect, so

whatever that is, the place in which I now have to do the thing, I want it to be really pretty.

Lane: yeah. That makes sense. I think, I think I think about it in, in a really similar way.

Track 1: Cause

the more

Lane: had a more elegant way of,

Track 1: end part, I think the easier it is to extend your program. As someone who has had the right way too many tools at this point. Something I find is that the more I can break down things [00:06:00] into just, like this is just standard program, right?

You break it down into decently good, logical thoughts. And you try never to mix too many logical thoughts. Sometimes you have to, right? There's just not, like sometimes you're like, I have to go get data from 17 different sources and this needs to happen in three different parts of my program.

Eventually there's an Uber function called get17SourcesOfData then you need four different versions of it and you're like, ah, I screwed this one up. I know it, but I don't know how to fix it. That just exists in all programs, or at least a good majority of them. And so

I try to make the breakdowns good, but also the sucky, but necessary functions also somewhat thought through such that it ends with just like you just procedural out or I mean declarative out really,

whatever one you wanna do.

I don't care.

Lane: What always gets me is it, it like coming from the go, the, the context of the go programming language. Like sometimes I need to do a bunch of unrelated things, but I definitely want to do them at the same time. So I like, have one function that's like spinning off all of the go routines. And that can get pretty hairy. It's always a trade off, sometimes between [00:07:00] simplicity in your code performance what a pain in the ass.

Track 1: Yeah, that's one thing that makes something as simple as JavaScript. Nice. I don't, I don't, I'm sure you could just make it and go really simple. I'm sure. I'm positive actually, now that I think about it, that I am positive you could do something that is as simple as a

The Primeagen: effectively promise.all()

where it's

Track 1: just go

WaitGroup All these things return all the results in in some sort of array, but you can't do heterogeneous lists really easy. You have to do that stupid interfacing typecasting. I like to get it all done, but you get the

Lane: Yeah, yeah, yeah. yeah. Error groups. Shout out to the error group package in the extended, it's not the standard library, it's like the Google extended standard library or whatever. Great package. It's

basically promise.all() with nice

error handling.

Track 1: Oh, that's nice. That's nice. So it's promise not all settled where each individual one gets its own air handling and make some decisions.

Lane: yeah, so like with the original, with like just a standard WaitGroup you have to like, make up your own bullshit error handling. But with this error group package, like you [00:08:00] make a bunch of function calls and each one returns its own error, very standard kind of

Go syntax. And at the end, if any of them returned an error, then it just returns that error.

Track 1: Okay. That's beautiful.

Lane: yeah, I love it. I love it. Cool. Okay. A and just as an aside, I have to respond to this. Good Lord. Seven le, like seven layers of inheritance. I. Anything more than three, and I want to kill myself.

Like

Track 1: all been there though. You're young, you gotta explore.

Lane: Yeah, but no, like this exists in production code. This is

not just young people in their side projects. This is

Track 1: The thing is, is that you, the, the problem is, is you know, this is why I try never to be like super prescriptive in the things I say other than I say just don't use extends just because it is. And that's fairly prescriptive, but I don't care if you classes POJOs you know those functional bros.

They're like, I don't, I don't do classes. But then they return objects with attached functions to it and you're like, oh, okay. I sure you don't do

classes

Lane: That looks like a method to me.

Track 1: That seems strange that you have an attached function to an object. Hmm.[00:09:00] But anyways, they, it's that whole concept where until someone shoots themselves in the foot, they don't realize they're holding a gun.

So it's you gotta go let it, you gotta go shoot yourself in the foot. Go for it. You gotta do it. Here's some basic tips and tricks of the trade. Careful about inheritance. I'm sure there's a good use case for it. I've only seen one

and

Lane: That, that's actually a really good point. You ha have to suffer through the bad mistake. Other the only alternative is to listen to a podcast like this where me and you talk about what we think are bad mistakes and you just believe us. And like later on you might parrot and say that it's a bad mistake, but you don't really know why.

Like No, you actually have to go do

it and experience why it sucks. And who knows? Maybe you'll decide that it doesn't suck and that you know me and you are dumb.

Track 1: Yeah. So another one of those big tips I have, I know this is we're weird on our topics right now. I know you have a list of questions, but I'm just gonna keep on going.

Lane: No, no, that was great.

Track 1: like one of my, I think one of my favorite tips is build functions as if you're going to unit test them and you're not

The Primeagen: allowed to use [00:10:00] mocks.

That's

it

Lane: Mocks are the devil.

The Primeagen: Mocks are the

Track 1: devil. They're always the

devil.

Lane: I wrote a huge article on this like a year and a half ago. Anytime I see a unit test injecting mocks, I, want to die. I want to burn it to the ground. It doesn't make any sense to me, and I, I get all of these explanations about, I don't know, maybe I need to interview someone.

that likes, mocks,

because it seems like anytime I really start talking to someone about it, it's like there's nothing there. Like we're testing code that doesn't run in production. Why are we doing this?

Track 1: Yeah. I to me, whenever you're getting into that state, It really what it says to me is that you didn't write your code in such a way that the input to your function is creatable, right?

You shouldn't mock it because that's just, it's baloney, but like I should be able to create that thing and hand it into the function.

That means really what you've done is you've mixed some form of io That's usually like the biggest

culprit is some IO is also within a function that does some sort of data processing. Just make 'em separate. Life's great, and [00:11:00] you know

what? When you're building tools, the the real deal is that sometimes your data comes from the command line.

Sometimes it comes from standard in, if you just build it that way early, all those others dumb things that you may do, that you may need the mock out later or may need to create like an integration testing suite. By just simply separating out those two things and just having the data manipulation as a function versus the data retrieving as a function.

All of a sudden things are way easier to test and even though I probably wouldn't write a test for 99% of it, I write code in such a way that all my functions are testable.

Lane: Yeah. I couldn't agree more. I'll link that article that I wrote down to the comments. It basically says the exact same things you're saying in in text form. I, I don't know why we do mocks. And, and just to reiterate it for anyone listening a a lot of my listeners are like pre-first job. So what we're talking about here really is. Hopefully we're talking about the same thing. It'd be really embarrassing if we're not. But imagine a function that like grabs a user from the database, does some transformation on it, and puts it somewhere else.

You might be tempted to make that one function [00:12:00] and unit test that larger function that at, say at the top of the function, grabs the thing from the database, then does a transformation and then puts it back in the database.

Where, what me and Prime are really advocating for here to literally just shove words into prime's mouth is that you should not test the database part. Just test that transformation part, right?

Take that transformation part. Make it a function, give it an expected input and expect it output, and you'll be good to go.

Track 1: Yeah, I, that's, that's exactly right. Really what it is, is let's make good separation because truly you have two logical thoughts going on in that function. You have a retrieval thing which can fail. It has its own logic, has its own stuff. That is its own thing, so just make it its own thing. The taking a and turning it into B is its own thing.

Make it that thing, and then that way we can test handing an A of the different types of A that are available and the different types of b that can come out a nice good black box testing and just call it a day. If you even

even if it's sufficiently complicated. I have a kind of a rule on testing as well.

If I can't get it right in three tries, I need the test. It

Lane: Yeah, that's a pretty good rule. [00:13:00] I dammit. I need to find something. All right. I'm going to find something we disagree on so that we can have some banter, some backend banter later on.

The Primeagen: Go is mid.

Lane: this has

just been Ah, shit. All right. We found it. We'll get to that. We'll get to that. Okay. I want to go back to your origin and, and really quickly, fast forward, back up to the present.

So you graduated high school, you'd done some coding, and then do you have a CS degree? Did you go to college?

What, how did that

Track 1: I, I, make sweet science to computers. I know it, I've been there, I've done it. Yeah, I, I went as the worst student. Dropped out a few times, maybe took a little too much. L s d who knows what happened during those years. A lot of question marks. I failed pre-calculus, not once, but twice.

Precalc that is. And so

third

Lane: it on the third

Track 1: third try, I got a b, maybe a B minus. And then I took calc over the summer. So I was a summer school kid. That's six weeks to take a 15 week course. 15 week course was a three or four. It was a three day a week course. I wanna [00:14:00] say that.

A math's a three day a week course.

It could have been a four day, a week one. I can never remember if it's three or four. Anyways. So I did that in five weeks and I went from obviously the b b minus pre-calc, failing several times to the best student in the class. And that was like my ramp up year. That was the year that I became I'd say that everything really settled in where I was able to control myself much, much more.

Discipline, really took a hold. Cuz you know, everyone has an excuse. I, I mean we work on computers. Every last person I've ever worked with says they're on the spectrum and they have adhd. I'm not sure if it's actually true or if we just all say those things, but I certainly, I've, I've been through the rigmarole, I've been prescribed medication, don't do any of them.

But when maturity really set in is really when I was able to, overcome all the hurdles of how I felt because I was able to say no to how I feel and do what I must do. And so whatever that was, it led me to being the, the bestest up to the point where in the fourth math class I had to take differential equations in, in collage.

I was number one outta like 400 and [00:15:00] some kids, I was the only person to finish the final in the entire college. And so I felt good

about that because they, they were actually gonna curve it because they're like, oh, we messed up. And then I was the only person to finish. They're like I guess if someone could do it, we we're not gonna curve it nearly as much.

And so

Lane: Oh God. 399 students wanted to burn you alive.

Track 1: I crushed. I got like a 97 or something like that. They just hated it. But it was

fun. It was, it was a lot of fun to do that just because it

is, once you, I, I, I don't, once you are mature enough to say no to how you feel and do the thing, you must, you can go a lot further and a lot faster.

It's always

that thing where it's until you're trapped halfway on a mountain and you're extremely tired and don't have water, you don't know how far you can walk without water.

Lane: yeah.

Track 1: You just don't know until You have to.

I one time had that happen to me. I was about six miles left, had no water, sunburnt on half my body, 105 degrees.

You just sit there and imagine water, that's all you do for hours. You're just like, I just want, I just, all I can do is think of it.

Lane: Are you [00:16:00] a breaking bad fan? Have you seen Better Call Saul?

There's a, there's a whole episode where they're stuck in the Arizona desert. Just imagine you wandering

around.

Track 1: awful. I, I hope I, I sure hope one day I never have to enjoy that form of dying, because that just sounds terrible.

Lane: it does. I grew up in St. George, Utah. It's kinda just outside of Vegas and it is, yeah, really barren Arizona heat.

Being without water in the summer. Not fun. Not a good time.

Track 1: I'm not in on that. All right. Anyways, let's keep on going.

Lane: Yeah. Yeah. Okay. I'm gonna link that you have a fantastic origin story video. Again, I'll, I'll link that for people that want to hear more about that. But to sum up, it sounds like there was a huge transformation there that happened and you attribute most of that just to good old fashioned hard work and discipline.

Was there something else there that I missed?

Track 1: There, there was a, I had a lot of addictions and all that, had a whole come to Jesus literally moment. Grew up very nothing to do with religion or anything like that. And then at some point that happened I talk about in the video and ever since that moment, [00:17:00] it's if I do something, if I were to take l s D down, like I just have this, I don't know what happened, but that one single night and one night, it's just like I couldn't do the things I used to do and enjoy 'em.

I don't know what happened. I didn't choose it. It just, it just all of a sudden just happened to me. And so then it was hard to drink. All of a sudden I felt like I, I shouldn't do that. And all of a sudden I felt like I needed to do all the right things, whatever the right things were. And, a lot of it was dumb.

I was young. I didn't know what I was doing out there. And it is just like, all of a sudden I focused on trying to, what is like maturity? What is, what is the point of discipline?

And my whole mind changed in a single night. And cause that was most

certainly not the, the brightest tool in the shed.

To give you a good example is even after all that, I still took lsd, which is a weird position to be in. And not everyone gets to do that, but I did that. And I, I,

I slowly learned, I'm a slow learner

Lane: you certainly have come a long way. You work at Netflix, by the

Track 1: by the way, stream Berry, by the way, I don't know if you know this.

Lane: Okay. How do we [00:18:00] get from, so you, you had this great kind of come to Jesus transformation in college. You graduate, you did really well. I'm assuming by the time college ended, how did you get from college to Netflix?

Track 1: Yes, I did do very well. Almost doubled my high school gpa. That's pretty good. Let's see, as far as how did I get to Netflix? I built my own company, did that. I was too early. I went into

Lane: Wait, what? Hold on. I've never heard this story before. You built like a your own software

Track 1: Yeah, dog. I was a full stack developer for years. Man, people don't know this. I know. It's weird. It's strange. Built my own company. I was a, I did text message marketing and a really great idea back then, but especially because back then 70% of people didn't even have smartphones in the us.

Lane: so this is right out of college. Like you didn't go get a developer job

of any sort

Track 1: no. You gotta go, You gotta go, get it. And so I did that. I also just got done getting married and we are extremely poor. Guy below us threatened to kill me. All that kind of crap, very fun times. We had p we, I, we literally had PTSD [00:19:00] afterwards. I remember when we finally moved outta that place, my wife opened the freezer and like batteries fell out or something like that.

And I broke out in sweat cuz I'm like, here we go again. It's like it's time to there's crazy times. Anyhoo. I, I spent two years, three years trying to build my own company. Really just went all in on it. I was just too early. Text message marketing was not right.

It was shockingly, it was not a good concept during a time in which text messaging was a primary way in

which you could even interact. There was no Twitter, there was no, like you couldn't go on Twitter on your phone. You couldn't go, Facebook wasn't really on your phone. No

one even had smartphones.

Everyone I

knew had flip phones

Lane: I'm surprised that it didn't work. Like I'm, this was what, what timeframe was this? Like

roughly speaking years.

Track 1: 2010.

Lane: It's like the golden age of texting. That's like when people just started getting smartphones. But you couldn't quite just do it over the internet because a lot of people didn't have smartphones.

Oh man, that's, that's, that's really wild. So I'm guessing you learned [00:20:00] just an, just an absolute absolutely amazing amount of things trying to build that company over two or three years.

Track 1: Yeah. A lot of failure, a lot of good stuff. It was in php four point something or 5.1, I think at that point. It's, we got upgraded classes came out I think in five. And so I was using classes did a whole like idea that, there's the thing that fetches your data. There's the thing that transforms your data, and then there's your website that displays the data.

And so then you have Aja request. jQuery was like, top dog, and I, I was doing all the single page stuff, like manipulating stuff, all that. It was fun.

Lane: Yeah. Building single page applications before react

Track 1: and they're, they're significantly complicated applications. And I know everyone loves the shit on React, so let me let me take down my pants. I actually don't think I could have built that application given today's technology. I think I would've spent way more time. It was

honestly easier. I still think it's easier to build tech back then.

Lane: All right, let's,

let's

Track 1: spent a of time, I've spent a lot of time, doing React. I've spent a [00:21:00] lot, I've, I've rewritten large swaths of Netflix into quote unquote modern React when I was doing it all that kind of stuff. So it's not like I'm in too dumb in the front end, but I, I'm dumb nowadays.

It's been too, too many years now. I'm just, I'm an old man yelling at clouds now.

Lane: Yeah. Yeah from, so I, I've done a lot of front end stuff, like much to my dismay, obviously I'm, I'm, I enjoy the backend side of the stack much more, and the listeners to the pod, to this podcast theoretically do too. Not that you can ever get any analytics on podcast

Track 1: Yeah, they're, the podcast is actually a really terrible, terrible analytic platform.

You get to know nothing, and if you don't like that, that's too bad.

Lane: Yeah, basically. Because the only analytic you get is downloads, which is like the most easily spoof thing in, in the

Track 1: Yeah, I know. Something Just crawls your website on accident. You might, you, people have some weird crawlers out there. You probably get so many robot downloads. Have

you ever tried YouTube ones?

Lane: YouTube.

Track 1: YouTube has a podcast thing now.[00:22:00]

Lane: Oh yeah. This, this, this podcast goes up on YouTube

Track 1: Okay, that's At least, at least you get probably good analytics from that one.

Lane: Yeah, for sure. I also clip up the podcast, make some shorts and TikTok and things like

that. So it,

this is a 2023 podcast,

like .Uh,

okay. So why? Yeah. I wanna just ask, because it might, it might be non-obvious to the listeners, why is building tech harder or maybe slower is the, what, what you were leaning towards than it was, now, but than it was 12 years ago.

Track 1: One thing you have is that things are much more like expected worldwide, or at least we program as if it were worldwide. Two, we program things as if there's thousands upon thousands, tens of thousands, hundreds of thousands, users gonna be using your product. There's not

really like we plan like what we did, but back then is I would buy a virtual private server in whatever company, host Gator or something like that, GoDaddy, whatever it was,

and you had this one computer and [00:23:00] that's, you'd log in and I would like, and I'd use something like Pingdom, some pinging service to let me know when things went down and that, that's like.

That was like Earl, that was like late 2000 or 10 or zero to 10 is the way you did things there. There just wasn't a lot. There was a, there was a database, there was, your application running and they're both on the same computer. You weren't really planning the scale. Super huge.

And obviously anyone that had unplanned for great success, this was a very hard transition time. I think that transition time is harder then than it is now just cuz there was no technologies but to

build something I think was a lot simpler to learn web development. You had to understand that you had a server, you had a client server does like just procedural line by line.

Client just does simple line by line and that's it. There's not a, the mental model's really, really small. And even though today it's easier to do way cooler stuff, it's just the mental models way larger. Like there, a Theo I think just did a video on this and his argument is that [00:24:00] it's actually significantly simpler, but I don't know.

I find it that it's, For an individual to start from zero, the amount of things they have to like even become familiar with is much, much larger.

Lane: Yeah,

that makes sense.

I, yeah.

Track 1: worse or better. It's always terrible. Anyone who thinks that there's some paradigm something out there that will make programming not shitty, it's just not true.

Like it's, it's always gonna be terrible because at the end of the day, you, you make bugs, you're not good at it and it will just be hard.

Lane: The only universal truth is that if you have to deal with Webpack, it will be slower. That's the only,

Track 1: Yeah.

Lane: the only thing I can

Track 1: No. Unless if you have a copy pasta config that you have just lying around that all you do is you just copy pasta right in and boom, you're off and running.

Lane: Yes. And as, as long as the node version is tagged, that that works with, and the other, the other 17 things.

Yes.

I,

Track 1: ago I had a copy pasta config that I just pasted into every new project and have a little output artifact. Boom. Done. Next thing.

Lane: Okay. I like that. [00:25:00] I've never had the privilege. I always get onboarded onto somebody else's project and have to fight Webpack for a long time. You know how

Track 1: Yeah, it is awful though.

Lane: Yeah. Not a good time. Okay. So you, you did your company you learned a lot, but after three years you were done. Now we're at Netflix.

Track 1: Nope. Then I went and worked at a small, silly company called Schedulicity. They actually might still be around. I bet you they probably still are.

Yes. Schedulicity

online, the booking. So they did all the the thing for like hair appointments lashes, beauty, acupuncture, chiropractor, right?

So they're like the, the open calendar for you to be able to make bookings and all that. Think of OpenTable

Lane: Okay.

Track 1: OpenTable, or near the time of OpenTable. And this right here when I got

Lane: a classic

sas,

Track 1: Yeah, classic sas, like kind of what made SAS SAS back in the day. Anyways, so schedule the fun times.

That's where I started. Absolutely hated it. C sharp and a p master pages. Okay. Nothing masterful about that. It was terrible.[00:26:00] Then after all of that, by the way, am I in sync? Cuz Riverside

doesn't show me in sync, so I just wanna make sure that

Lane: I think

you are.

Track 1: as you're fine with it, you might have to do some slight editing.

Sorry. You

know, Hey,

Lane: all good. Yep.

Track 1: edit this part out. Anyways,

so

Lane: You got

that

Track 1: you got that flip. Oh, I flipped it in your podcast.

Lane: He

Track 1: Let's go flip. Hey, flip just crossed. He completely runs my Instagram, completely, runs my Instagram,

And he just crossed 10,000 followers on it. Just clip

stuff and make stuff and that's that.

And he just did it. Boom, boom, boom, boom, boom. Good job. Flip.

Lane: I have to do more of my own editing because I'm not as naturally interesting as you. W for you it's

like I think you just have to cap I have to edit the interesting in so

we're getting there.

Track 1: no, no. I just, I I just have no shame, so I don't, I don't think about what I'm gonna say. Everything I say just comes right out. Okay, so after schedule, spent five months there. I remember the day I was going. So I was in Bozeman, Montana, shout out to HTM X I was in Bozeman, [00:27:00] Montana, and I'm driving down the main street.

Okay. So I'm in Four Corners and I drive down Main Street. It was all pastures. the, the the clouds would go around Ross Peak. It looked like a, like a, like you're wearing like a shawl or something like that. I don't know what you call it. Anyways, beautiful, amazing drive. This is before Bozeman became horrible.

And I go into town and I, I just sit there and I go God, I hate my job. I hate it. What? I'm obviously doing it and I need to do it, but I must be doing this because I have to learn like patience or something. I need to learn how to be okay not being okay. And so I'm like, okay, I'm gonna, I am gonna go into my job and I'm gonna do a good job despite hating every bit of it.

And I de I made that decision that day and I'm like, we're doing it. And I start walking into the office, go across the street for some Rockford coffee. As I'm walking back, this guy named Ivan Judson walks by and goes, Hey, [00:28:00] you work at scheduling, right? I'm like, yeah, I work at scheduling. He's what if I I'll increase your salary by 50%, come work over here at web filings for us.

And I was like, Hmm, , this seems strange. . finally commit to myself that I'll be happy in whatever is given to me. And then something just changes. Yeah. So I went to web filings. Extremely hard job, much more hours, much harder work. Really cool stuff. Really taught me to be the programmer I think I am today, really was from a job like that.

I'm not suggesting that you should overwork, there's certain levels that can't be attained without just smashing your face against a keyboard For 80 hours a week for for so long, right? There's it's the whole John Carmack thing. You can't make a John Carmack without working like John Carmack.

And I obviously know John Carmack, maybe like 10th of John Carmack, but still, nonetheless, I did something. And so that's really what made me great. And during that time there was a conference where I learned about something called Rx js. Now you're probably thinking RX js, don't you love that platform?

It was funny you should say that. [00:29:00] Anyways, back then I was very interested in this whole idea of RX js. I've never, I liked the idea that you could flow state through in this really weird asynchronous world. And so I started playing with it. And for fun, z I put two things on my LinkedIn mustache analysis.

I had to drop cage fighting cuz I got too many endorsements where people might think I actually cage fight. So I, I actually dropped it out and did I did mustache analysis and Rx js. Within three days I get an email from a guy named Jeff Wagner and he's just Hey,

Lane: Oh,

Track 1: use, we use RX js heavily on Netflix.

Would you like to come interview? So I come and interview Joffer Hussein, big Rx Js guy interviews me. Mind you, I don't really know much about Rx, JS, LinkedIn, right? No, no. There's no proof of the pudding with it, with LinkedIn at that point. But I'm really good at reading people in some sense. And so I can tell right away that he loves teaching, right?

It's very, very clear. Loves to talk about technology really [00:30:00] into it. Super passionate. So in my interview, I have to effectively do an auto complete in Rx js. Mind you, I, I don't even know it's select many really is at this point, which is what it used to be called Flat Map. Used to be called select many or switch latest or any of those great things you could do.

So of course, what do I do? I just start talking to him and, I start just getting, I effectively get him to tell me the answer. I write it down. Word for word what he is saying. The other interviewer in there, Ian McKay does not even know what's happening at that point, and at the end of it, he said that Joffer said I was the best Rx Js interview he's had yet, which is a lie.

It's just I, I just happen to be able to talk my way into it. And then there's some other technical interviews, blah, blah, blah, blah, blah, blah, state machine stuff. Someone asked me what's my least favorite thing about Netflix? Very good tip by the way. If you're interviewing for a place, understand their product, be good about talking about it, because when it really comes down to them going, Hey, what do you hate about Netflix?

If you can't get angry and passionate, Then guess what? They don't think they, [00:31:00] they don't think you really wanna work there, right? So I was just like, your search bar on Xbox is dog water. It is just the worst thing because back then it was a straight line of A through Z, right? So you're just

like,

Lane: no left, left, left, left, left, left.

Track 1: all right, like it was just like so painful, and then results aren't automatically coming in. So you had to like type out enough of the word and then search to know if it's good. And so of course then they're like how do you know you could make something better? And of course, at that point I was pretty adept on the AB testing side.

So I'm like, here's the metrics I'd look for. This is why I'd do it. And so it worked out. And by about three quarters, way through the day, I called my wife and I said, I got the job. Now we have to do the worst thing, which is now we have to figure out. Do we want to move to California or not? At this point, my wife was 35 weeks pregnant, 34 weeks pregnant.

I knew nobody in California, and it was my first kid. And yeah, it [00:32:00] was people, I've had some YouTube comments where people are like, oh, we're at Netflix, and and moving, what a tough life, right? It's just it was really, really hard. It was extremely hard very, very emotionally difficult.

It was definitely probably the, the, the most hardest decision I've had to make uprooting your life with the greatest unknown you're about to ever have. Into a place you've never been to or stay where it's comfortable. So my wife and I choose adventure. It's just what we do. We choose adventure.

We went and chose adventure and it was awesome. And I'm ha very, very happy I did it. I do not think I'd be the man I am today without doing that. Because one of the hard parts, especially I think as a man is that we really like our friends and our friends. We tend to I don't know what it is about a group of guys, but it seems like we, we pinned to the lowest IQ and not the highest.

IQ just seems to be that way. You get a bunch of group of guys together and somehow, statistically we live less long than women, right? I don't know what happens, but it just it just gets terrible. And so it's until I broke that and had to be on my own [00:33:00] and had to reorient my life, I feel like, I think I would've just stayed much more immature and maybe didn't value my wife as well.

All that kind of stuff. And moving out to California, being on your own, all that is a good move. Very happy. I did it still wasn't easy.

Lane: I, I hope that's not true of engineers. Like if, if we're really as dumb as our dumbest friend, I hope we're not as dumb as our dumbest engineer on our team.

Track 1: I'm sorry, . The good news

Lane: I'm sorry to let you know

Track 1: you don't like it. You don't, you don't necessarily have to like the people you work with. I don't think it applies to people to work. It applies. I think that that phrase, that's the old phrase, your friends lead you astray phrase. You're, you, that's the thing where it's because those people are the ones that shape who you are more than anything else.

A bad manager who maybe is good to you can also shape you really poorly, right? Because that's another person that

can shape you. And so they could shape you into being an asshole or into being someone that's not good to work with just as much as a good manager can shape you into being someone that's great to work with.

And any person that can speak into your life and shape who you are has,

and with friends, [00:34:00] it just seems to always go to banter. And Lois iq, I don't know what it is.

Lane: Yeah, that's what we do on this show. Banter and lowest iq.

Track 1: Oh, strong. Low iq, big fan of room, room, temperature IQ conversations are a lot of fun.

Lane: We put the attainment in edutainment.

Track 1: lot of payment going on here.

Lane: Okay, so you moved to California. I didn't realize you'd moved because at the moment, like you still work in Netflix, by the way, but I don't know, are

you in California

Track 1: Dakota,

Lane: South Dakota, Why

Track 1: COVID

Lane: Oh,

okay.

Track 1: am sitting in a house of 1800 square feet with two black labs, three children and a beautiful wife with a yard, no larger than a yard stick. And I'm sitting there thinking, man, I don't want to be locked down. So

I'm just like, I'm gonna leave. And so we had, my mom was in Colorado Springs and I don't want another city.

And my father-in-law and mother-in-law are in Rapid City, South Dakota. [00:35:00] So I'm like, I don't want a city, but I wanna be next to family to South Dakota. And so the day Gavin Newsom announced Lockdowns is the day we all piled into the car, drove, drove all the way to Rapid City, stayed in Rapid City did 14 days in the basement while her folks left.

So we just sat down there and, had our own little house there for a little bit. And then I stayed in their basement for a long, long time, like nine, 10 months. It was a lot of fun. We had our fourth kid there. I always joke with my father-in-law and be like, you know where Olivia was made?

You know it, so

Lane: Oh, good

lord,

Track 1: it's great. It's

Lane: that

is a, that is a drive, man. So I just had my second my second, he is a boy, so I, not my second son, but second child four months old being like inside all winter with a toddler. Absolute nightmare.

I can't imagine with three or four kids. I think we're gonna stop at three, but yeah, having kids is tough and being in confined spaces with toddlers that have energy is

hell on earth,

Track 1: it's because [00:36:00] that's just not how they're meant to be.

Like you don't look at an animal cage and be like, oh, look at that thing. It's living, it's a terrarium. It thinks it's in its natural habitat. You think that thing's not dang. Wish I could walk around a little bit further around here.

That's, it's just, it's obvious like kids aren't meant to be just in a house,

We're meant to run around and get hurt and jump and play and swing things and break a few windows, it happens.

Lane: yeah. Yeah. No, that's, that's great. We're, we'll probably be moving within the next couple of years. I'm in, I'm just south of Salt Lake in Utah now, but we want to go somewhere else. I don't, I

don't know where somewhere else.

Track 1: Find the place, especially if you have family. It's really great if you have family just because nothing's better than having family and being able to have like great babysitters that you can trust ,

Lane: Yes. Giving, giving toddlers to grandmas great Life hack

Track 1: Life hack Got him.

Lane: Cool. Okay, so you, you, you're, you're at Netflix now. Now I wanna dive into your passion, which is command line tools. [00:37:00] And I wanna preface the conversation with, I often get the question from people who are getting into backend development, what am I going to do about a personal portfolio of projects?

Because like in the front end world, it's very common to spend some time building like this beautiful custom website to show all your little web projects on. In the backend world, I would argue it doesn't necessarily make as much sense. It's not as clear what you're supposed to build from like a portfolio perspective. And I've always been a fan of can you do something with data? Can you do something with automation? And a lot of times that just comes down to like command line tools. So I think it makes. A lot of sense for backend developers to build tools. Sometimes it's yeah, you do need to build a backend API so you understand how they work.

But that's a really weird, boring, personal project, just a rest API that does some random crap. But command line tools are really potentially interesting and if you build a good one, you can even maybe get some traction with it on GitHub. Why do you like command line tools?

Track 1: I like the process of solving or making [00:38:00] something better. I like building for developers, all right? Because we just have, we, we're just a different group of people to develop for than customers just because we're just different, right? I, I understand what people want and then I can build that explicit thing.

I think there's a little bit more def, definition when something doesn't go right, someone can explain it in. Greater detail, what is wrong? I really want to see this. And then you have to come up with this idea of munging data and data sources and like how to present the problem in a very simplified way.

So it's, it's a lot like front end, end backend, your backend's different because usually you don't own it. And your front end is usually something as simple as a series of command line arguments and what you can print out or save to a file. And so for me it's just really, I like to just solve problems and they're not always command line tools.

Like recently I had to build something that tested one of our new video and audio interfaces. And so I built something that could effectively shove frames through and build out a full like video audio suite that could shove frames through, but you [00:39:00] could play it at maximum speed. And so just shoving them as fast as possible and then you can do like performance testing, memory testing, all this kind of stuff.

And so I could play, 10 minutes of video in five seconds and

through Netflix.

Lane: almost like a little integration testing suite or something like

Track 1: We call it Reggie, Reggie Miller, the most reliable pacer good, good joke. And if it didn't work out, I could call it Reg Reggie after Reginald

hog reefs from whatever that umbrella academy was. And so I had two options.

So I had a lot of backups depending on who like, is, are you a nerd? Do you only know Re Reginald, then we can go with that one. But it was a lot of fun because it, it's, it's really just about trying to solve a really complex problem. I just like that.

And so what I'm building now is just another one of these items where I needed to be able to figure out what was happening to a bunch of machines in 10 seconds was like my goal, like if something went wrong, can I be able to be like, gimme that, gimme A U U I D, what happened?

Gimme your U U I D and what day it happened on. And I will tell you in 10 seconds what happened.

Like that was my goal. And so [00:40:00] yeah, I was largely able to do that. You have to mix in a bunch of stuff. I don't know. Tools are fun because it's, typically they're a little bit more defined than websites as well.

One thing I think that Theo does really, really is he builds these really simplified websites like upload thing. It's

not, it's not like a, it's not there. There's, I'm sure there's improvements you can make, but as far as like the thing you're building, it's fairly complete. And I'm sure there's, whatever, integrations, blah, blah, blah, blah, blah.

But it's, it's, it's a fairly complete product. It's not like the forever building of Netflix. And so for me,

there's something about just, just constantly pushing the ball forward on the same item forever. That feels really difficult. And so that's another reason why I tend to really like tools is that they're very concise, like a more concise tool you can make.

The better the tool is. It really fits a niche well,

Lane: Are you a Unix philosophy

fan?

Track 1: for the most part. Yes. And so like, how that breaks down in my head is that,

Especially with this latest tool, a big philosophy I have is that data can enter in [00:41:00] either through the standard way, me requesting out to a few different databases, or b the standard in can feed me in data and I have a format that I expect and then I'll take that format and I can do things with it.

And so that means I can pipe a bunch of events, right? I can go out and, parse out this CSV and then pass it into something that kind of formats the data into the way my program expects. My program can take that data and then go request a bunch of data and kind of fill it in, make it bigger, and just keep on iterating on these line by line objects, however I want to do it.

Or if I'm mocking out the data, how to like parse, push in that data so I have a good integration test if I wanna run into cross, make sure I don't break CSV generation or whatever. And so it's all about being able to have good ins and outs and

it's fun and you not abusing your standard in or standard error is really fun.

Lane: I love, I love just the idea of building for developers for a few reasons. One, it's nice to build for developers because you are a developer, so you can dog food your own thing a lot easier. But I also think there's a trap you can fall into as a developer when, if your [00:42:00] goal is just to build projects to put them on your resume or on your portfolio for like hiring managers to check out. I think you can, I think it can be a sand trap to try to be the best product designer in the world, right? Because no matter what project you build, you're, you're, you're applying for dev jobs at the end of the day, not product management jobs. And so if you do a crappy job designing your product, Even if you do the great engineering work, if what you're presenting to the hiring manager is a crappy product, it you'll still have these biased points knocked against you.

Whereas if you're building for developer, I think you'll just, there'll be a much more natural fit and you'll be able to build a better product experience for the tool. And if the hiring manager is a developer, which I really hope they are, because I, I hate working for, for non-technical people.

But if, if they are then, then I think it'll be a better fit for them too. If they can look at your library's API and understand why it's a useful library. Like that's, that's gravy.

Track 1: Yeah. Yeah, I'm on that [00:43:00] too. That's another reason why I like it, is because it just, you tend to be the, the, the stakeholders are all technical and even though you sometimes have to build things that they're not asking for because they don't realize what they do and don't want, just like, just like customers, people say I wish I could have a faster horse, right?

And you're like

actually what you want is a car. And so like these things happen all the time and it happens just as much in tools, but it's still like a much more technical thing. And It's just as different people are motivated to understand your product. Whereas when you're build for customers, people aren't necessarily motivated to learn your product, right?

No one goes

on to Netflix and being like, I'm gonna figure out every last menu before I proceed into playing something. Cuz that would be inappropriate, right? No, no one does that, right? First thing pops up, they're like, oh, I like that. And it's just not a lot of, not a lot of thoughts going on.

Lane: That's true. I watch a lot of TV at 11 o'clock at night when I can't fall asleep. And there, there are no thoughts.

Track 1: Yeah. The thoughts are on the minimum, right? You're

Lane: Yeah.

Track 1: for a while the economic code worked on Netflix. It might [00:44:00] still up, up, down, down, left left, might still kick it in. We don't have ab so you know, you just get, you get, we only have L Rudd plus enter, like that's technically all we get.

Guaranteed at one point in, in the development lifecycle, l Rudd plus enter was the only thing you'd get. L Rudd being left right up, down.

And so we had the divine interface, divine interfaces around like how do you build for L Rudd? That's

why left.

It still works to this day, but left will often leave a menu.

It's because

Lane: I've noticed that.

Track 1: left is when you don't have a back button. How do you leave a menu?

Lane: Good

Track 1: You have five buttons up. Doesn't seem right. Doesn't seem right down. Doesn't seem right. Left. Maybe. Maybe

that's

Lane: seem right, but it seems less wrong.

Track 1: it just seems, yeah, it seems a little less wrong maybe cuz I'm an L to R kind of guy instead of an R to L guy. So maybe R would fit better in the other scheme.

Lane: The back button in your Chrome browser is like top left, so like I, I can dig it.

Track 1: Mm-hmm.

Lane: Okay, so what are your favorite tools [00:45:00] for building your tools? What are your favorite technologies at the moment?

Track 1: I really Cat and GR and oc find is fantastic. I use those all the time. JQ is great. You gotta know jq. If you don't know J, if you don't know jq, you don't know me.

Lane: All right. Time to wrap this one

up. Okay. So you just, you just listed off a bunch of command line utilities. For, for people listening, cat Ox said these are like standard Linux binaries that typically come, hopefully shipped on your machine.

Okay, cool. I can dig it. What programming languages do you bill your tools in?

Track 1: Right now the current one is with I JavaScript though I should have built it with Go. My

coworker said something very, very hilarious, which was actually, I can just hear you even though you don't, you don't get to see my coworkers chat, but, oh man, he just said the greatest thing ever. What is it?

Hold on, hold on, hold on. I [00:46:00] was saying something where I was like, Hey, I just gotta, I don't wanna have to rewrite my program or Roman ride into using Go, let's just make sure I, I gotta figure out how to make sure these things work for TypeScript. And his response was literally, it's just a more professional language.

It has good proper scheduling, runtime and parallel processing po proposition, aka green threads. Ecosystem is more pro, I think you don't end up with the bazillion MPM packages of doubtful. Quality JS makes sense for the web. N R D P N R DP is what Netflix, we provide a c plus plus thing with V8 in it.

So you can run JavaScript for the ui. That way the UI can remain

updateable. It's either Lua or,

uh, Lua Micro Python or JavaScript. We ended up with JavaScript, though I think Lua probably would've been the better choice, but it just was hard to make it fast. And then he is besides for that, I don't really see the value of it.

Then he responds with ts. Feels like a hack on top of a hack ish, continuously involving language. Once you've tried something else, unless you have to use TS or js. I don't see a reason for doing so.

Lane: We're the same person. I don't know if you knew that [00:47:00] that was me in your

dms.

Track 1: was

Anyways, it was pretty, it was pretty good because I was just like, this is just the worst. Yeah, because this all spawned because we were having dumb long to number problems, 64 bit precision numbers that just would break TypeScript and blah, blah, blah, blah, blah. Super annoying. And so

Lane: Yeah. I, I've, I've built some command line tools in JavaScripts and, and in Typescripts. And I'm one of those people like, yeah, I like TypeScript better than JavaScript. I get, I get, I get types. That's great. Of

Track 1: I'll always opt into types over, not types.

Lane: yeah. Oh yeah, a hundred percent. Yeah, that, that, that DH article was absolutely wrong. I'll like that

Track 1: Yeah, it's, it's, it's nutty for not to, for people to be like, I just don't want types. And it's just I don't see a world where that the, it doesn't actually make any sense because the moment you have a

big, large change, especially like the moment you have a data change, holy cow, a timeless world is just the worst thing.

And I'm going through that right now with proto buffs. I'm doing an entire proto buff rewrite of my tool, and it is just like hundreds of spots.[00:48:00] It's

impossible.

Lane: was an, I think there was an argument to be made pre inferred types that it, like it could slow you down a bit to write like when it was really verbose,

but

Track 1: do inferred types on TypeScript. It's not inferred types. It's inferred type definitions, which is Nty, naty, Naty.

Lane: Just like a simple example of Ingo using colon equals right to infer that first declaration. It's it's literally one token extra, right? So like I think there was a semblance of an argument. Again, like I've never preferred dynamically typed languages, but I think like with all the advances that have happened with like ease of inference, like we can get programs that are just as easy to write and still safe. So I.

Track 1: Yeah. So my, my next so I've been using a lot of TypeScript. There's, there's some okay. Things about TypeScript. I, it's not bad. But my, I I, I really do like rust for string processing type clo. I think it's a really great language. I've really enjoyed writing CLOs in them, but I've been trying out I've only a few hours [00:49:00] in, so I'm, I'm gonna become an OCaml Andy and try out OCaml for a little bit.

Because, they, even John Carmack in his functional days was talking about how he could see functional languages being better than for tools than than other languages. They just feel easier and they feel like they could run longer. For

whatever reason, entropy just seems to take a hold of every language, but it just feels slower, is his general thought.

He rewrote Wolfenstein in a weekend in Haskell or something like that. I forget what it was. And so he, he he did his own functional thing. And so I, I want to try it out, but I gotta get good enough first. And so I'm just starting my day, just finished day one of advent of code felt pretty, pretty confident about that.

Lane: Nice. Did you do with tj? He was episode number one of this podcast chatting about OCaml.

Track 1: Yeah. Oh yeah. Yeah. TJ's my inspiration because TJ and I are both, we we're very similar developers at the end I don't look at what is and think, man, this is probably the best ever. Instead, I look at what is available and [00:50:00] try to make a decision for it. If I had to write something small that runs in a browser, I'd just use JavaScript and css.

It just makes sense. It just, it just makes sense. I probably wouldn't

stand up a giant React app that has server side components that has everything just to be able to do like a simple little re-entering or a simple rendering. To me, it just, it's, it's just using the wrong weapon for the wrong art of war.

And so I'm just like, okay, I don't need that right now. And TJ I think is very, very similar in that regard is that he, he likes to explore, likes to understand languages, and likes to find something that's really good for like a specific use case and then use it for that use case. Just like LU is really great for an embedded language, if you have an embedded platform, sorry, this fly is killing me.

And so if you have this, if you have a, if you have an embedded platform and you need a dynamic language lu, you can embed in an afternoon, and it's a great language. There's a use case for it, that's why it's in Neo vm. It's a great case. So that's what I, so un shockingly, I'm also trying out OCaml because I love rust types, so I want rust types and their inference is really good.

So it's not [00:51:00] type inference, it's it's type inference, not type definition inference like TypeScript. And

Lane: Okay.

Track 1: has it has a garbage collector and it has the ability and the upcoming versions to not use the garbage collector but like stack allocated stuff. And so you're gonna be able to go fast, super, super fast, go, gonna be able to have a garbage collector when you need one.

You just don't care. And you're gonna have the types of rust effectively. That's all I want, is I just want

good types, that's the reason why I don't love go is cuz it's not good types.

Lane: so I mean like, I'll give you that so I was on this podcast called Cup of Go, go check it out if you are interested in Go. But they asked what was the one thing I would change about the language? And for me it was algebraic data types. Like I would love to have basically like rusts result type, right?

for for the, if air equal does not equal nil problem. But all the other things about the language. I really am a huge fan of like

very small language syntactically, simple get your features outta here, get off my lawn with your features a thing.

Track 1: That's just what I want [00:52:00] in the language. That's it. You're, you've just described exactly what I want. So that's why OCaml right now is exciting, is that it is a simple language. It's unusual in the sense that if you've only grown up with C style languages, it's unusual to look at. And so it's just me getting used to like trying to get how things work and maybe my brain will switch and then it's really easy.

Then it's just as easy as any other thing. But, I've done c based languages for 20 years. Of course, doing a non C based language is hard. , it's yeah, okay,

this is, this is, different. Relatively, the language seems very small. There's not a lot of anything to it. There's just really simple types.

Really simple ways they do things, yet it's just strong enough that you can do a lot of cool stuff.

Lane: so here's what I don't understand, knowing very little about OCaml, are we just as an industry, are we really, really bad at our jobs? Like why is OCaml not popular? because

it's old, right?

Track 1: yeah, I just

Lane: Are we just terrible?

Track 1: this. I just read an article on this about like, why is [00:53:00] OCaml not popular? I think generally the, the biggest hurdle is that functional languages are harder. Like the initial curve on a functional language is harder because you do a lot of things with recursion

and people aren't good at recursion to begin with.

Like until, recursion, you don't know recursion, and that's like the, that's , like no one can explain it to you. No one can be like, oh, you just call yourself until you solve the problem. What the hell does that even mean? It's simple. You have a base case and you have an inductive case, and they're like, I don't know what inductive is, but I wanna punch you in the face for using that dumb word.

So it's like there's this whole. There's this whole problem that goes on with trying to learn a functional way of doing it because we think procedurally, I have a list. I want to walk through the list. So from the first one to the last one, do this code. I, if I need the break, I can just break.

And so it's like you don't quite have, functional, you do the same thing. You're literally saying the same thing. You're just saying it with a new language.

Lane: I think there's a problem, and I just, I just exacerbated the problem. I, I apologize [00:54:00] for using the term algebraic data types, because if you're listening to this and you heard me say algebraic data types, and you went, what the hell is that? It sounds really complicated. It's not, there's probably a better word that we could use, but for some reason, I think, especially in the functional programming world, it's a very academic, very pretentious side of programming. And if there is a more complicated word to, to explain a topic, I've found that when you're learning functional programming, you will, you will only encounter the most complicated terms to

To describe simple concepts.

So I'm, I'm sorry for my contribution to that,

Track 1: It's not,

Lane: way of talking

Track 1: it's unfortunately, it's what they're called. But for those that don't know about it, for anyone at home that doesn't know about it, like a good example, what you're saying with air handling and rust is that you have effectively a value that can be in two states. You have the value, which is the thing you want, or the air, the thing you don't want, and it's gonna be in one of these two things.

So in Java Script or even Java, what happens is that when something goes wrong, your program halts [00:55:00] and an error is thrown to the first place that is caught. Now, where is it caught? You don't know unless if you wrote that tri catch right there. And that's what makes go also super good is that go, when an air happens, it happens at the line you're at, and you have to think about how to handle it at that line.

Russ just happens to have more friendly syntax around it. That's all a algebraic type do. Lets you do is just have friendlier syntax versus go is

this, this like gr caveman style, which is just like, if ever not nil return. Like that's all it does, it's like it's, it's very, it's very caveman,

Lane: if not error here. Go to next line. Yeah.

Yeah.

Track 1: it's good though because that means every place your program can fail, you are told your program can fail. And by almost that definition, it's a leaky abstraction, which is a good leaky abstraction, which means that you now. Have to tell the people outside of you if you can't handle the air, that you need to be able to also return an error.

So the, the air [00:56:00] will naturally bubble up to the correct location because each layer is required to think, do I hand it off one level or do I handle it here? And that's the proper, thing. This whole idea, like especially in note applications, I have it right now on my, it's, it's actually how my command line tool works is that there's a function in hold on.

I call it the thing aperture, because I love portal. Portal was a great, great game, but I have uncut exception, right? Process, uncut exception. I have this, I have this 17 line function so that when an error is thrown, I'm using that as control flow for like, when you hand me bad arguments, when something else happens, when I can't handle a certain situation, I just have this drop all single place in my program that just halts everything and says, sorry, you can't go any further.

And it's just

Lane: I love that. Yeah.

Track 1: Am I in love with it? No, but does it work? Yeah. Would I rather have

something that I handle errors where they should be handled? Probably that'd be the better choice, but instead I do it this way.

Lane: The saddest I've ever been, I think in my program and career was when I, I went to a company I've been programming to go for a few years, [00:57:00] and I was thrown onto a team that had been forced from upper management to migrate from Java to go. So the team is Java developers that do not like go, and I'm the only kind of go fan on the team. And the very first pull request I'm hit with is, look, I reinvented, try catchin, go using recover and defer and panic. And I'm like, oh Lord. Like I don't, this is a conversation I'm gonna have to have with my team. Lead on day one,

Like this is that, that was a bad, that was a bad time. Not a fan of Tri catch.

Track 1: yeah, yeah. And so so algebraic data type, it can be one of those two things, and you effectively. No matter what. So if you want the value inside of the algebraic data type, you have to do a process like called lifting or unwrapping or metamorphic, I think is what the technical term is for it. But you have to change it from the result type into your value.

So you have to first be like, are you a value? And give me your value out. I now have the value. So you have to like explicitly check, which just [00:58:00] erases an entire host of problems, Right. Cannot happen. And the second thing it does, it also erases the null problem because you have

this container object that's is there a value?

Oh, there's no value. Okay, then don't move on. You can.it, right? You can dot Are you empty? It's not just like you mess up or perhaps the J S O N came back without a field, so you just didn't know that things could be possibly undefined. But in this one situation it is because you didn't realize your server could do that well in the proper languages.

It'd be like, ah, it, there's actually nothing there. Don't worry. It's a nothing. And you'll just get caught and everything's nice and

it's fantastic.

Lane: Yeah. To reiterate that. Cause I think it's really important especially for my listeners who I think a lot of them have written a decent amount of Python and go, so like in go, you're like forced by the language convention to check errors at all these different places, but you're not really like the compiler's not forcing you to you're just given an error and a value as two different variables and you independently are expected to check the error [00:59:00] every time. Whereas what you're saying is in rust, you get one variable back and you're forced to actually like check

Is it.

of type error? Yeah. Or is it of type thing that I actually want. In the case of a database retrieval, it might be like, is it the user record that I just got from the database or did something go wrong? And then the, the language itself can actually check for those that you have done that handling properly.

Track 1: Yeah. And so Zig has it so

that you can do You. Gosh, that's fly. So look, you can even see it on the

camera. Go. Yeah.

Lane: Is another breaking bad reference that you won't get.

Track 1: I don't see,

I don't get

Lane: fly episode. Yeah.

Track 1: Oh no, I do, I did watch Breaking Bad. That was when he was working for Gus, right?

And Poya Loco or whatever it was.

Lane: Worst episode in the show.

yeah. And you're recreating

Track 1: it

is terrible.

I am literally recreating it. But one thing that's beautiful in Zig is that you can use, try as a keyword. Not they use try and catch, which is unfortunate, but it also describes what you're supposed to do. But try just means call this function. [01:00:00] And if the result pipe effectively comes back as an error, just simply return, the error function stops there.

You just return the error. So instead of doing,

here's my two values out, if it isn't, if the error exists, then return the error. It just does it for you in a singular piece of three letter syntax, which is super nice. Russ

has the same convention, which is just a question mark at the end, but it's it's the exact same idea that you can incorporate syntax level decisions on an algebraic type to be able to do these nice things.

And to me that's that's a huge win because then it's super simple to write that nice code that looks really good. Where everything that could possibly air, cuz there's syntax involved with it, our keywords and your signature is forced to write out. I could also air because I want to automatically return these things.

And so you have this beautiful leaky abstraction, the right kind of leaky abstraction, the one that leaks, potential side effects that you, you, you need to know about. And it's just, I love it. It's beautiful works. Mm ah.

Lane: That, that's, that's hilarious. I never knew that about Zig. I was a fan of a kind of very loose proposal to add the keyword guard [01:01:00] to go where you would basically use the keyword and it would just do the whole, if the last thing that's returned is an air and it's not nil and just return the air

Track 1: That's perfect. They should do that,

Lane: be really

Track 1: or something like that. Try, I think is fine. I don't really care if you use the, re reuse the word try. I don't have any allergies to, like words that were used in a shitty way to be used in a not so bad way. It doesn't

hurt my feelings. Use, try. Just go for it.

Lane: I dig it. Cool, man, we, we've been going for a little over an hour. This has really been fun. Thank you so much for coming on, man. Can you tell everyone where they can find you in, in all your, in all your glory? Where are the places?

Track 1: Twitch is my favorite. Twitter is just a bunch of milk memes. Okay. Real talk. Yeah, so I, I just, I I'm on the socials, right? My name's on all the socials.

I

Lane: Search the Prime agent. Anywhere. You'll find

Track 1: yeah,

I pretty much have it. If you just go on the internet and type up my name, it will actually just, it'll show up everywhere. And

really, you wanna see something really awful?

I wanna try

this out [01:02:00] with you. All right. All right. I want you to go on Google right now, and I want you to start getting ready to type into the search box.

Search box. Search box.

Okay. I want you to type in my name, the prime gen. Don't hit enter. Let the auto

complete happen. What are your results? Tell me your first five auto completes.

Lane: All right. We got the pri agen, the prima Gen keyboard. The Prima Gen Twitter. The Prima Gen LinkedIn. What lord. All right. The pri Agen real name and the pri agen age.

Track 1: Okay. Now keep on going. Is there a few more?

Lane: The pri agen discord. The pri agen twitch. Why is Twitch below LinkedIn? What is wrong with your audience? The pri agen, Neo vim config, and the pri agen en vim. And then my, my list is, is, is

Track 1: Okay, so you're one of the first people that didn't have the big one, which usually when it typed in there, the Prima gen's wife also shows up and I'm just like, y'all are degenerates

Lane: All right. Gonna try from my other account. The [01:03:00] pri No, I'm, I am a clean, I am a clean, healthy individual.

Google has decided that I am not interested in Googling about

Track 1: That's good. Thank you. Hey, you know what, DGen test past. You're a normal dj. Okay? You're the fun

kind.

Lane: normal level, good Lord, wife. But why do you even have a LinkedIn that doesn't? That seems off-brand for you, frankly.

Track 1: So I did erase my LinkedIn and I have just the prime gen LinkedIn where I post very powerful CEO stuff, like really strong, really strong, strong-willed ones. Let me just read you one really quickly.

Lane: Yes.

Track 1: Hold on just one second. Shut door, please.

All right, let's see. All let's see. Here we go. I am once again telling you to try harder. Put a little trademark above, tried harder. You are all cringe and need to do better. Thank you. Hashtag

grind. Set. Hashtag try harder. Hashtag Don't be sorry. Beat better. Hashtag creatin.

Lane: All [01:04:00] I didn't find that account

to

Track 1: So I have, I have

Lane: LinkedIn is where happiness goes to die. I

Track 1: oh, yeah, yeah. No, it, I, I fully I fully, fully realize that like LinkedIn is just a terrible place, so I just try to lean into it.

Lane: Yeah. For everyone listening, by the way, I should caveat that you like, if you're going to get your first developer job,

Track 1: LinkedIn's great.

If you're looking for jobs. LinkedIn is good.

Lane: I'm just saying I don't have fun on the platform

that's there. There's the, there's a disclaimer.

Track 1: I'll read you one more of what I thought was particularly good. L GTM is such a weak mindset. You are, okay. Let's see. Odd. You are okay with mediocre code. Losing losing imperfection of the craft. When you stop getting angry at bad code, you've lost twice.

There's always a knit to comment on and always room for improvement. Never settle. That's why I announced today at the startup we'll only be using l g E for enough tm. We respect the craft. We choose when speed is more important than perfection.

Lane: I, I have found that I am the personal kind of manifestation of that meme where, [01:05:00] man, if you give me more than five or six files changed, it's gonna be an l g TM for

me.

Track 1: yeah, same here. If it's over 150 lines, I go you know what, I'm sorry. Or congratulations,

Lane: oh man I'm gonna let you get back to your

family or your work or whatever it is you do at four o'clock on a Friday afternoon. But thank you

Track 1: I'm gonna go play Eldon ring with the kiddos

Lane: Heck yeah. That sounds fun.

Cool. I'm gonna stop the recording. There might be,

#014 - Building the Best Tools and Tests with The Primeagen
Broadcast by