WEBVTT

0:00:00.000 --> 0:00:08.720
<v A>Hosting provided by HostTornado. They offer website hosting packages, dedicated servers, and VPS solutions. HostT.net.

0:00:15.560 --> 0:00:20.300
<v A>Programming Throwdown, episode 35, Haskell. Take it away, Patrick.

0:00:20.939 --> 0:00:25.940
<v B>Welcome to another episode of Programming Throwdown, here late at night on the shores of Lake Michigan.

0:00:25.940 --> 0:00:31.480
<v A>You know, if we average one episode a month, we're close to the three-year mark.

0:00:32.280 --> 0:00:36.720
<v B>We used to do more than one episode a month, but now we've been pretty regular at once a month.

0:00:37.640 --> 0:00:42.505
<v A>Yeah, but then we had that break, too. Oh, that's true. Yeah, I don't know what the average span is. I think we did

0:00:42.505 --> 0:00:48.800
<v B>14 each in our first couple years or something. So I think we're actually on the fourth calendar year that we've been doing this or something.

0:00:48.800 --> 0:01:04.341
<v A>Man, actually, a co-worker of mine watched or listened to the first episode, and he was telling me, 'Oh, I started using your tool of the show,' and I had no idea what he was talking about because it's been so long. Dude,

0:01:04.341 --> 0:01:05.400
<v B>That was four years ago.

0:01:05.920 --> 0:01:07.412
<v A>I know. Yes.

0:01:08.020 --> 0:01:11.320
<v B>We didn't even live in the same states that we do now.

0:01:12.039 --> 0:01:13.909
<v A>That's true. That was a long time ago. That's true. All.

0:01:13.909 --> 0:01:52.100
<v B>Right. Well, first, I want to start off with a shout-out to the Player FM team. They sent us a nice email showing us actually a picture of Google I/O, and they were demoing an application they made. You can check it out. That allows you to listen to podcasts, and they featured programming-related podcasts and specifically Programming Throwdown at Google I/O. So if you're at I/O and you saw our picture, why did you not also send us that picture? That would have been cool. But anyways, some of you may be listening for the first time from that, although that was a little while ago, so you probably already listened. But thank you to the Player FM team for that honor.

0:01:53.420 --> 0:02:00.880
<v A>Yeah, definitely. We appreciate it. That was totally unexpected, and it was really a privilege to be at Google I/O.

0:02:01.120 --> 0:02:03.360
<v B>Do you care what your job title is?

0:02:05.240 --> 0:03:53.560
<v A>Yeah. I don't know. I mean, this is one of these tough questions. So I actually got asked this a few times. Once on Quora, somebody asked me to answer it, and then coincidentally, twice in real life, two different people asked me. And basically, the gist of it is, you know, it comes along the same lines. Like, you know, I'm applying. You know, one company gave me a job title. You know, one company gave me a job title. The other company gave me a job title. Why? And it's not like one is, well, and so the idea there is, it's not like one is, like, Chemist and the other is Computer Programmer, right? I mean, they're all kind of programming-related. It might just be one is, like, a Senior and the other isn't. Or you're, like, Senior Staff Engineer at a company of four people, but you're just regular engineer, like a huge company. You know, or you're a Data Scientist versus Software Engineer. And the reason why, the reason I've heard of reasons why it actually does matter is for visa. It's kind of unexpected. But I have a colleague who's going for his, I guess they call it the E-1A visa, which there's many different visas that you can get to work in the U.S. And the E-1A is, E stands for Exceptional. And it's for people who have just a lot of publications or Nobel Prize, you know, people contributed to Nobel Prize, you know, projects or things like that. And so this person felt like, you know, getting the Scientist title would sort of help his visa situation. But, you know, outside of that, I mean, that could be true. I'm personally of the mindset that it doesn't really matter. But what's your take on it?

0:03:53.560 --> 0:05:39.979
<v B>Yeah, I mean, if you have, well, extenuating circumstances, maybe sounds bad. But yeah, unless the visa thing, I don't know anything about that. But as a general rule for me personally, no, I don't think it matters. The problem is every company defines them differently. And different companies have different expectations. So if you're CTO of your own startup, or, you know, CEO and CTO of your own startup, that means something different than if you're CTO of Facebook. Right? So like, they're not even in the same class. And those are obviously an extreme example. But being a Senior Engineer at one place or not Senior Engineer at another, you know, it just depends if it's a newer company versus a more legacy company, depending on what field it's in. And, you know, what kind of mapping they do or want to be able to say we have, they may push people to be Senior because they want to be able to say we have this many Senior Software Engineers working on something. Right? And they can skew and play games with it. And ultimately, that's something that's actually really hard to find out before you accept a job at a company. It's not something that you're going to be able to ask a question like, what is the number of years of industry experience a person with this title typically has in your company? Right? They're going to be like, either that's not like that's personal or like protected to the company or they don't know. So and so it's really hard once you're in a company, you have a feel. But before you join a company, I don't know, I think you I don't know that has any correlation to your responsibility or your pay. So the things that really show a company how much a company cares about you is how much they offer you and like the perks and the kinds of things and then what kind of role they describe having a vision for you. And depending on the company, that role may or may not be something you actually end up doing. But I think that's how a company.

0:05:40.180 --> 0:05:56.987
<v A>So to play devil's advocate, though, right? Like if you if you have a higher title, then like, you know, if you're let's say you're applying, let's say you want to change jobs. Right? So the recruiter, you know, on day one, they don't have as much to go off of. If you're

0:05:58.928 --> 0:06:09.940
<v A>like, you know, really like Senior Staff Software Engineer versus if you're like Level One Software Engineer, the recruiter is going to kind of put you on a different path. Right.

0:06:10.820 --> 0:06:14.280
<v B>I don't. I mean, I guess it depends on maybe a bad record.

0:06:16.240 --> 0:06:16.697
<v A>No.

0:06:16.697 --> 0:06:45.219
<v B>I mean, you should because some just have Software Engineer. Right? Like that's just it. Or especially if you work at a place that isn't a software engineering firm. Right? Like they mostly do something else. You may just be Software Engineer and you need it's up to you to describe your role. Right? Like I manage a team or I'm an individual contributor, or and people always kind of lie on their resume a little. But I think part of the interview process should hopefully be them trying to figure out like what level of responsibility you have at your current company.

0:06:46.580 --> 0:07:04.319
<v A>Yeah, that makes sense. That makes sense. Yeah. I also agree that it doesn't it doesn't really matter. I mean, it sounds like this visa thing has some carry some weight because, you know, your your visa packet goes to somebody who probably knows nothing about the industry. Yeah. You know, whatever industry you're in. I would

0:07:04.319 --> 0:07:05.162
<v B>say so. So

0:07:05.162 --> 0:07:06.563
<v A>That makes sense. But

0:07:06.563 --> 0:07:09.960
<v B>Yeah, it doesn't matter. But it does matter. It does sound nice.

0:07:10.060 --> 0:07:11.507
<v A>Why do you think it doesn't matter? When

0:07:11.507 --> 0:07:17.340
<v B>You have a good title, it sounds nice. Right? Like it's like, oh, I got called a better title. Right? Like that's nice.

0:07:17.520 --> 0:07:26.820
<v A>Maybe it has that psychological, like, you know, because you have a better title, you go in with more bravado. Yeah. I don't know. That could happen.

0:07:27.539 --> 0:07:39.200
<v B>I think it's just too complicated. It could go either way. So the variance of what it means is too high. Whether it means a little or a lot depends on so many things that you just can't weigh it properly.

0:07:40.600 --> 0:08:08.106
<v A>Yeah, that makes sense. I mean, I would think that some of the larger companies probably have some kind of matrix where it's like, okay, if this person comes from Intel and they have title X and will like, you know, start off assuming that there'll be title Y at Microsoft or whatever, you know, there's probably that at the very large scale. So if you're going from one huge company to another. But like, yeah, in general. But why does it

0:08:08.106 --> 0:08:31.780
<v B>Why do they care about? And this goes back and this isn't, you know, I don't think you should take a job just based on salary. But the reason that I've ever heard of recruiting or managers hiring people ever care about what level to place them is always because they're trying to get to a target salary. And typically the salary you're able to put someone is based on the position at your company. So like by moving them up one title, you can give them more salary.

0:08:33.400 --> 0:08:48.680
<v B>And so the only reason they've ever wanted to move people up is because they want to make them a more competitive offer, not because they thought they were a more skilled worker. But that's dependent on the company. So that's why I said like the actual revealing bit of information is your salary offer, not the title.

0:08:50.091 --> 0:09:07.300
<v A>But then on the flip side, right? If you don't reveal your salary when you're negotiating your future job, then they still have your title unless you don't reveal that. That's true. Yeah. So I guess like they could try to infer your current salary from your title.

0:09:07.320 --> 0:09:09.120
<v B>But then maybe that just means you should never reveal either.

0:09:10.260 --> 0:09:25.140
<v A>Yeah, you probably shouldn't reveal either. I think we talked about this in the actually, you know, we had an interviewing show, but we never had a salary negotiation show. That's a stressful show. Yeah, that would be that would stress me out. I don't want to give people advice there.

0:09:25.140 --> 0:09:42.600
<v B>So I watched—I managed to watch the final game. I tuned in just at the right time to watch the conclusion of The International, which sounds like a movie, but it's actually Dota Defense of the Ancients, Ancients Defense of the Ancients. I think that's what it stands for.

0:09:42.680 --> 0:09:43.540
<v A>Yeah, Valve.

0:09:43.920 --> 0:10:13.150
<v B>A video game. We're talking about video games by Valve and the world champions or whatever ship is called The International. And it made a bunch of press this year because the prize pool was $10 million. And I think the winning team got just over five million dollars, and there's five people on a team. So it became instant millionaires each, which is pretty cool. And one interesting thing is that Valve didn't put in the prize pool themselves. People bought items in game in order to increase the prize pool for the other competitors. Yeah.

0:10:14.078 --> 0:11:45.524
<v A>This is totally genius. So Valve came out with Dota Defense of the Ancients 2, or Dota 2. And they had a—you know, they didn't want to unbalance the game. Like there's a game that came out called Battlefield Heroes where you could, it was free to play, but you could buy like a better gun or whatever. Right? And it wasn't very popular. It was reasonably popular, but it wasn't that popular. And the big thing is, you know, the more competitive you are—and most people who play Dota 2 are just have a competitive nature—the more, like, you don't want things that, you don't want money to influence the game. You don't pay to play; pay to win. Yeah, exactly. Pay to win. That's right. But so what these guys did is they took a page out of the Korean MMO handbook and said, okay, we're just going to sell like funny hats and sweatshirts and weapons that don't actually do damage like any more than normal. There are different looks. And so it just—yeah, we'll sell looks. And I remember kind of thinking this is ridiculous. And I remember thinking like, okay, one of these days I'll spend, you know, some money and buy a hat just because I like the game. But it ended up not happening. But then what they did was they added this donation thing. So now it's like not only is there a donation aspect of it where, you know, your money will go—part of it will go to these, you know, top-notch players. But then also they added like an achievement kind of system. The point is like they finally hit the formula on how to get money from people without affecting the game. And

0:11:45.574 --> 0:11:57.480
<v B>There was something more complicated too. Like I think as they crossed certain, like almost like a Kickstarter campaign as well, like as if you bought it and then enough other people bought it, you got more benefit from having bought it or whatever.

0:11:57.980 --> 0:11:59.800
<v A>Yeah. There's a pyramid scheme basically. Yeah.

0:11:59.980 --> 0:12:41.699
<v B>Not exactly. But yeah, something like that was more complicated. Anyways, but whatever. Got a lot of press attention for them. I wonder how many new people played the game. I mean, I never—I'd heard of the game. I've never played it. Still haven't played it. But I actually know how it's played now versus I didn't. Nice. And they had a bunch of simultaneous streams going. So like, you know, different languages. But then also, if you've never played the game, like a newbie, and it's confusing because a team that won is called Newbie. Oh, spoiler alert. Oh, nice. But then they had a Newbie channel, like a new player channel, which like if you've never played before, instead of just using the weird acronyms and slang, they would try to explain what was going on, which of course it was still happening in real time. So they didn't fall behind, which made it hard. Like, okay, hang on. We'll come back to that because this is what's happening now.

0:12:42.561 --> 0:12:43.304
<v A>But yeah, I

0:12:43.304 --> 0:13:02.959
<v B>thought that was nice. And it was cool to watch a video game. We actually had real announcers. They had like fireworks when the team finally won, you know, and it was really, you know, I can't say that I'm a big fan of watching video games. I've never really watched them before, like live or anything. But, you know, it was kind of interesting to watch.

0:13:03.839 --> 0:13:11.704
<v A>You know, I'll try it. I've never watched video games live either, but I've been hearing a lot about it. Is it still going on? No, so it's

0:13:11.704 --> 0:14:00.000
<v B>done. I think League of Legends is currently in some sort of tournament now, which is the other big MOBA. But this one is done. The team won a team Newbie from China. I think actually two teams from China were in the finals. And yeah, so the thing was that, you know, you watch it. And because this game is actually really quite complicated and hard to explain and very fast, like your actions per minute really matter. It makes it for a little bit of a weird thing. So like this attack happens and just kind of like finishes very quickly. It's like you kind of don't know what happened. And they also it's, you know, a big map and they move around the map very quickly to show you different things happening in different places. So it was a little hard to watch. It wasn't as nice as, say, you know, watching a football game or basketball game where there's nice breaks in the action where they can show you an instant replay. And

0:14:00.119 --> 0:14:01.502
<v A>Yeah, there's only one ball

0:14:01.502 --> 0:14:06.340
<v B>And only one really center of action. And yeah, this is just kind of crazy.

0:14:07.620 --> 0:14:11.948
<v A>Wow. Yeah, I'll have to check this out. I'm sure I can watch Archive. Oh, I'm sure. Yeah.

0:14:11.948 --> 0:14:17.382
<v B>Yeah, yeah. But I was, you know, I watched some of it on Twitch. Is it Twitch.tv? I don't know. Oh,

0:14:17.382 --> 0:14:18.833
<v A>Yeah. Twitch is. Yeah. So

0:14:18.833 --> 0:14:33.059
<v B>It was actually really cool. And it was crazy to see the number of people watching. Like when I tuned in, you know, towards the end, there was on just the stream I was on, which was like the mainstream or whatever. I think I want to say there was up to almost like 300,000 people watching it simultaneously. Like when I was

0:14:33.059 --> 0:14:33.820
<v A>watching. Oh, my God.

0:14:33.920 --> 0:14:42.509
<v B>And that was just one channel that was live. It was like middle of the day, West Coast time. I don't know what time was other parts of the world. But yeah, that was

0:14:42.509 --> 0:14:44.348
<v A>Like one channel, one time. Like that's actually,

0:14:44.348 --> 0:14:54.960
<v B>You know, it's not a football game can probably generate, you know, millions and millions of views, even for a non-championship game. But still like 300,000 is a lot of people to just watch a video game. Right?

0:14:55.384 --> 0:15:01.940
<v A>Like, yeah, I would argue most football games that aren't playoff games won't have that kind of attendance, I think.

0:15:01.965 --> 0:15:06.980
<v B>I mean, that's hard to say because some football games are like, oh, like 100,000, almost 100,000 people in them just live.

0:15:07.360 --> 0:15:32.760
<v A>Yeah. But that's a third of. Yeah, I guess that's true. But the other thing that I was going to say is Twitch TV is actually amazing. Like right now they're focused on games, but I don't really see why Twitch TV can't just do anything. Like anytime someone wants to stream anything, you know, like Twitch TV could do that. I mean, like I think it's just a matter of time before they branch out to just doing streaming video for everyone.

0:15:33.600 --> 0:15:40.320
<v B>Yeah. Seems really popular with certain groups of people. But yeah. Check it out.

0:15:40.340 --> 0:15:56.560
<v A>Yeah, I guess it's true. It's like they have a good niche, but it just seems like I mean, everyone should just—I guess there aren't that many things, though, that you would stream. Right? Because you still have to be on your home Internet unless they support cell phone.

0:15:56.620 --> 0:16:08.760
<v B>I mean, I think it's a big market already for them, like between, you know, these battle games. Like Minecraft has a lot of live streaming. I saw people streaming even like the World of Warcraft card game. What is it? Hearthstone.

0:16:08.960 --> 0:16:10.360
<v A>Oh, yeah. I've been playing that.

0:16:10.360 --> 0:16:12.460
<v B>a little on my iPad. I should have made that my tool.

0:16:12.460 --> 0:16:15.743
<v A>Yeah, it's pretty fun. I've been playing it on the iPad as well. Yes.

0:16:15.940 --> 0:16:20.060
<v B>I really like that game. And there are people who live stream playing that game, I think I guess from their PC.

0:16:21.280 --> 0:16:21.680
<v A>Right.

0:16:22.020 --> 0:16:25.320
<v B>But yeah, it's like people stream what I would consider maybe strange stuff.

0:16:25.700 --> 0:16:48.059
<v A>But yeah, I mean, I would love to live stream my hikes, like I just strap a cell phone in my arm or something. Google Glass. Oh, yeah, that's right. Yeah. Maybe Google Glass will do. But Google Glass doesn't do streaming. Right? I mean, they do Hangouts. Yeah, you can do Hangouts. But they don't do—but that's different, right? This is like I don't think you can have a thousand people in your Hangouts. Hangouts.

0:16:48.059 --> 0:16:48.700
<v B>on air, man.

0:16:50.286 --> 0:16:51.029
<v A>That's what people stream.

0:16:51.029 --> 0:16:57.360
<v B>to YouTube. But I don't know if you can do that for me. I have no idea. Oh, anyways, it's just software, man. Just software. All right. All right.

0:16:57.840 --> 0:18:47.922
<v A>It's just software. Next item. Yeah, next item. So there's TypeScript, which is actually—we talked about this before the show. We're going to definitely do an episode on all of these JavaScript, you know, compiled to JavaScript languages like TypeScript and CoffeeScript and things like that. But there's a short story on this is, you know, JavaScript is the only, the JavaScript VM is the only VM that's in all popular browsers. And so if you want to write code that works on someone else's computer, which is most likely going to run on their browser, and so it's most likely going to be in JavaScript. With that said, JavaScript isn't really designed for writing, like, very complex, or let me just step back. JavaScript is one language. And as we know from watching this, from listening to this show, you know, there's many different languages, and each one kind of serves their purpose. So you'd like to do other languages, but you have JavaScript. So there's a lot of these languages, such as TypeScript, which compile to JavaScript. So you can write in something else, but still run on other people's browsers. And TypeScript is actually made by—actually, it was made by a company that was bought by Microsoft. But the compiler has been open sourced, but it really hasn't built a lot of community around it. And now there's CoffeeScript, and there's other competitors that are pretty good. So they decided to move to GitHub to get sort of that community aspect of GitHub, and they rewrote the compiler, which is pretty cool. It's got a lot of improvements. But in general, you know, GitHub is another one of those things, like Twitch TV, that is just really amazing to me at how it's just kind of changed the whole ecosystem of programming. It's like

0:18:47.922 --> 0:18:49.340
<v B>the Craigslist of source control.

0:18:51.000 --> 0:18:52.780
<v A>Like the Craigslist? Let me think about that.

0:18:53.069 --> 0:18:53.963
<v B>I don't know what that

0:18:53.963 --> 0:19:00.645
<v A>means. I just thought it sounded really deep. It did sound deep. Yeah, I can't quite comprehend that. No, just because everybody says,

0:19:00.645 --> 0:19:13.116
<v B>like, Craigslist killed the newspaper classifieds, which is where newspapers made a lot of their money. And so, like, GitHub kind of killed, like, a lot of people trying to charge for essentially the same service. But that's not

0:19:13.116 --> 0:19:14.652
<v A>really a good analogy, because it

0:19:14.652 --> 0:19:20.800
<v B>mostly just made it better, as opposed to doing the same thing cheaper. Terrible analogy. I'm sorry. I apologize.

0:19:20.800 --> 0:20:19.722
<v A>The thing GitHub did that I think really is what took them to the top is the way that different users could interact with each other's branches, like with each other's repositories. You know, the idea that, like, somebody could create a branch of my repository and then ask me to merge it back in. Like, that was, you know, in my opinion, like the big innovation there. Like, I put Hyperneet, which is my PhD dissertation source code on GitHub. And it has, like, a ton of forks. And somebody went off and made, like, an arcade, or sorry, an Atari, like, emulator AI. And, you know, just a ton of crazy things have been forked from it. And I can actually go back and look at what's been forked, even though I don't know any of those people. I think that that is, like, something pretty amazing that GitHub did, you know. I'm

0:20:19.722 --> 0:20:48.100
<v B>a terrible person. I've been using Git recently. Like, I've been trying to learn it more. It's just not clicking with me. I've just not found the right explanation or way to grok it in my head. And I just, not that GitHub, but Git itself. It's just not, like, it does not mesh with my way I've been doing source control. So, since I didn't start off doing it, I'm trying to figure out, like, how to adapt. And I think that's the wrong approach. And so, I've got to work it. But right now, you know, I'm not impressed. I don't care for Git.

0:20:48.100 --> 0:21:23.712
<v A>Yeah, so Git, it took me a long time also to learn Git. And I kind of thought that Git was just kind of ridiculous. And it didn't make sense for a long time. One of the, a couple of things that really helped me early on was Git Stash. I don't know if you've used that. But, yeah. So, I used to think that, like, you had to just commit all your changes before you could switch branches. And that was kind of frustrating because I'd have two branches that were halfway done and I couldn't figure out how to switch. But Git Stash lets you do that. And you'd also stash and then update a branch and then unstash. And it kind of just starts to be the right thing. So, I should have

0:21:23.712 --> 0:21:40.400
<v B>Correct. Git works fine for me locally. But, you know, ultimately, the idea of Git is to, like, share with other people. And that's where it starts to fall down for me. I start to have problems. But maybe it's specifically the collaboration tools that the team I'm on has been using. But, yeah.

0:21:41.460 --> 0:21:45.869
<v A>That's possible. Anyways. Yeah. Mesh networks are pretty.

0:21:45.869 --> 0:21:53.720
<v B>Cool. And I read an article about, I don't know. I'm trying to say deep things. I don't know if it's working. Mesh networks are meshy.

0:21:54.700 --> 0:22:02.035
<v A>They're totally. They're mesh like a sieve. This guy's wearing a pink shirt. This guy's wearing a pink shirt and his name is Valentine. That should make you look at this. Okay.

0:22:02.200 --> 0:22:19.240
<v B>So, Oakland is a city near where Jason and I live, sort of, in the Bay Area of California, near San Francisco. And it's known for its... San Francisco is known to be kind of quirky. And Oakland is even more quirky. I don't know the right word.

0:22:19.240 --> 0:22:20.780
<v A>Is that true? Wow. I did not know that.

0:22:21.020 --> 0:24:14.020
<v B>Yeah. So, Oakland... Yeah. So, you hear a lot about, like, protests and stuff from Oakland. And in a similar vein, I guess, one of the things that Oakland... So, they've had some problems with trying to organize awareness events, let's call them. And the various authorities deciding to, like, shut down cell towers or Wi-Fi connectivity. And this has been a continuing problem for them. And also, being near such tech-minded people, they've decided that internet is a basic right. And that they would like to have uninterrupted network connections. So, they've decided to build a mesh network, both to provide kind of guaranteed access and also to get around any potential censorship. So, trying to avoid if someone decides to censor something, you know, try to get around it. And so, it's basically just about a group of people trying to, I guess, work against the man to build a mesh network. But it's kind of interesting. And they're talking about, I guess, the group of people trying to establish this in Oakland, studied one that was used in New York State when a hurricane hit. And did a pretty good job surviving. And actually was used for some of the people right after the hurricane. And it was, like, the only form of connectivity it had, even when, like, cell towers and stuff were down. And so, that is a great idea. You know, people always say that about ham radio operators. And how it's really useful to be a ham radio operator right after an emergency and how much help you can be. And this is also something that I think would be great to get involved with. Not, even if you don't really agree with the dissident nature of it, perhaps. Or, like, you know, using it to coordinate protests. But, like, the ability that when a natural disaster happens, an earthquake, a hurricane, what it may be. You know, making sure that people have another way of getting on that isn't controlled by kind of just a couple people. And maybe, you know, at risk to single point failures.

0:24:15.660 --> 0:24:34.379
<v A>Yeah, that makes sense. I remember there's a lot of research on, like, mesh networks and, like, all sorts of graph theory. And what's the, like, lowest power way to get internet to everybody and all of that. And, yeah. But I didn't see too much beyond that. So, it's cool that someone's actually building a real one instead of just theorizing.

0:24:36.610 --> 0:24:39.199
<v A>All right. So, my article's on, oh.

0:24:39.600 --> 0:24:40.540
<v B>Nope. Good. You're good.

0:24:41.699 --> 0:25:00.842
<v A>Sorry. My article's on the Raspberry Pi. Basically, there's a new version of the Raspberry Pi. And it's pretty cool. I actually have never owned a Raspberry Pi. But I did have a Gumsticks, which is kind of a similar idea. But it was kind of a little bit more niche. I think Raspberry Pi is much more mainstream. I think it was going to

0:25:00.842 --> 0:25:05.780
<v B>be niche, but it hit mainstream. Or maybe it wasn't. It was, like, the first thing to end up becoming mainstream.

0:25:06.860 --> 0:25:13.397
<v A>Yeah, that's right. It was definitely mainstream by accident because they had such a huge backlog. Or maybe people did it on purpose, right?

0:25:13.600 --> 0:25:16.879
<v B>Like, people always intend to be mainstream. It just never works out.

0:25:18.500 --> 0:25:24.029
<v A>Maybe, yeah. But, yeah. So, check it out if you're a Raspberry Pi fan. This one has a bunch of upgrades. It

0:25:24.029 --> 0:25:38.220
<v B>fixed a lot of nits people were having. I also don't own one, but I keep telling myself I'm going to get one. And then I'm going to have all these projects to use it for. But I never quite have, like, oh, I'm ready to start this project that needs it and order it. And so, I don't want to just buy one and have it sit around. I have too much of that kind of stuff.

0:25:39.139 --> 0:26:23.699
<v A>Yeah, that's the thing. Like, I hit my critical mass of things that just sit around and collecting dust, including me. Yeah, I sit around already and collect dust. Yeah. All right. Time for the book of the show. Book of the show. My book of the show is Start With Why by Simon Sinek. So, I actually got back into watching TED Talks, which is pretty epic. I just love them. And I can't believe it's been so long since I saw them. Actually, TED Talks were kind of on the decline in the sense that, well, they started the TEDx, like the franchise TED Talks. And then they started in the stream, like, mingling the TED with the TEDx Talks. And so, the quality basically went down. Yeah, I stopped

0:26:24.120 --> 0:26:26.140
<v B>watching because most of these are not good.

0:26:26.140 --> 0:27:18.188
<v A>Yeah, I mean, I watched like ten talks in a row from TEDx Women. And, I mean, you know, women are great. They make up half of the world and they have a lot of great things to say. But, like, TEDx Women was geared for a specific genre of talk. It was a lot about, like, feminism and things like that. And it was too niche, right? And I got ten in a row of those. And I was like, okay, you know, I'm kind of done. And so, they started doing that. But now they're back. You know, the past, like, ten or eleven TED Talks on the YouTube stream have all been from the main TED conference. And they've been amazing. I'll have to check it out. And one of them was from Simon Sinek, who I was so impressed with his talk, I got his book. And I've been going through it. Wait, like

0:27:18.188 --> 0:27:19.319
<v B>Dead Tree version? Basically, the

0:27:20.685 --> 0:28:38.100
<v A>Dead Tree version. No, I got the Kindle version. Yeah. So, I'm saving some trees, hurting some bits. Those bits are like just burning at the stake. So, basically, the book is about different companies. And, actually, it really kind of covers this idea of company culture and sort of what that means and how to sort of have a strong culture, like, internally and externally. And it has a bunch of great examples. It goes over a variety of different companies. But one of the things to really take away is they say, you know, when you're pitching something, don't start with what? They say, like, companies that start with what end up becoming commodities. So, for example, if you say, we're Intel. We make a processor that's, you know, 1.2 times as fast. You know, it's 20% faster than the other processor. So, if you start with what? You become a commodity. Like, you're only as good as your 20% improvement. And if the other company comes with, like, a 30% improvement, then people just go with that, right? But if you start with why, like, you know, let me pick on a company here.

0:28:39.740 --> 0:28:54.521
<v A>Tesla. Like, Tesla. We believe, and I don't know what Tesla believes. I'm just making this up, right? But it's like, Tesla, you know, nobody should have to, you know, put fuel in their tank again. Or Tesla, like, why are we... Saving the world.

0:28:54.500 --> 0:28:55.400
<v B>One tank at a time.

0:28:57.100 --> 0:29:10.260
<v A>Yeah, but it's not only about... So, saving the world is also a what, right? So, you have to ask, like, why save the world? Wait, you have to say why save the world? Yeah, of course.

0:29:12.780 --> 0:29:23.000
<v A>Or, more specifically, why, you know, why what Tesla is doing is saving the world more than other things. You know what I mean?

0:29:23.164 --> 0:29:24.500
<v B>I'm going to watch this talk. I'm intrigued.

0:29:25.419 --> 0:30:26.020
<v A>Yeah, I'm not doing a good job because I'm not Simon Sinek. And the reason why I like this book so much is because it's... It really... He does an amazing job explaining something that is pretty innate and biological. And he actually goes into biology and chemistry of the brain and things like that. And he's done a lot of research, and he explains something which is, you know, you often get these kind of feelings. Like, I remember when I got my first iPod. And the way that you could endlessly scroll through your music because it had the wheel, right? The little touch-sensitive wheel. And instead of having, like, the Zoom had the thing that you slid with your thumb. And you had to, like, bring your thumb back to the starting position and slide it again. But the idea that, like, you could just slide forever with your thumb. There's something kind of innately cool about that. It's sort of like when you watch Plinko in The Price is Right. Like, there's some neurons that fire, and you get a kick out of watching a little disc, like, bounce on those pegs.

0:30:26.020 --> 0:30:30.719
<v B>We are totally so deep in analogy in this show.

0:30:31.600 --> 0:30:32.540
<v A>Yeah, I've gone too far.

0:30:32.959 --> 0:30:34.780
<v B>Saving the world is like a Plinko board.

0:30:36.100 --> 0:31:10.523
<v A>Yeah. But there are many of these things where they're innate to our biology. Like, we get a kick out of it and we don't really know why. It's not a logical thing. And he goes into a lot of that when he talks about sort of how to, you know, both sell a company and how to build identity at a company or at any type of organization or family or what have you. And, you know, I'm only about halfway through it, so I still have quite a bit to read. But I'm very impressed. And definitely, if you don't want to read the book, at least check out. Wait, so you don't know the ending yet. You can't

0:31:10.523 --> 0:31:11.991
<v B>recommend it without knowing the ending. He

0:31:13.358 --> 0:31:30.040
<v A>has two TED Talks, and they're both great. So, you know, the TED Talks take a total of what, maybe 40 minutes. And the book would take, you know, a few hours. So watch the TED Talks. If you like them, read the book. I've done both. Well, half of one and all of the other. And I'm a big fan.

0:31:31.080 --> 0:31:40.700
<v B>All right. My book of the week is a science fiction book, Childhood's End by Arthur C. Clarke. Classic science fiction book. Next.

0:31:41.020 --> 0:31:43.750
<v A>Is it a classic in the sense? Like, is it from the '50s? I

0:31:43.750 --> 0:32:09.200
<v B>don't know exactly when it was from. But it's definitely retro because the technology, the futuristic technology is really not chuckle-worthy, but just kind of like, oh, interesting. That's right. They didn't have computer screens. Yeah, right? Or stuff like that, right? Like, oh, you would use a, you know, it's like if someone said using the telegraph to talk to a satellite. It's like, what?

0:32:10.020 --> 0:32:10.940
<v A>Yeah. Yeah.

0:32:11.600 --> 0:32:12.600
<v B>No. Yeah. So.

0:32:12.820 --> 0:32:39.300
<v A>Yeah. It's amazing watching, like, watching or reading, like, science fiction material that's old because, like, there's one of them I read. I think it was maybe. Oh, okay. Like, like, in Snow Crash, they, which, you know, Snow Crash isn't that old, Neil Stevenson, but it, it, they describe this thing that is basically Second Life. But, you know, just at the time, it's just so crazy and outlandish because it's pre-internet, you know.

0:32:39.300 --> 0:32:52.060
<v B>So, yeah, I don't talk a lot about the book because I never know what to say without spoiling a fiction book. But it's interesting. It's intriguing. It's kind of weird, but, like, weird in a way that makes you think. So you should check it out if you've never read it before.

0:32:52.060 --> 0:34:50.580
<v A>Yeah, definitely. All right. So now I'm done. Tool of the show. Tool of the show. Show. My tool of the show is Uber. I used Uber for the first time. For people who don't know what it is, it is a phone app where you make an account. You associate it with your credit card or some kind of payment system. I think they're accepting, like, PayPal and things like that now. And then, and then it is a taxi service. And it's actually pretty amazing. So I'll tell you my experience quickly. My car broke and my wife, we towed the car to the dealership. Or, no, wait, sorry. My car broke, but it didn't, we also had to tow it to the dealership a month ago. But the last time it broke, we, a different car, we drove it to the dealership. I dropped it off and then my wife drove me to work. They had it fixed, you know, at the end of the day. And so I had to get back to the car dealership by myself. So I took Uber. So first things first, you go into the program. It, you know, because of your phone's GPS and other location services, it knows where you are, uses that information, and it gives you a little map. And basically says, here's where I think you are. Do you want to be picked up here? Then it shows you what kind of car, it gives you a list of car choices, and you can put in if you need a baby seat and things like that. I just need a regular Uber, right? So then it says, okay, cool. Where do you want to go? You put in your, you find your destination on the map, which works just like, I think it uses Google Maps, but it's just, it's very intuitive, right? Tap on your destination. You can also search for it. And then it'll give you an estimate of the price, which in my case ended up being right on. They gave me a range and ended up being right in the middle. And then it tells you, it will tell you how long before the driver gets there and so on and so forth. Then as soon as you accept, it shows you the driver before he's even gotten to you on the map.

0:34:50.699 --> 0:35:09.060
<v A>So you can sit there on your phone and like sort of like passively watch this little Pac-Man game being played out where the driver like makes his way over to where you are. It also shows you a picture of the driver. So, you know, it's like an Uber, the guy picking you up and not some like psycho killer, unless the psycho killer has a mask.

0:35:10.720 --> 0:35:29.380
<v A>Then the guy picks you up, takes you to the, wherever your destination is, and you just walk out. Like the payment's already done. You don't have to deal with tip. You don't have that awkwardness. You don't have to fumble around in your wallet for like dollar bills or anything. You just walk out. I thought the whole thing was awesome and highly recommend it.

0:35:30.720 --> 0:35:40.860
<v B>Nice. My tool of the show are store coupon apps. Save money. Don't be embarrassed. Don't have to worry about printing out before you leave. Just look it up while you're standing in line waiting. Done.

0:35:42.500 --> 0:35:45.535
<v A>Store coupon apps. Yeah, download apps for the store you

0:35:45.535 --> 0:35:47.640
<v B>shop at on your phone and get the coupons.

0:35:49.580 --> 0:35:51.542
<v A>Like what's an example of a store coupon app? So if you go to

0:35:51.542 --> 0:35:56.100
<v B>Target. Target has an app. You just download the Target app and they got coupons. Or Home Depot. I was at Home Depot.

0:35:56.400 --> 0:35:57.027
<v A>Oh. And I

0:35:57.027 --> 0:36:04.220
<v B>I was standing in line saying, 'Hi, I wonder if there's a coupon. I downloaded the Home Depot app. It's like, sure enough, here's a coupon. I just click it and the person scans it and I save money.'

0:36:05.600 --> 0:36:07.660
<v A>Holy cow. I did not know that.

0:36:07.660 --> 0:36:16.799
<v B>So I spend, I find that stores here can get very busy, especially if you go right after work because everybody else has the same idea. And so I stand in line and while I'm standing in line, I just cruise for coupons.

0:36:18.379 --> 0:36:27.030
<v A>I did not know that; so I've never installed a store app. I just saved you money. And I did not know that they had coupons. Oh my gosh. Like every—you should check like every

0:36:27.030 --> 0:36:27.759
<v B>store you go to.

0:36:28.819 --> 0:36:33.527
<v A>Yeah. I should just have a page on my phone. Or like right when you get to the store,

0:36:33.527 --> 0:36:38.460
<v B>you're like in the parking lot, like just pull it up in advance and be like, 'Here are the things I need. Like, I wonder if there's anything.' Oh yeah. Look there.'

0:36:39.859 --> 0:36:43.600
<v A>Oh man. That is amazing. Wow. Okay. Cool.

0:36:43.900 --> 0:36:44.732
<v B>That was very

0:36:44.732 --> 0:36:56.562
<v A>generic, non-specific, but no, I mean, this has such an impact on you. Yeah. I will definitely do that. I'll definitely get the Target app and the Whole Foods. Yeah. So

0:36:56.764 --> 0:37:24.100
<v B>like a grocery store Safeway has one too. And different ones have like, you know, sometimes they like, you know, have like a—not like a rewards program per se, but kind of where like they'll, when you scan it, they know what you can have like various coupons collapsed into kind of one scan and you just scan it and all the coupons that apply, it just takes them off. And then it recommends new ones for you that are related. Right? So that's their way to get you back to the store, but no, they tend to be pretty helpful and it's a store I already go to typically. So I don't really mind.

0:37:25.259 --> 0:37:27.038
<v A>Yeah. No, that's awesome. I'll definitely check.

0:37:27.038 --> 0:37:35.965
<v B>That out. Check it out. So now we're on to Haskell. So Haskell is a functional programming language. So Jason. Yeah. Real quick. Sorry to

0:37:35.965 --> 0:38:11.660
<v A>interject, but before we, before we, before we dive into Haskell, I just want to give a shout out explanation. No, shut up. Sorry. The, I know we said we'd do Swift. We'll definitely do Swift, but we got several requests over the week. We got a ton of requests actually over the week to do Haskell. Like every week. Yeah. Well, every week. Yeah. But especially this week we got blasted to do Haskell. And ironically, we got requests to do Swift after we had decided we were going to abandon Swift for Haskell this week. So it's sort of like, I don't know if people are messing with us. Yes. But, but anyways, so that's why we're doing Haskell. Brace yourselves. Swift is coming. Swift is coming swiftly.

0:38:13.820 --> 0:38:30.180
<v B>Yes. You completely botched my train. I had like an awesome transition too. It was, it was epic. Sorry. No, it's okay. Okay. So Haskell is a functional, a functional programming language. So Jason, why don't you start us off by telling us something about functions in Haskell?

0:38:31.520 --> 0:40:05.120
<v A>Okay. So one thing about Haskell's functions, they're first-class citizens. And a lot of people don't know what first-class citizens really means. Like it's a term that you hear, but nobody ever really defines it, at least not to me. Which probably means we have wrong definitions. Yeah. Yeah. So when that happens, you usually figure like, oh, it means that like I have a, like this vague nebulous idea of what that means. But all that means there's just a handful of things that you need to be a first-class citizen in a programming language. One is being able to be passed as a parameter. So in other words, like a function should be able to take this thing as an argument. It should be able to be returned from a function, which is, you know, very similar. And it should be able to be assigned to a variable. So if the particular construct you're talking about can do those three things, it's a first-class citizen. So that's why, for example, in Java classes, the actual class definition is a first-class citizen. Because you can actually pass the class type as a function parameter to some function that like needs that for something very specific. Right? But in C++, for example, classes are not first-class citizens. I mean, classes are, but class definitions. Class instances. Are not first-class citizens. That's right. But a class definition, like the names of the methods and things like that are removed by the compiler. And so it cannot be a first-class citizen.

0:40:05.760 --> 0:41:41.160
<v B>So, yep. And Haskell functions are first-class citizens, which allows you to build interesting things. Right? So one thing where I've used functions as first-class citizens before is, or just even, you know, kind of using functions in an interesting way is several times I've implemented kind of like a state machine. And, you know, a state machine kind of naively people tend to, you know, kind of like the first way you ever implement it. And sometimes it's the right way is you just have like an enumeration and the enumeration has all your states. And then the thing that gets called each update or whatever gets passed in what the current conditions are and whether you should transition a state is just a big switch case statement. Right? So you switch on the state and you have various cases to handle moving from one to the other. And it gets really messy. Right? Another way to do it is to have separate files or classes to represent each of the states. And then you essentially hold a pointer, a variable that, you know, points to the class as the function that should be called. So, hey, here's the update that should be called. This is maybe not a completely great example of like all that effort being a first-class citizen entails. But if you think about, you know, pointing to the function itself and then you may pass in, hey, here's the function, like a callback function. I want you to call when you're done changing your state or whatever. And that's how you kind of link the series of events to handle the state machine without having to have like a giant switch case statement. And it allows you to dynamically change the behavior so you can reconfigure what state transitions to which else based on something different. And it allows you to build up something really complex without having like really nasty spaghetti code.

0:41:42.720 --> 0:42:10.140
<v A>Yeah. Yeah, definitely. Another thing about Haskell, it's pure. So what that means is each function will do exactly the same thing given the same set of parameters. So there's no like global memory that you can mess with or anything like that. Like if you call a function with XYZ, it will return ABC every single time.

0:42:11.180 --> 0:42:16.919
<v B>Where? Yeah, yeah. Yep. That was confusing because at first I thought you meant variable named XYZ.

0:42:18.819 --> 0:42:36.500
<v A>Oh, no. Yeah. Yeah. If you call a function with a certain set of inputs, you will get exactly the same output every time. Well, provided that it's not based on time or something like that. But there's definitely, there's no other, you know, variables that can affect your function.

0:42:36.559 --> 0:43:08.799
<v B>So even the notion, and I find this a little difficult, and I'm not even barely scratching the surface of functional programming. I still have a lot to go. And I'm always trying to learn a little bit more because I think it's helpful in reasoning about other stuff. But is that even the variable name can be confusing in a pure language because it's not really variable. If you say X is equal to five, X always needs to be equal to five or else you're a liar. And so you can't change what X is equal to later on. If you said it's five, it needs to always be five. And so...

0:43:08.799 --> 0:43:10.562
<v A>Oh, so you're saying why call it a variable? Yeah, so

0:43:10.562 --> 0:43:19.040
<v B>it's not variable. Variable means it varies. Yeah. But it can't vary. So people say the variable X is equal, but it's, well, it's not a variable. It can't vary. Right.

0:43:21.227 --> 0:43:24.940
<v A>Well, what if X is equal to a function that was?

0:43:26.442 --> 0:43:33.279
<v A>Based on input from a file or something? Maybe if X is equal to a function, then it could vary. Right?

0:43:34.000 --> 0:43:42.000
<v B>But if you say X is equal to the function addition, it needs to always be equal to the addition function. Even if it does different addition, it still has to do addition.

0:43:42.080 --> 0:43:44.498
<v A>Oh, you're right. That makes sense. But one of

0:43:44.498 --> 0:44:21.279
<v B>The... So it does turn it up on its... So the alternative to functional programming is typically called imperative programming. You know, things execute line one, then line two, then line three. And so one of the things that turns on its head is the fact that you have to think about things differently when you can't just change the state willy-nilly, as we'll say. And when things don't just go around changing what other things are, you have to kind of think about it differently if you first learned imperative. And there seems to be a debate about which one's easier to learn first. Like if you... Is it hard to learn functional programming or is it just because we mostly learn non-functional languages and then try to learn functional later?

0:44:22.821 --> 0:45:09.025
<v A>Yeah, I read this interesting article that talked about functional languages using Excel spreadsheets as an example. What? Yeah. If you look at an Excel spreadsheet... Like Excel is a functional language. Because if you look at an Excel spreadsheet, each of the cells contains a function of the other cells. But there's no order. So it's not imperative, right? So you're not saying, 'You know, compute this cell and then compute that cell.' You're just saying this cell is based on these other cells. And then you're relying on Excel to realize the value of the cells in an order that makes sense. And like, I think... I wonder what happens if you create a loop in Excel. It probably just... Oh,

0:45:09.025 --> 0:45:10.206
<v B>It just... Yeah, it does.

0:45:10.206 --> 0:45:10.932
<v A>Everything that's...

0:45:10.932 --> 0:45:17.294
<v B>Can't... It can't evaluate. It puts like a special flag. It basically says something's wrong. Like does

0:45:17.294 --> 0:45:51.820
<v A>Not compute. You could say like A1 equals B1 plus C1 and B1 equals A1 plus C1 or something. And then it's just like a whole world falls apart. Or just A equals B and B equals A. If you just put that in, you get all errors, I guess. But at any rate... So Excel is a perfect example of a functional language that everybody has used. Maybe not everybody, but... You don't think... I mean like, again, this is like debatable, but what do you constitute as everybody? I would consider... I mean, because think about it. I'm sure our parents use Excel. No,

0:45:51.820 --> 0:45:55.819
<v B>I was just... Okay. Yeah. You have a fair point. I was just being pedantic.

0:45:57.440 --> 0:46:06.029
<v A>I think... No, but I mean, it's interesting. I wonder what percentage of, say, Americans or let's say Westerners... We'll say people listening to this podcast probably

0:46:06.029 --> 0:46:08.200
<v B>have a pretty high chance of using some sort of...

0:46:08.200 --> 0:46:27.340
<v A>Oh, yeah. People listening to this podcast is probably close to 100%. But yes. But anyways, so if you think about Excel and how it works, that is sort of a good introduction to a functional language because you just put a bunch of functions all over the place and then you just let Excel take care of everything.

0:46:27.700 --> 0:47:31.920
<v B>And one of the happy benefits or one of the reasons why you would want to have this pureness where things don't change, right? You can say that if X is equal to 5, it's always equal to 5. If I pass in some value... There's no side effects. So if I have the function addition and I pass in 1 and 2, I will always get 3. It allows you to do things that you can't always do without a very large set of restrictions in another language, which are kind of reasoning about a program. So if I validate that 1 plus 1 always equals 2 in Haskell... 1 plus 1 equals 2. 1s, right? Like I don't need to keep checking it with varying other states of the program because it's just not a thing. So you can say something about the correctness of a function. And the compiler can reason about what stuff will be and what's safe to change or not change. Versus if you're referencing a global variable, for instance, it has to believe that global variable could change at any time. And so it can't reason about the interaction of that global variable to the rest of the function that may have nothing to do with that global variable directly.

0:47:33.600 --> 0:47:47.840
<v A>That's right. So you can actually... In Haskell, you don't have to define the type of most of the variables, maybe even all of the variables. I think there's actually some very specific cases, which you'll almost never run into in practice, where you have to specify the type.

0:47:49.640 --> 0:47:58.420
<v A>But in general, you don't have to specify the type for anything because Haskell can evaluate the code and figure out what type it should be.

0:47:58.420 --> 0:48:02.100
<v B>And that's a good transition into one of the strengths of Haskell, which is this type system.

0:48:03.940 --> 0:48:54.458
<v A>Yeah, I mean, most of these... If you think about Lisp or Prolog or other functional languages, they're all weakly typed. And in general, weakly typed languages like Lisp and Python, it's just very hard to scale those, right? Because what will happen is you'll end up with compile time errors that you won't catch until runtime. And whenever you have that situation, you're inherently less productive, right? Because you have to actually deploy something or run some kind of very in-depth simulation to find an error that a language with a stronger compiler would tell you immediately. So one of the beauties about Haskell is it's a functional language, but it has the strong type system that will catch a lot of these errors and let you be more productive. Yeah.

0:48:54.960 --> 0:49:20.280
<v B>And so the type system allows static typing so that when you compile your program, the compiler can reason about the type of an object and do type checking for you so you can catch a lot of errors at compile time. You'll hear this fancy term. So there's a lot of research around Haskell. It seems to be kind of like a running joke that Haskell is only used by researchers. I can't.

0:49:21.080 --> 0:49:23.480
<v A>Yeah, like programming language compiler. Yeah.

0:49:24.000 --> 0:51:03.520
<v B>So one of the things you hear this Hindley-Milner type inference, and you can go read about what that is in very, very specifics. But it kind of gives you two things. One is it basically is a way, a method for defining what types a given expression can have, and then an algorithm for computing the type of a given expression. And so these things together are really powerful. And you hear about, like I hear about this a lot, that, you know, oh, the type system in Haskell is really strong and really powerful. And without, you know, really getting into it, it's hard to know what that means. But essentially, it's a way of allowing you to write functions and do function overloading. So like in C++, you would have to do templated programming to kind of handle generic types. So Haskell allows you kind of ways of saying, I have an item A and is an input to this function, and the output is a list of type A's, you know, a set of type, you know, more than one of type A's together. It allows you to do stuff like that and do checking, which is something you can do in other languages. But it just happens to be the specific way that it's implemented. And you're able to define stuff in Haskell that you can do very interesting things. And just in my opinion, that just like in C++, you can get into a lot of problems with templated programming. You can get into some really deep weeds with playing with the type system and doing really complex things in the type system in Haskell. Haskell can be sometimes hard to read for people who aren't familiar with it, or even sometimes are. But the type system especially, so it seems just like a lot of it I look at and just like, I don't even know what this is saying.

0:51:05.054 --> 0:51:05.965
<v B>So it's something to be

0:51:05.965 --> 0:51:51.915
<v A>careful about. Yeah, I looked at, you know, a couple of people on my team at the last place I worked wrote a bunch of Haskell. And sadly, we ended up throwing it away because nobody else knew Haskell. And we ended up having to just rewrite it all, which is actually pretty sad because it kind of hurt their feelings. Anyways. But yeah, I mean, that was one of the big things was that it was just very hard to understand what the program was doing. But I think that, you know, it was also very hard to use Unix. But now everyone's using Unix. Like Windows has a bunch of Unix in it. OSX is built on BSD, right? So, you know, it might be that Haskell is just before its time. Like, isn't that the phrase? Maybe. Yeah. But I think some of it also is

0:51:51.915 --> 0:53:03.480
<v B>People. So this is the same problem. My issue with Pearl is I have no problem with Pearl specifically. Like, you know, I don't have strong feelings either way. But a lot of times people try to do crazy stuff in Pearl to kind of show off. So like, oh, I can do this in one line in Pearl, right? And you get the classic Pearl one-liners. But they're impossible to understand. And like, that's great if you're doing something once, one time, like you're trying to clean up some input text and no one will ever try to do it again. You're just going to store that result somewhere, and everybody else will use the cleaned result. Like, sure. Great. Fine. Show off. But if you're going to be submitting code that's going to be maintained, like, it's better to be a little bit more verbose and write it out. And, you know, some people argue back. So this is a constant debate I was having recently on my team: some people say, 'Oh, no, it's better to do these.' I call them clever things. People a lot of times do it to try to show off, like using things which aren't always commonly used. And it's not always immediately obvious what they're doing because it reduces line of code count. The reason they say is because every line of code is a potential bug. So the less lines of code you write, the less bugs you will have. I guess that I don't know, like maybe.

0:53:04.427 --> 0:53:08.039
<v A>Well, yeah, I think you have to think about bug density, right? Yeah. So

0:53:08.039 --> 0:53:25.707
<v B>That's the problem is like, I can't reason about your code quickly. If you wrote it out more verbosely and I can reason about it quickly, I'm more likely to help you catch errors. I'm more likely to either reject or gloss over if you write some line of code that I'm not exactly sure what it's doing. Yeah.

0:53:25.879 --> 0:53:27.500
<v A>I would like to say that I reject it.

0:53:27.620 --> 0:53:37.459
<v B>But reality is sometimes you're pressed for time and you've got a lot of stuff to go through. And so sometimes you let something slip through. It's like if you had known what they were trying to do, you wouldn't have let it. Like you would have realized it was a problem.

0:53:38.919 --> 0:53:42.194
<v A>Yeah. Yeah. So this is not a conversation on Haskell. This is

0:53:42.194 --> 0:53:44.300
<v B>a little bit of a sidetrack. Yeah.

0:53:45.160 --> 0:53:58.107
<v A>No, but to your point, though, I think functional languages in general require a lot more documentation. Yeah. Because they make the claim like that they're much less verbose than they are. But I

0:54:00.672 --> 0:54:13.760
<v A>think the, you know, whereas in Java, maybe, you know, a comment per file is okay. In Haskell, where, you know, like 100 lines could actually be doing quite a lot. But you should definitely be very verbose in your commenting.

0:54:14.240 --> 0:55:18.819
<v B>So I kind of have, so, and this is always something that's a little hard to pin down. But people try to explain concepts and sometimes try to show off by how like detailed or complicated the process is. But I actually think that's kind of like, I don't personally care for that style. I prefer that if you could explain it to me shortly and in a way that my grandma could understand it. Right? Like then you've done a better job than a person who can use more buzzwords. And so, and I think sometimes that, you know, as an industry, yeah, there might be uses for Haskell. But sometimes you get people who are just fanatic about it. And they like the fact that it's very exclusive and that, you know, they can go through kind of the pain of doing it. But that's not always the case. Sometimes it is really a good tool for the job. And like I said, one of the benefits I've gotten from learning functional, trying to learn functional programming more and more, once I have learned it, is a new way of thinking about things. And sometimes like we were talking about, you know, the way of doing different state machines. Sometimes you don't implement it in a functional programming language where you take some concept with you. That's really helpful.

0:55:19.000 --> 0:55:41.540
<v A>Exactly. So. Yeah, I mean, you can get a lot of functional ideas into other languages. Like with Java, you could have classes where the class implements some interface. The interface only has one function in it. And now you basically have function pointers in Java. So one thing to take away is that every language you learn sort of helps you holistically become a better programmer.

0:55:42.180 --> 0:55:43.180
<v B>Yep. Yep, yep, yep.

0:55:44.560 --> 0:55:49.640
<v A>Cool. So can you explain what a Monad is? Otherwise, you aren't a true Haskell. No, I'm not a true Haskell.

0:55:49.700 --> 0:57:33.720
<v B>I failed that test. So I think it's hard to explain what monads are because it's a complicated concept. But I will try one way that I've begun to think about it. And I'm by no means—no, I won't even say I'm—I'm not even a Monad beginner. So there's probably people who could give us a better explanation. If you have a great explanation that you can send us—that short, send it to us and we'll read it on air and give you credit. And if my grandma, if I can read to my grandma and she understands it, you'll probably win some sort of Nobel Prize. I'm not sure in what, but so if you think about a function, right? Like a function is some way of doing computation, a notion, a notation for how to define like this thing is going to take some input, produce some output. And here's what it will do. In Haskell, you can't have any side effects in your traditional functions. So if you think about a function being very strict in scope and you think about something that's more general than a function that can have notation that says other things besides I have an input, some code you're going to execute, and an output. But—and here's maybe the types—but like you want to be able to have kind of almost other tags or syntactic sugar or things that you want to be able to say more about a function than just those things. Like you may want to say this thing does input or output. This has, this could raise an exception that it sometimes doesn't produce any result at all. If you want to say things at a higher level than just take some input, do some computation, produce some output—and then reason at a higher level about what the function is going to do. That's kind of what Monads are able to do for you.

0:57:35.160 --> 0:57:35.560
<v A>Okay.

0:57:35.900 --> 0:58:00.140
<v B>This probably—I think that's how I'm currently understanding it. So the classic one in Haskell is for input and output. If you want to write to the screen, you can't do that in a normal, in a normal function. So you have a Monad, which allows you to say, 'Hey, I have some code that's going to run. If I'm also going to do other stuff, like I'm going to have input and output. I'm going to write to the screen. I might pause things like that.'

0:58:01.800 --> 0:58:11.960
<v B>And so that informs the compiler, you know, that like, 'Hey, something different than the rest of the program is going to happen here.' And things that interact with it, it knows how to kind of think about those.

0:58:15.040 --> 0:58:20.412
<v A>Oh, I see what you're saying. So it's a—it's a—it's a way. Yeah. I still got to wrap my head around it. And

0:58:20.412 --> 0:58:41.607
<v B>I haven't fully either. And I think there are many things that can be used for. But you know, it's kind of a way of calling out that here is something that is going to have a side effect without just making the whole program basically say might have side effects. So you're saying here's things which can produce side effects, but the other things don't. Right? Like,

0:58:43.260 --> 0:58:46.820
<v B>So gotcha. Anyways, that's probably a poor explanation, but I tried.

0:58:47.380 --> 0:58:57.030
<v A>Okay. No, I—I think it makes sense. I mean, it's one of these things where I think I have to like have it explained to me many times. And then each time I'll pick up a little

0:58:57.030 --> 0:59:03.882
<v B>Facet of the—yeah, I'm in the same boat and I'm still beginning my journey of understanding it. So lazy evaluation. So,

0:59:04.692 --> 0:59:57.139
<v A>Yeah, another thing Haskell has is lazy evaluation. And so, again, just think about, say, the Excel example, right? Let's say there's some cells that are way off the table. Like, like your screen is like you're looking at cells A to G and rows one to 10 or one to 30 on your screen. But if you were to scroll way down to, you know, row 15 million, there would be some data there. Right? But obviously, you know, if you tell Excel like add columns A and B, it's not going to add the infinite number of rows of A and B together. Right? Like it's going to probably just add what you have on your screen and maybe like some of the border. And as you scroll around, Excel will start filling in cells that it didn't know before. Right? Like it still knows how to compute them, but it's not going to compute them because you're not looking at them. Yep. Right.

0:59:57.200 --> 1:00:06.880
<v B>And it knows how it may have to compute some of them because you may have a cell on your screen that references some of them. And so it'll go compute those. But the ones that you don't care about, have no reference to right now, it won't do.

1:00:08.420 --> 1:00:43.560
<v A>Exactly. There's got to be some way to really screw with Excel. Excel, like, I'm sure people have done this, like crazy Excel hacks where it just locks your computer. Like you open a spreadsheet and your whole computer locks up or something. Anyway, so this is lazy evaluation. Haskell does this as well. So if, you know, they might define, you know, a function or a set of functions over a space, but they're not going to instantiate every possible one of them. So they're going to our runtime start realizing the values of the outputs of functions as you need.

1:00:43.560 --> 1:00:49.780
<v B>Which leads you to weird things like infinite lists, which, okay. And Church encodings, which I tried to understand and I still don't understand.

1:00:51.100 --> 1:00:53.080
<v A>I've never heard of that. Okay. All right.

1:00:53.100 --> 1:01:38.420
<v B>This is the story of my Haskell life, like researching one thing after another. But like I said, you learn. So we have some resources for getting started real quick: Learn You a Haskell for Great Good. This is a very interesting approach to a programming language book. And it's, you can either buy the Dead Tree version or read it online. And it's pretty good. I didn't make it all the way through. I kind of, it's one of those things like Haskell's complexity curve is very exponential. So you read early and it's like, oh, it's too slow, too slow, too slow. So you just kind of start skipping and you're like, oh, wow, I have no idea what's going on. But it's definitely not like linear. So there's also Learn Haskell Fast and Hard, which has an interactive component to it, which I was playing with earlier today in preparation. So I think I'm going to have to check that out a little more, too.

1:01:39.760 --> 1:01:40.800
<v A>Oh, cool. Very cool.

1:01:42.500 --> 1:02:06.385
<v A>Yeah, this is awesome. So definitely check it out, Haskell. It's getting a lot of popularity and it's very forward thinking. It's right now like programming language geeks like it. But, you know, as you said, Unix geeks were the only people who liked Unix and now everyone's running it in some form or another. So, yeah, it was great doing the show on Haskell. It's been long overdue. And we look forward to doing some Swift next time. All

1:02:06.385 --> 1:02:07.180
<v B>right. Until next time.

1:02:08.419 --> 1:02:31.920
<v A>All right. See you later. The intro music is Axo by Binar Pilot. 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 share alike in kind.

