Hey everybody, what's going on? I am Greg Sussman joined today by Jim Sonnis of FanDuel as he helps me break down the tour championship. What's happening, Jim? Been a pretty fun season, Greg. So I'm excited to wrap things up here at the tour championship. Pretty interesting format. Justin Tom is starting this thing at 10 strokes under par. Patrick Cantley is eight under and that's a lot to juggle, but the salaries do at least partially account for that on FanDuel. So I'm pretty interested to see how things play out here. It should be a fun event to watch as well. It's going to be awesome to see how it all shakes out who winds up winning this one. It's going to be awesome. So let's break it down. Let's go over your top start in DFS this weekend at the tour championship. Who you got? Yeah, I think you have to give a long consideration to Justin Thomas because again, he is 10 under par to start this thing off. But his salary accounts for that at $14,200. And for $2,100 less, you can get Brooks Kepka. And Kepka does start three strokes behind Justin Thomas. But we talk about Brooks Kepka in events where he has motivation and how good he is there. And there's not a lot of motivation better than the $15 million that goes to the golfer who wins this event. So Brooks Kepka, we're probably going to see good Brooks this weekend. He's probably going to get a couple of rounds of practice in before Thursday as well. Kepka ranks fourth in the field in distance over the past 50 rounds per Fantasy National. He's also been good at an approach and that even counts in the events where he maybe hasn't had the best motivation. But even in those events, we still seem Kepka finished 30th and 24th the past two weeks. So you're giving me Brooks Kepka at a bit of a discount at $12,100. I think he is well worth that. His win odds are five to one at FanDuel Sportsbook. He is fully capable of chasing down Justin Thomas. So I'm going to have a lot of Justin Thomas this week too. But when I don't go there, I think that Brooks Kepka is going to be my number one guy for this week. Yeah, absolutely. This is a weekly good Brooks shows up because there's a lot on the line. He could catch Justin Thomas. As you said, it's a big spot for Brooks. So expect a big time outing. I really like getting Brooks in our lineups this week. But if you don't want to go with Brooks and you want to go in another studly direction, which direction could that be? Yeah, there are really three tiers at the top here from a salary perspective. Justin Thomas by himself and then Patrick Cantland Brooks Kepka in that second tier. The third tier is kind of Rory McElroy all by himself at $11,400. He is starting this thing at five strokes under par. So he is five strokes behind Justin Thomas. But I think with McElroy being $11,400, he doesn't necessarily need a win to pay off. Whereas Justin Thomas, Brooks Kepka and Patrick Cantlay more so do because they are quite a bit more expensive than McElroy. But McElroy been golfing really well since that implosion at the opening. He has finished fourth, sixth and 19th in those three events since then. And he knows Eastlake pretty well because he did win here back in 2016 and also finished seventh last year. McElroy is good off the tee. He can go long, which I do want for this weekend. He is an awesome approach player. So $11,400 I think is a very fair salary for McElroy even once you account for the five strokes he is behind Justin Thomas. He could make that up for sure. But I think that McElroy is cheap enough where he can pay off even without winning this event. So McElroy at 11,4 is a really good second stud to plug in after you get Justin Thomas, Patrick Cantlay or Brooks Kepka. Absolutely all those guys inside that top tier, they are worth starting this week. Rory McElroy in the mix here as well. If you're not going with Brooks, Rory makes a ton of sense. Let's move down to the mid tier here Jim and we'll get to Tony Finau. He's still pushing along here, man. Yeah, he's been pushing along a lot better recently because we've been to some courses that are a bit longer, which played better to his strengths. Last week was a course where I was emphasizing distance and Finau popped there. Finished fourth and he finished fourth despite losing 3.9 strokes putting, which is kind of just insane to me. He has gained 10 strokes T to green, more than 10 strokes, actually more than 11 and a half strokes into his past four events. And this is a course that should suit Finau pretty well. And it has suited him well in the past. He was seventh here in 2017. He was 15th last year, which is not great in a 30 person event, but it's also not terrible and shows that his distance can play well at this type of course. I'm not expecting Finau to put well this weekend because he generally does not do well on the surface, but his salary is $9,500 and he is going to put himself in the position to get some birdies. So if Finau can just sink a couple of putts, he could pay off really well. I think that Finau at $9,500 makes a lot of sense. He'll start this thing at three under that is the same place as Dustin Johnson, who is 10-1. I also like him quite a bit. Also a Deki Matsuyama is at three under. Finau is cheaper than both those guys at 95. I think he has the ability to go low. So Tony Finau at another course where distance does matter at least a little bit. I think I'm going to go right back to him once again this weekend. Finau has been finally playing better. And I feel like Jim, you were the one that kind of saw this coming, man. Yeah, I try to, I use Tony Finau more than I should. So I think that I can always have that excuse of, oh, I saw that coming. And then I'll just ignore the events where I use when he does poorly. So I will take that, Greg. And we will ignore the times where I said I use Tony Finau and it hasn't gone so well. You're always the positive one when it comes to anybody. And Tony Finau, no exception, playing better as of late, making you look good, making us look good. More importantly, I think us win money. Tony Finau, a solid mid-tier option this week. Staying in that middle tier, we get to Adam Scott, who's 33-1 to win this. Poor Lerler, what's coming up later. But Adam Scott, why do you like him this week? Yeah, Adam Scott's probably safer than Tony Finau and they're both starting in the same spot because they are both minus three. And Scott, among those golfers who are starting at 300, is actually the second cheapest for this week. And I think that that's pretty advantageous because he has the kind of stats that I want for this event at Eastlake. He ranks 13th in the field in driving distance the past 50 rounds, according to Fantasy National. He is also fifth in approach and seventh in scrambling. Those are all really good numbers, even when we account for how small the field is. And Scott also enters with really good current form because he has finished fifth and ninth the past two weeks. So the good form is there. And you can look at Adam Scott recently at Eastlake and he hasn't been here the past two years. Maybe that could be a concern for you. But once you dig back deeper, you see he was here in 2016. He was here a bunch before that, including a win back in 2006. Now, I don't care about that win in 2006. That's so long ago, it does not matter. But knowing that he has been here a lot of times and has been here decently recently, does say that he should fit this course really well. He knows this course. He has won here before. All those things are positive factors for Scott at $9,300. I think that he is a safer play than Fina. Fina may have higher upside. But Scott at 93 has the ability to climb the leaderboard and at $300 and $9,300, I like that quite a bit. So Adam Scott is someone I do think I'll have quite a bit of as well this weekend. If you want safety, Adam Scott will get you there. Tony Fina is upside, as you said, probably higher. But in that middle tier, doesn't get much safer than Adam Scott as long as he has that putter working. Let's move on to the value tier here, Jim. And it's a big time tournament. So I was hoping for some of our favorites and you didn't let me down as Gary Woodland returned to the value spot. Yeah, Jason Cochrax minimum salary, Greg. I'll just throw that one out there for you. Corey Connors of 7-4. So some of the Heechak favorites are in here as well. We could talk about them for sure. But Gary Woodland, I was into him last week. I believe we talked about him here and didn't go so hot he finished 31st. And Gary Woodland has not had a top 30 finish since he won the US Open, but there are only 30 golfers in the field. So I'm pretty sure he'll get a top 30 this weekend. If he doesn't, well, some pretty serious issues. But this weekend we should see things turn around for Woodland. And once again in that event last week, he was still decent on his approach. He has actually gained strokes and approach four times in his five events since that win at the US Open. And he also has the distance that I want for this week. He ranks eight in the field in distance. He is 11th in approach over the past 50 rounds per fantasy national. So I think that Woodland makes a lot of sense. I mentioned that Adam Scott was the second cheapest guy who was starting at 300 par. Woodland is the cheapest at $8,800. He's got all the stats that I want. I think that we'll finally get things turned around here for Woodland. It looked a little bit better last week. So I think it makes sense to buy Woodland $8,800 and see if he can finally get back into that form that won in the US Open. I feel like we kind of say this every week with Gary Woodland that, hey, maybe he'll return to form this week. He doesn't make any more cuts, but hey, maybe this is the week. Top 30 players in the world are at this tournament. So he can't finish worse than 30, as you said, Jim. So hopefully Gary Woodland gets the job done here at the Tour Championship. One last player to get to who's also in the value tier, not always in the value tier. More of a mid-tier type of player. It's Paul Casey. You want to talk about solid, as you mentioned with Adam Scott and a high-floor player. That's Paul Casey. Yeah, the reason Paul Casey is $8,300 is because he's starting this event at just two under par and that means that he has eight strokes behind Justin Thomas. But for Paul Casey to pay off, you do not need a win. So comparing him to Paul, to Justin Thomas is not really analogous, I wouldn't think. I think that he's only four shots behind Patrick Reed. And Patrick Reed is starting this event in fourth spot. So yeah, there are a lot of golfers between there, but Paul Casey's positioning is not as bad as his salary would indicate. And he is a great approach player, which is exactly what I want at Eastlake because Paul Casey ranks fourth in this studly field in approach over the past 50 rounds, according to Fantasy National. And last week we did see him gain 1.7 strokes off the tee and that was another course where I want to emphasize distance. Casey still did well there and that bodes well for me this weekend because Casey's not always someone who does super well at the distance courses, but seeing him be okay there last week was pretty encouraging for me. He is eight strokes back, he is only 200 par, but we know that Casey can do well at no cut events. He was awesome at the WGC of Mexico this year. So for $8,300, Paul Casey can make a lot of things work. I think that he is better than the salary indicates even when you account for his positioning. I think that he is the upside to climb that leaderboard as well. So Paul Casey, $8,300, one of the guys I'll be building around most often for this weekend. Absolutely, at this price, you should be building around Paul Casey. You heard from Jim exactly what he can do and we can expect from Casey. And you know, no matter what, the floor, it's just high enough that he's not gonna let you down. A solid value player here this week at the Tour Championship. We're gonna take a break when we come back. DavisMatic of dailyrotor.com joins us to go over his favorite bets for the Tour Championship. Spoiler alert again. A lot of the names are the same. It's a good week for Jim Saunders and DavisMatic, which means it's a good week for you. Stick around, more on the way, right after this. Back here with you on the Fandal Hurry with Greg Sussman. Now joined by DavisMatic of dailyrotor.com. Davis, what's happening? You know, very excited to cap off the Tour Championship. I hope my boy Rory is able to end the tour season in the right way. Absolutely, we'll see if he does get the job done. Let's start off with big game Brooks, though. He is one of the favorites in this tournament. Five to one and Brooks Kepka, we talked about him earlier in DFS. Why do you like him to win the Tour Championship? So basically you kind of have to make a decision if you're betting this event. Am I going to bet Justin Thomas? And if you're gonna bet Justin Thomas, you should not be betting anyone else. That should really be your only investment. But I'm not betting on Justin Thomas and Brooks is one of the guys who starts close enough to Justin Thomas in terms of these strokes at the beginning of the tournament that I think he's got a decent chance to win. And of course, he's top 10 on Tour and all of the important strokes gain stuff. And with him being so close to JT and this being the last event of the year and everything, we think that Brooks is going to bring the A game. And he's going to bring this week to Eastlake. As we said before, hopefully it's the good Brooks that shows up. There's a lot of the lines we expect he will, which means that five to one Brooks Kepka is worth betting on. Speaking of good versions of players, we need the good version of Rory McElroy here this week, David, it's like enough of this crap. You're preaching to the choir, Greg. You really are. So the last couple of weeks, Rory has played okay. He hasn't played great. And he's starting five strokes back from Justin Thomas and he's at nine to one at the FanDuel Sportsbook. And if you ask yourself over five rounds, how often is Rory going to beat JT by five strokes? It certainly would not be a regular or a common occurrence, but I certainly could see it happening. And just if Justin Thomas has a bad opening round, these odds are going to shift so much that getting Rory at nine to one, beating half the field already in a short field. I do really like this wager. Yeah, the wager makes sense just from the position that he is in. He's already beating half the field, like you said. I think he's making a couple of strokes on Brooks, on Justin Thomas, Rory's in a good spot. McElroy, nine to one, a lot to like here. One of the most consistent players on the tour this year, Xander Shafley, is a few strokes behind, but given how good he has been, especially in big tournaments, you have to like him at 29 to one. Yeah, so this is definitely, you know, he's one of the guys who, I can't forget if he has five or six strokes back, but he's definitely one of the guys who you'd look back at the pack and you'd say, okay, this guy, you know, won the tournament of champions second at the Masters. You know, great results at all of the major championships this year, except for the open championship, good and WGC's. You just say, his game is probably good enough that, you know, if he has a hot Thursday, his odds are gonna improve on the live betting. So, you know, if you're making bets pre-tournament, Xander would be one of the key guys for me to wager on. Absolutely, Xander's been one of the key guys you've been wagering on all season long. So why stop now? All right, let's continue. And let's move on to Adam Scott. We talked about him earlier with James Sanis when it came to DFS, but Adam Scott, one of the most solid players on the tour. Why do you like him here this week? So Adam Scott is in that same range with John Rom, Xander, and those, you know, those category of golfers, and he's there down there at 33 to one. And I'm looking at this golf course and I'm seeing, you know, lower than average expected winning scores, I think minus nine, was the winning score at this golf course last year. So, you know, a little bit less of a pitch and putt fest. And I think that that probably suits Scott's game better than it does a lot of the other guys who are going to be playing the tour championship this week, you know, and the bottom half of the field. We're not really looking at those guys too much. So if we're looking at guys who can just get hot, you know, Scott loves to make those long putts. I think there's a pretty good chance that he could kind of catch fire and get near the top of the leaderboard this week. Yeah, absolutely. Adam Scott, if that putter is working, he's in a good spot. And I said it before with Jim, they'll say it again. He's in a good spot to do some damage if he could just get the putter working, Adam Scott, as solid as they come. You want a long shot, we got two for you. We'll start with Bryson DeChambeau.  She doesn't win all that much. Yeah, so I mean, you know, if we're gonna be sweating this out with this weird format that the FedEx Cup and the PGA Tour device for these playoffs, I wanted to look at a couple guys who are way back.  So, you know, what do we really know about how hard these golf courses are? Do we really think that someone can't shoot a 60 at Eastlake? Like, why is that more impossible than shooting a 61 at Medina? And Bryson has the kind of game, you know, we saw it in the FedEx Cup playoffs last year. He's good in strong fields. He's good in small fields. And whenever Bryson has the putter going, because that's really the one thing that's inconsistent about his game, because he's hitting it to the same kinds of ranges all the time, Bryson would, to me, be just as likely to shoot a 60 as Justin Thomas or Dustin Johnson would at this tournament. Bryson DeChambeau has the ability to get a really low score. You heard it from Davis. Why not, Bryson? Why not take the shot at such a large number? We know he's a lot back. But Bryson, well, when he's on, he's as good as anybody in the tournament. A lot's alike with Bryson DeChambeau. One last long shot. It's Abraham Anser, one of your guys who's been in a long shot before. He's in this field of 30 players. Why not Abe? So Abraham Anser just got hot at exactly the right time. Basically, he kind of just played middle and golf all year and crushed the two FedEx Cup playoff events. And so now he's sitting here and he's five strokes back of the lead. And when he's priced half as deep as the guys he's right around, him and Adam Scott are the same amount of strokes behind, but Abraham Anser is 80 to one. And if you're kind of just throwing your hands up at this weird format and just saying, I don't really know who's gonna win, but I would say of all the guys who are kind of in a range where it wouldn't be totally preposterous for them to win, Abraham Anser has the best number. Yeah, why not? He's hot at the right time. That's kind of what it takes. Golf is a mental game. It's a streaky game. If Abraham Anser is as hot as any of these players why can't he get the job done this week at the tour championship? That's gonna do it for us here on The Fan. Do a hurry up. I wanna thank my guests. Will be Jim Sonnis and Davis Maddox. Tomorrow we return to football. Davis, is you and me again tomorrow? Now I'm telling you. Let's do it. Can't wait, man. It's been great. Awesome, we look forward to it. Of course, football all week long. And Davis, this is actually our last golf show of the season. How you feeling? You know, the year would have been a lot better if Xander and Cantley could have turned some of those seconds into first. Things would have been a lot different for me. Hey, there's always next year, man. There's always next year. He's Davis Maddox. I'm Greg Sussman. Thanks so much for watching The Fan. Do a hurry up. We'll see you back here tomorrow for another edition.


Hi everyone, this is not actually a Elm like come and go with me talk because I've had back experiences with copy and paste workshop and then a lot of time is wasted or troubleshooting like editor or environment problem. So this will be more top and more programming so participate with my desktop. The topic is the red pill right. What's right. This, I call it the red pill because after I'm being introduced to it for maybe the past three years. I don't think I can look at other languages the same way. So, so this is this is a fair warning. Quotes from people who have worked with me in the past three years. My whole life is a lie so that the one is a more dramatic about me so that you know where I came from. Right. This is not like, yeah. So I saw this what you do in school and then pearls is more powerful see but simpler and Java everybody do Java. So, and then, after a while you learn about Ruby and the new OOP message passing is all Java is not Java OOP is not all that there is. And then I did that for like 10 years. So JavaScript Rails doing MVP and big website for the past maybe for a plus that's where I did go. And then I learned about Elm. So this is this is the cocktail of environment that mode the bigger cocktails that I'm working with other things like PHP visual basic included as well. So you can see type languages, object oriented languages, functional languages. So dynamically type language that I was happily working in with many years. So this is, this is what we may be using every user you're greeting and then you pull up name, and then you make an application from it, like simple code. But we will call it dynamic language. It's like a very positive way of saying things, but actually what what I feel is is that there is a type, but the type is expressed as a function body code. You have there's no summary of it. It's not saying that user is a dictionary a hash map with a name key. There's no summary of the type, but you have to read and interpret the function body to know actually, what is this function working with this example on on the screen is very short. But you can imagine a longer piece of code and you will have to read everything follow all the code to know what this function is working with. So I prefer to call it a hidden static type that doesn't change the code does require some some prerequisite, but it's just not stated. So, so let's say I'm using the greeting greeting function right and then this is, can anyone spot the problem with this code. Quick survey. Actually, this is a very common pull request review, you know, or another one that comes along a little bit like that right so please use single code, but still there's that everything is good right so review is happy you're happy. And then, right, you can expect trace. When and this like maybe when you're already running it on production already. So this is I feel this is where dark type. Got his name. Right. So, but actually what happens because it actually, it doesn't look like something is wrong right. It's actually correct. But whenever we talk about dynamic typing static typing then it always feels like a mistake. Who will make this kind of mistake right because of course you are using a user and a name and then you use a user and a name. But what we forget that that the simple the straightforward thing is programming. But software engineering when you add time, you know, the code is old, you've forgotten about it, and your other programmers, you don't know what they are doing. Then you have a lot of things to consider. So given this factory. No, no shortcut. So we, we can get pretty good at this we will and I've done this for a long time right so we go and look at the factory. Look at it because there's no other summary you just follow the code in reverse to trace and find where the problem is. This is good we get good at it. I'm sure people do this every day. But it would also be better. If I just know about it earlier. Imagine the feedback cycle that would have saved me. This is immense. And if I know of this small problem earlier, then I can just fix it if I if I didn't know who knows how many more I'm embedding before I reply. This will be an old argument. So tell me earlier tell me where so instead of telling me where the bomb exploded, like, okay, this is undefined. But yeah, but you can also tell me that a, you are saying you're passing name box to greeting, but greeting needs something and a first name. It gives us a clue already like, I think greetings was changed somehow to look at first name instead of name. And to string. So, so this immediately I know where to fix. Okay, when I'm when I'm using greeting or just first name, no problem. We think I'd be written by somebody else right. But a tricky thing that I must write types now to boring. That's the reason why I do dynamic type language right. So, not really. So let me introduce you to some old thing for type inference, which apparently happened, like really long ago, I think 58 to 83. And they within this time they saw that they have an algorithm that can look at code and determine what types they are. So even earlier by the tree, what the fellow did was that able to infer polymorphic types that in this case, this will be a string in that case that will be integer. So, and then the, I don't know why it was not picked up more, but this is the lay of the land. So what do you get from it. Look ma no types. Let's break it down this dynamic ish looking code greeting is a function user is the argument, and you give it a string hello from cabinet with string to lower user first name. So what the type inference did in this case was that it knows that string to lower needs to go with a string. So user that first name must be a string, which means user must be a type of something that has a first name attribute. That's that's how it gives you this. This thing. That's why you see that at the bottom last row you see a pipe with something with a first name string. So when you use it, greeting name box, something goes wrong. It doesn't tell you that inside greeting, something went wrong, it tells you that you are using it wrong. Right. So let's have another exercise. If that same error in your dynamic code gives you this. Okay, so what again what change this time. So you don't know, you go and take a look. Right. So can anyone tell me or you try just practice this right. Tell me what's the type expected by this greeting function. Right. It's pretty hard. I've given you like maybe 10 seconds already find 0.76 seconds. I can tell you that the user needs to be first name maybe three maybe three means that it could be nothing. The first name is optional. The language is a language. No, the capital letter. Yeah, it's actually type to a specific was you look at this code. The language is en or yes only. Right. And then you know that the last name is a string not optional and validation is also a string optional. So, look at these two pieces of code. I don't think it is too much a difference that's not. That's not much of a boilerplate that you need to do on one side and all the other, but they are same same or different right because on one end, I get the runtime era, and then it tells me where era happened. And I know the moment I use it, when I save my file on the editor, and it tells me where I made the mistake. So this is at 2015. Compilers as assistant, which is quite good. I think by just making the error messages friendlier, you're able to achieve that. And this is also quote from Rakuten after two years off. They call it compiler driven development you change part of the code and let the compiler error guide you through the rest of the past. Okay, so I'm going to show you a little bit here. The alley can go to the alley. Maybe I can. Maybe not. So what happens here is not this one. Actually, if you guys if your environment is not noisy, you'll be nice if you can turn on your mic. Otherwise, when I feel that it is this silence is really weird to me. Okay. Yeah. Thank you. Okay. Okay, this is not that this is my online. So some, some code that says you have something like name picture. And mean emails. Ignore the idea of the HTML if you're not familiar with it, but we can reflect that later. The idea is that yeah, you have some data, and then you're trying to render it right. And let's recommend for me actually, what I deal with applications that I do with application that deals with a web code. And it's very common that the provider tells you hey this is a sample what hope that you may receive, but doesn't really tell you what is optional what what could be what could be no what could be even a new field. So let's say you receive something like that. Well, maybe. Yeah, so this one is empty string. And we want to deal with the new data that we want to like okay since the data is like that, we do want to, we do want to deal with it. So what happens is that we will just copy this on the problem here is that this this user doesn't have email right and then you probably come in as a as a now. So we want to say that actually now the data is like that, but the app will now guide me okay the new the new reality is that not all users have email and deal with it. So we'll follow the compiler. Okay, so since this is nothing, the opposite of nothing is just something so this is a valid string. And then this is now maybe string. So we have our, we have our types done, but the rest of the code, the code that we are using our data is not updated. It could be your own code that you remember where to change, or it could be somebody else's code. So in this case, what happens is that right you're the are you already pointed out the bottom area. So this is that somewhere. Okay. The point out that actually is this template. But just now the screen that we were looking at was just listing the user. It was very obvious to us that when the data changes, maybe the rendering of it on that page, we have to change the code. This is like off the left. It is somewhere else that I have forgotten about. Oh, yeah, I didn't know that there was such a thing in our code base. So you also have to change this. So you in order to one way of doing it will be that okay you have a statement and then say that okay if email is not nail the variable is right here. And then you can you can do that. You can continue to do what we were doing last time, but if email is actually nothing, then actually I can't really if you an email. So maybe a blank string for now. Okay, then now you have to continue fixing the other places and say that over here you have your email also. So if this is, if this is admin, then I will do something like that. It's fine. So case user email or just string or nothing. If it was nothing, then maybe I will say anything. But otherwise, we will move the whole chunk into the block is ugly now, but we can reflect later. And then so there's more stuff that is here. This one is text nothing. And then if you have email that I'll show other. Okay, we can also do it here. So case user email. It is just a string. We will continue to do what we do. It is nothing. Then. They render nothing. This is now as because that this as is here. So I'm not sure about you, but as I'm doing this change, I actually didn't. I can, I can, I can pretend that I didn't know this code, but you don't have to know the code too well. And you just change based on what the compiler is telling you to achieve this. So as data changes, we usually just change the type and go with it. That's how we do it. So, while we were showing you the maybe and the nothing. So I'll just point out to you that things like nothing. And maybe, but these are not just like, sorry. So these are not special syntax of special things that the programming language gives you that you cannot, you cannot do. You can actually do your own thing like a user could be anonymous or registered with with a name with a string. And then from this point onward, you can say that, okay, registered. And you, and you do, you do have a value here already, or you can even say like, okay, let's say I have some, some user, which could be here. The difference is that I can't just, I can't just some user name it, or like, there's no way I can do anything with this value. Until I break it up with this. And then you do a pattern match and then you put a variable here, this can be anything. What happens is that this full bar is now a string, and you can say, I got. Another one is that the variance that it is like an item, but with information, the variance that you define, you will have to be completely exhaustive checking did you say everything. So we can say anonymous. So this is how you use the string and then now you can use the typical string, typical string functions to do anything you want, even though you are working with a type like that. This exhaustive check is super useful when business. When I guess you're at changes pivot, and then you have things like admin and give me a list of user, or even I feel registered. This string is very descriptive. I don't know why this I need it to be a name and email. And feel free to focus on this to get your domain correct. And then over here, the compiler will just type check everything tell you, like, hey, you know, so over here are now I have to like name it goes to Bob email it goes to Bob example. And now these cases are wrong because I cannot just string to lower the whole thing. I can only string to lower the name, for example. And now this is like a you're not doing that mean fine. So admin admin of other users. Then I guess I'll have to like, let me. This is the render user. And it is a render user, some user. Okay. And then over here will be render user. And now this one, I can say, let's map render user is a mapping over all the users are the users. And then I will join them together with a comma. And this is just now that I was just, I like to call refactoring in elm moving code because the most of the code is really just shifting around. This, this will be a characteristic that you just have to say but you have to experience it yourself, but it is it comes from the other red pill trade that I will talk about later, which is the pure part of it. So right now we are on the type type of it. But this kind of type is really different from my experience with Java go, whatever you make you call it right Ruby even we can explore more on what the type is that if anyone has other questions but this is the causes custom type or some some other place to call it. And you can start to define things really clearly, but otherwise, this is what we'll typically do a typical user in other language will look probably something like that you have a name, and then it is a string. And then you have your other users. Also, also something I can't do this one over here, but also also also other users for example. So you have is admin school is registered bull. And you would have a documentation somewhere and your wiki is actually what happens in my previous company right where we have a data type that that has multiple configuration, and then you will see that if is admin is true. It means it means will have other users. Otherwise, otherwise it's the right it's irrelevant right here. And various things that you're trying to talk about the combination of values that in one thing. And then for each function that you see work with it. And then you have your thing. This is my user. And then you'll be like, Oh, if that user is admin something then then there may be user dot other users work with otherwise. And you have to do this kind of decision in various places of the code. And it's just really tedious and error prone. Well, in comparison is the only thing that and somebody can forget to do. I mean, I forget to check this out. I'll just use this instead that that works compiler is happy. But whereas over here. There is no way I can get even the full buy information. We're going to use a detail detail. There's no way I can get the user detail when I want this out of the branch I cannot. I cannot do a right because there's no there's no no such variable. This variable is only inside this case statement. So you cannot, you don't get the chance to even make a mistake there's no other users when you're inside register the user detail when you're inside admin. So you have effectively broken out a force and force that everywhere else needs to handle some stuff. You cannot. Yeah, like I mentioned, you cannot do name. There's nothing you can do with this, except to break it out and then use the variables to that part is very powerful. Right. So this typing, typing and compiler giving an error, typing and compiler giving an error. So this, let's feel to me like tdd actually not not all of tdd so anyway so I've just talked that if you have not seen it you should watch it's pretty good. Other people say it's not just me right so this is good is the way that they understood tdd you know, but the gist of the top to give you a spoiler is that I got into it only when I understood it as a getting things done. Model of thinking, not like, oh, test will make it robust has to do this has to do that. No, no, it's this one we're like, hey, having test that's me get to the next step. And then, at every point in time, where the test fail and I just fix the smaller step and then just move forward, move forward, just super productive actually it sounds slow but actually faster. So tdd is what I have. And then this is why I need, and I make it work. So now then you have like put a goal post and they just fill in the middle right, which is a bit like that, but better. So you have your given you have to expect, and you put in your production code somewhere in the middle. The yellow portion is, I call it test harness, because you need to create this thing to plug in your code. When you have this then your tdd cycle is really good and you, what you know that the good thing is, you know when you are done, but you're done when expectation is met, and your code is good your blue part can use already. But wouldn't it be better, right. If the yellow part is just smaller I don't have to do so many, so many harness test harness. Yeah, so one one thing that I feel writing in a pure type functional language is that it is smaller. I actually write far fewer tests than normal. And I start to realize that actually there are different kinds of tests that I have been writing my whole life. Right. Some are super logic things like if you give me a number. So you're the 100 and I'm supposed to give you the grade, but it's a plus or B or F. So those. Yeah, sure. I do a test for that. But then there are also other test ways really just wiring things together. And this one suffices. In fact, just now the part where I'm showing you the anonymous user. How how when I specify this change, all the code has to add here to it and they cannot even use anything else wrongly. So this kind of test, the need for this kind of windows. I don't have to like make sure that somebody is checking that this person is admin before he uses other attributes. So it just disappears the whole class of errors disappear. The pure logic and things like great becomes a ABC or F is still exist. And people work with type languages. I don't know if people here will see go Java. What are you talking about? What does how can a type change that even replace that kind of path? Like for example, what does this even say? For those not familiar with go, this returns you to things and the idiomatic way of using it is that you get your user and you get your error. You check that there's an error and then you just go back. Otherwise, you are free to use user. Your code convention. But the thing is, what does this type signature tell me this? Did the code just go to the URL that some from Jason and instantiate a user thing for me. Are we connecting to a DB and doing a search by URL and that means the user that I return actually carry a database connection, a dirty flag, things like that. So what if user and error both nail that what do I do with the dramatic code, right? What if both are nailed and the last line when I'm using happily using users on a crash. And what if both are not near what does it mean, right? So these are all the questions that come up that makes type signatures or function signature, not really going to live up to this, this ideal. And this is this is a very standard function that we do as well. Signature the only thing is like, what does it mean? I don't know something is happening. It doesn't even return a value in my show not do it, but of course something is happening. So, I don't know. So this writing this function or this function. Signature doesn't buy me anything at all. That's what I'm talking about. When we talk about function signature as a removing a whole class of test. I'm talking about function signature for pure type functional programming function, you can write it in any language, you receive the argument you return the result. It's more like this reverse is more like string uppercase lowercase those those kinds of function you give it something and it does some memory algorithm if you want a calculation and it just returns you a value. So, it doesn't change anything anywhere else. So given this constraint then that makes the function signature actually mean something because if you don't give it you cannot use it. If you if it doesn't return it, it doesn't change anything else. So, so for to this function says signature for pure type language does give you this more meaningful replacement for some of the expectation and given. So what gives us that you can now use the custom type to narrow the problem surface area, like how I was changing the user and admin and things like registered username. When you when you change that then then your your function is up I'm dealing with this I have to do this. There's no escape. And also, because it, your function only deal with whatever is inside the function body. The code can be your code base can be like hundreds of thousands of lines. It doesn't matter because when you're working on the function body, only the argument and your return value. You don't need to worry about anything else and that's a huge relief. Instead of some other code where like, okay, I'm going to change something here but what what's kind of is the thing that I'm going to ask that somebody else doing something to it. Or, must I do something first before I call this function otherwise something won't work. I don't know a typical scenario even in gold. My previous company send us to a go training and then the, the trainer gave a really good example of, of course in the ghost index in a good context, but like you, you are like you have a user. I say every user. And then you say user send mail. The thing out is that this thing has very little. This thing is like very low info like I do not know what user send mail needs. Does it does it what attributes of it does it use alternatively, he would prefer even go. He would prefer if you say something like mail server subject body. This one is now slightly better because all the dependency of this function is right here. But this one still. This is like halfway there you can you can see the benefit between this and this, this thing is a bit easier to reuse than this. And you, you do not over here I do not know whether I need a secret setup email, that email server. It goes to, you know, this thing needs to be done I wouldn't know, because it's function doesn't say anything. Over here is, you know, you got to give me something here. Being more explicit with the, with the argument does help reduces the concern when you're writing this function body, because you just have to look at this, look at this, look at this.  And over here, then you may be like, um, mail server. It's mail server already set up. You don't know. I can talk about that later. Because this is in M you have a view function. And by looking at the function signature model is your state your entire application you can say current users who are you logged in or locked out. The page of search results you everything you put inside model model is a record. So, looking at this function, I'm missing that when you need to render, I will give you your model. And you are expected to return. HTML message is virtual dog. You're expected to return me a virtual dog, which will be like this tax H1P, all those things. So being in a, a, let's say this is a, let's say this is go or something else. This does not mean anything. You can, you can do anything you want. You can even retrieve data from database and then fill it in. But this being a function signature in a pure language. It means that I actually have no means of doing anything else other than pattern matching carrying a part like just now how I talk about the user. So, carrying apart the, the details of that I've stored inside model, and then making decision and then returning where maybe a P tag or bull tag, or this. That is all I can do. I don't even know whether that is a HTTP fetching going on. I don't even know that it is, it doesn't matter to me whether it's going on is ongoing is there's no such thing or I'm looking for a mouse click. This thing says, I have a model is all the information I'm supposed to represent it in HTML. And this is the top level view function that you have. So we cover the other stuff together. So when I finish this software engineering portion. So we, we talk about types, types being able to, it's one of the red pill that they have come to work with. And when I reach a language that does not have the custom type just now the enum the, the, the algebraic data type, and things become a bit awkward to do. I don't feel safe or even accurate. I'm trying my data. So then now comes the other portion of the repeal to software engineering. We, I feel like I need to be constantly vigilant. That's that's my sense of, I don't know, for the rest of you, if you are maybe senior in a team and then you have to jaguar the other people, but it just feels like a hill and then this ball you're trying to keep it there. It's not, it's not about whether the ball is high or low, but you're just trying to keep it in one place, but it keeps rolling off somewhere else. So these are sentiments that I have for software engineering. And we can have our best intentions, we can have our best will culture, I don't know, and say that yeah don't do this don't do that. And there's also this very mature thing that always come across about people saying that I am more interested in functional techniques. You see, you can do functional programming in JavaScript. You can do functional programming in Python, Scala and anything else. Then functional languages, I should, I should use, I should use all these things and then borrow some of these good things that we learn from them. It sounds very very good actually it's like wow this is like a matured CTO right. Then we forget this is just programming, but when you add time and other people right this quote again, finally from Go team. Then you realize that these are all just soft social contracts. You can say that you should do it this way you do a part you can do it at that first.  You wish people do well but I mean, honestly in your own company. How many people are as good as yourself, or even better. And how many, what's the proportion of them needing a lot of guidance. Right. So these good things are just soft social contracts and the compiler is happy your interpreter is happy your test maybe doesn't catch it. And you feel that this is, I call it life with food gun where I work with, I work in a place that can allow things to happen is very happy to do that. And I just add paradigms. Let's do it functionally let some languages are even saying hey you can now also do static typing. I don't want to also do static typing. I don't want to have the option to have to put down to not do it. Life without food done would feel like this, where you don't offer the ball maybe the earth shake a bit the ball roll left and right but you can more easily reach an equilibrium. But how what you don't need to look too much at it. So what was this nice place to talk about. Right, so the warning or fair warning will be that you will not have freedom. In order to get this, you will not have freedom will be taken away from you. You cannot do this you cannot do that. Right, and that is there's even this runtime portion that's protected cannot see it. So basically, for anyone who has worked with go format, or m format probably not because none of you do and maybe go format, or any format that will appreciate like how go format, automatically format to go code, and then a whole category of full request just disappear. I don't even have to talk about it. I don't have to. This conversation goes somewhere else. And then we can focus on important things, I guess, like, not even having the conversation to say let's pick prettier let's fix energy is not even having this initial conversation is just so liberating. No freedom to do that, spend your energy and creative brainpower on doing other things. Which means you cannot anyhow right where you cannot anyhow then you will get your, your life without food done. And where am I. So, this is how a functional program looks like for this is not really like an Elm tutorial but first of all you need to get how this thing piece together these are things that escaped me when I was writing Elm I feel like I was just copy pasting things and then it worked and and I was very unsatisfied because I didn't know what's going on. So this is the explanation, and now I'm why I can appreciate what it does. So this is a pure functional program. And it will be surprising to you that your whole program, whatever you're writing your whole program actually just received argument. And it returns values. Okay. And who does the work if I'm just returning value and who does the work. Then the runtime does the runtime will be in charge of telling you that there's a mouse moving input has changed. We, our, our HTTP get has gotten the response back. So all these the runtime is you with it, actually sending the HTTP actually rendering the dawn calling other JavaScript is all done by the runtime, you're only receiving the arguments and then deciding returning a value. I'm familiar for most of us if we have done any even a little bit of JavaScript. So this is a scenario that form on submit expects a callback. In this callback function, you are given the event. And you're supposed to return true or false. If you say false, then the form does not commit. If you say true, then the form submit.  It doesn't actually make the form stop or do even anything. You just do return a value. And that's it. And do you even know when the event is coming in because it will call you. So this on form submit is actually the runtime the browser the browser will invoke your callback.  And that's it. So, with the idea of event callback right. So a functional program you can think of it as one big same callback function, hooked up to all events. You mouse moves. I call it. HTTP response come back. I call it event. What. So when I was doing enterprise Java, they have this phrase that they will say, what kind of Mickey mouse app. Can you do with this right on click hello on some a lower or lower lower this same how lower you're using everywhere. How does this scale. Then I asked you, how does your web app scale. This is a server side app. You have you have your routes, you have your callbacks. It's a very short demo, just three lines in your rails app you would have like probably a lot a lot of routes create user user and each of them have the callback right. And then you will like a this is not the same as this right because I have different callbacks for my route. This is how I scale my web application. Don't forget, because we don't write it, we do forget that there's only ever one entry point. Somebody has written some code to receive all the HTTP request that somebody looks at the request, and then looks at what you have defined calls the correct function. So this is still an entry point to deal with all kinds of HTTP. Right, so you can look at this. This is the same callback on the main, the main is the same callback function for all the events. And nobody ever, at least I know a question whether a web app can scale. So in a pure functional program. That's what happens, the events come in, and then you have this function entry point that decide. I think you are mouse move you go over that you are HD response you go over there.  And then in the end I don't care you just return me something and then the runtime will execute it. The structure is like battle test this is fine. You have been we've been doing this all the time actually your 20 rails controller works the same way. That's okay what one big callback I get, I get your concept. Okay. But why pure functions only right.  That's a bit hard. All the options are like string to upper area map least reverse who can be an entire Mickey Mouse function right. This is not an interview what about test. You must do something real. So let's go back to your HTTP handler your callback again. So this one is Hitler's HTTP and you will receive a request.  But you know, the based on the request for your life. Give you for one. And then otherwise I'll read a file and send it back to you. Right. This is what we know is this HTTP handler. And inside this function, we're doing the response right for one we're doing the file read and then we have a callback. If the file read was successful, we will do a response right otherwise fall for. But instead of doing that, we just changed the way we think a little bit and say that instead of actually doing those three response right and found read, we just return a value to indicate. Okay, I want to write a written adjacent that says write for one. Otherwise I'll return this. So these are data structure as you can see these are data just data. And that this is your pure, pure version of this. Okay, okay, let's say you have that and then then what what happened, who actually put us over. So remember that there is this runtime that gets your return value. So this is also sample like an imaginative runtime. Okay, so the runtime has called your home and notice that you only get the request in the argument. The function arguments only request you have no response you even if you want to write you cannot write. So the runtime calls the request and it gets because the value back whatever value you have said maybe you said right for one of you said we saw. And then the runtime will now very mechanically very dumbly very simply look at the data type and thus the word. So this is very, there's a sheer layer, a very thin layer of logic here, but it's actually no no no logic it's all mechanicality. You return this kind of structure, the runtime will do this kind of work. That's it. So, this is how pure program works. It. And inside the runtime that it does it does the actual thing.  And then on the left you will see that message model message is like an event. So what a program is a functional, pure functional software. So when you have to do something, it will give you back the event that happened. And your code will look at something and then return that out something. And it's the runtime will keep the state for you, your funds, your code that you write in Elm remains stateless. If another event comes in to pick off where you left off, as you would want to think the runtime has to give you the model back. Okay, based on just now you were like that. And now there's a mouse click. What do you want to do. And then when you return you will keep the new model and then another event comes in and you say, just now, your state is like that you're, you're now already logged in and then you have a search result and result. Then something happened, what do you want to do. So this cycle goes around and around and around. And in your code, you cannot do many things you cannot do anything. But you can return command that the runtime can understand. And that you will do to fully do it. And then your coaches do for the big one big pure stateless callback function. So, so can this build things. Other people have built this thing I didn't, but the Elm boy is really impressive. He did a whole military in Elm. And then this elm physics where I think the chief was so you can build models and ask it to render it physics restriction, everything. So, these are projects that, well, somewhat able to show you that they can do enough complex things. Yes. I forgot what this hands on is about but this is like the end of the presentation already is maybe just so this is the part where I should this is how one big callback does the whole app right. So, I can move my mouse in those the clock is ticking it knows. And I think what else have I hooked up. You know, so it is the same. This whole program is the callback for all this event. And I think if I do like you will. No, he didn't. Okay, so nice. You went by really fast it fetch some data. And it disappeared again so it also handle click and fetching of the.  So, you see this custom type again. This is the same as just now how I was doing user admin user anonymous. So this is the same language feature that you use to do the routing. Remember that there was this. All the events come in. So this is, you use this language feature to do routing. And like early on over here. We usually have libraries, somebody wrote some code to do this routing. I really like that. I can just rely on a feature to do my case statement, break down the information and now here, over here. I have my x and y of the mouse move. I do not have the time ticking key, so it does it does not cross my concerns are separated. I can put this into a mouse move function. And then it will just be somewhere else right mouse move x y. I shouldn't say it's not file. So, yeah, so you just move it away and then now this is your if you look at it like you turn your eyes in one direction you can see that this is your route and is your handler route handler handler. And it's right here you can have all this information there, which is kind of nice to me. So, so this custom type pure functions that I don't have to deal with. Hard to understand code. Just use me with joint. I give you an example where may or may not be fair, but still, so this is really old code. So it doesn't matter. This is just a taste of like what what I mean, looking at normal code to me now. So when I see something like that. Okay, you get you do this. And I'm getting to the booty I instantiate a Shopify client and I list recurring and I loop. So, for example, I don't know what this Shopify app does because it's it called as no argument that's obviously a return value. And I see this now when I see this I will cringe a little bit because it's kind of presumptive that the claims has a shopping that is a string what if it goes strong so it'll be a runtime error. So I don't feel that my code base is in a good place. And when I get this I will have status is here, something will happen. You will you will actually delete this is executing a delete API call. Right. I think, and then over here you will instantiate some data and activate. So you have to trace down the code and sometimes even for things like that, for things like that for even things like this, you have to, there's no way to ascertain what let's say somebody else. Which is to you is true because you did not write this code and do to fully grow this code. It's not impossible but it will take a while. Alternatively, if I have, if I have expressed it, maybe this is roughly roughly the same code, but even if this is, if this code looks like that but it's not a pure language, I still cannot get away with many a great piece of data. And over here, I know that such data that's actually four kinds and I'm ignoring the cancer one because I cannot. I cannot do that. Not allow me to do that. That's a compiler fail me. So it's very clear over here versus over there where like, I did not feel mentioning this. And I know that I get the client from here. Okay, fine. These are all pure functions right so I know that apparently I need a conflict. And then I got claims shop and claims would have this attribute otherwise you wouldn't compile and you would see the type so these are like very easy on the mind, even if I look at someone else, someone else code. It's going to be okay if this status and you'll be a list of one thing. This is the list of one thing and then I see that I'm activating the recurring charge and then deleting it. Don't ask me why I'm just trying to translate the code. And then when it's canceled, it's empty it has nothing to do. So given a chart, I am doing a bunch of stuff. Okay, and then I just put them together. Okay, so, even a list. Recovering charges, recurring charges. And then I see that this is a task so many as this is actually doing something this this will actually make an API call. This is not pulling an attribute from client. And then when the task succeed, I will accumulate the task. So the, the layout of what this piece of code does is more contained and other than I have to look through this look to know whether. You are accumulating anything or is there any early return, you know, or I didn't know that when when this is happening. So it's just more easy to look at now that the functions are simple. You can get the same sentiment in some part of your own code. Sometimes you will be looking at a function and then that the function is really self contained and you feel really good. What happens in Elm is that all of it is like that. Or that good feeling you feel understanding the very narrow function is the feeling that you get for everything. And so these are some other projects and what the companies are doing.  Writing, I guess. So the three attributes to recap is that the custom type is really powerful way of specifying constraint again, it serves as the router for me and the compiler checks it. And then the, the pure functional things. It makes code much much easier to look at. It is contained in a very small area, every every function that you write. You just have to input and output and nothing else changes nothing you don't need to care about anything, but there's something that should be done before this function is called.  You cannot live without the truly experienced them. About that. So you, you can questions from anyone. Are you going to share the slides somewhere. Yes, I guess so. But yeah, I guess so. Good. Yeah, we will share that later after the talk. Yeah. Just make sure you join the telegram group or share there. Hmm, telegram. Okay. Like, how about what do I just think like a weird in Lee. Ivan, what was your background and what do you feel about life with food gun or no food gun. Michael, I like that Elm goes all the way down to the objects you're working with and can't figure out what is the object you're you working with doesn't have this attribute of that attribute. I think that's, as you say a compiler protects you from making silly mistakes. It's all right. Yeah, it's quite crazy right where like, actually, and to me, I was surprised that it look at his timeline on a bit sad, because it is, I've never I've not implemented this algorithm. I don't know how hard it is probably quite hard. But it's also said that it exists, but it's not done. It could be done.  The speed of how Elm does this infer this one. Come very fast. We think it needs to be this, even though that this should be the first name should be a maybe because the inside the code you will see that there's a case office name just and nothing. So you know that it needs to be a maybe. So this part is really really good. That's why it's called a customized type, I guess. So it's not strongly type. However, it doesn't like have a type of restriction. There's two things going on here. So one is that you, you don't have to say the type, the type inference that this people come up with is able to look at this code. The left and the right, you can see that it's not, it's not like I'm saying I give you greeting user needs to be this is this is you didn't say anything you're just using user dot last name and then the type inference know that the user argument needs to be something name attribute. So the ability to infer that and create a type, even though you did not like it. It's really strong and it's now covers 100% of the language, even in little places, you will be able to tell you that over there you said this one and over here it's not like that. So this, these two code cannot work together. You have to fix it. Otherwise, you won't compile. So this inference at this speed really changes things up. Yeah. Very good points. Yeah. And then the custom type being able to be very unambiguous about. So let's say I have type inference. So what right, but I can still do. Let's say I have type inference, and then I do this this way like, okay, user send mail, and my, my code base is just filled with this. It looks really good. Can I use it somewhere. Maybe in my worker. Can I use it somewhere. Maybe in my worker. Oh, does your worker have db. No, so you don't know.  But if you write it even even the slight improvement on writing things in this way, you know that actually in order for this to even happen right. You know that I need something something something. So, just swapping it around and not doing so hence I'm not really not OP by not doing it this way or hiding the dependency. It already a little bit of stress from my code base then so that's why I got where I got really hungry and say, I said I want this for everything. I want a, a hybrid environment where I can do this but let's not do it because we have to be nice, you know, like don't do this. I want a language that tells me I cannot even do this. So from one point of view, there are two big features one is a function or the other way is like customers types. It made me feel it's more like a breed of OOP, like object oriented program and process oriented programming. It made me feel like that I'm not sure whether my. So, so one, one thing about object oriented programming is you, it's more like how you organize code right. If we look at how we organize code then we choose the object way to do it. And then you get you get things like that. So, what is going on here. I have hidden the need and the dependency from I still need it. It's not that I don't, it's magic. I just say use user send mail and it works. Right. So this is like, like, like how I mentioned hidden static type, you don't see the type in dynamic language, but your function has a type it has a requirement otherwise it wouldn't run. So this is same. So you, you have to dependency, but didn't say it. And then you're like, okay, is this kind of code organization helpful. Why are we organizing it this way that there's also a huge Alice. A few years ago, like, hey, when you're doing your rails code. Don't do it in your model don't do it here and then there's this whole wave of doing service class. And then that's considered good practice. We look at it and like what's the service club service guys is a registration. And then you probably have one function to give you all the argument. And that's it. So I'm doing OOP. I'm writing one function that resist all the arguments and doing something. So this is good practice. So like the, why am I giving myself a food gun of doing, doing other things here that is this service class anymore. Right. So if we scrutinize a little bit that hey we are picking up tools and then not use part of them. Because we have learned that actually not very useful. I mean, let me let me let me do that. Let me do service class, all the way to the 11 right, like, like that, this one. So mine. Now my code is like that. Everything inside is pure function. And if it's not good for me why why do we allow it. It's a good feel like from a different perspective I guess, like how you should see code can be organized and what is consistent like best practice. So it opens like a new point of view like from another perspective. Yeah. I'm very curious in what others think actually like other than the type inference, anything, take your book, Michael, like for example the service class comments. Did it. It's a good thing in real, right, it is right. Yeah, if you look at this and okay I'm using class, I'm supposed to do this. Right. This is good. Honestly, this is good. I'm not questioning this is bad or not. Then what what what what OOP is this. It's not would you agree it's more process oriented programming. Would you agree it's more tender to lie on the side of process or into the programming because apparently it's not object oriented programming right. So, I guess I call it functional because it's not OOP, but I guess you can be other things. But the, but it's true. But remember, it's true. It must be together. So it's not just like procedure or functional, but it must be pure. It must be pure like, like, like, no matter how much I say that this is good. This is better. This is this two ways are better than this one. But this is still a harder to operate you. I'm sure somewhere inside here, you have your mail server that connect. Right. Right. So this one thing about the pure languages is I don't have to be a good boy, you know, because the language makes me like I take away all your toys. You cannot do any of this. And then when I need to test my email sending function, there is no such thing as a mock.  What liberated you don't have to think about that. The same thing go for this. I have to write my functions pure. Okay, I read all these things. And then when it comes to testing, the idea of mocking has never crossed my mind, which is very, very different from my 10 years in real. Okay, should we use the database for active record the data or stuff or something something something. You have something like that doing, doing something a side effect, not non pure. Then you have to deal with this before you can even do a registration call, you must mock, mock, mock, and then you make it happen. And then you tear down tear down tear down. The worst we have done is but it's just not preferable whenever you reach a function that maybe like you want to you need to test string to uppercase. Like nobody nobody is upset to test this function is really easy to test. And guess what, if all your code is easy to test like that. It's really liberating and that you don't know that there's no like slow test. You're building like a application that talks to an external service rank say API call, how would you, how would that be? Would you will write test for that or would you say more like you. Okay, yeah, so you will need to write, because it returns a value. So one thing is that is this one is the one that we are guessing some user. Let's look at this. Okay, when I click when I click I want to I want to text right. So this is just a command. If I don't do anything with the fact nothing happens. So this is just a value, CMD, and I say, let's see him, let's see him these equals this for example. But if I say command none, nothing has happened yet because I have created this value. Remember that diagram where I just return the value and then the runtime will do it. If I didn't use it and then nothing happens. So in order to test this, then I just have to come up with a data structure that I can test with. And then I can know that something you define. Correct. And then you can define it. You can define it in this way. So what people do is one, one, you can, there's two ways of doing it. One is you, you don't do that. Those things that are for side effect that you don't do it. Just don't test. Another one is that they don't, you don't return command.  Yeah, you call it, you call it perform. And then you'll be like, okay, I need to get, get user. I don't know. And then instead of this thing returning, this thing returning a command, you return perform. And over here you have to return your get user data. And then you test this. If this thing comes in, you give me the get user. And you can just now then wrap this data up into a, into a perform to command function. Right. Perform into a command. Then this one, you don't have to test, or rather you don't need to test it. P and then like case P of, oh, during the, when, when is this, then I better do just now whatever I did, which is that HTTB get something, something, something. Right. So it is pure, but it's just that we, we actually don't have the tools to inspect command. What command are you? So we have to use our own data type. Right. But this data type. So you wrap the API around your own data type. Correct. The one that I can now inspect. So when I check, then I can say, I, I expect it to be a get user. You know, to equal. Did it happen? Yeah, it happened. I see. So you, you don't really write this test because the compiler already tells all the assumes that you'll be getting a get returning a perform object. Oh, but there'll be many, right? There'll be many, because once you change this thing to a get user, all of them need to be this. I cannot do a command anymore. Right. Right. So it tells you the different places that you change to get this done. So, so what my function will do is I give you this message. I give you this model. Did you give me that I checked the model change according to what I expect. And is this perform among amongst the many kind of a form that we can do. Right. And then many others. Is it the exact one that I'm looking for? And then this test is, as you can see, is purely calculation. I give you this value. Did you give me this return value? Then you, I did not mark anything now. The, the, the, the boundary where my program is now limited to various places. Everything in my, in my application has been carved out into a very self-contained my value talk to my other value and this value things that is supposed to be like that and then return, return, return, return, return. So I cleaned the test. Right. So in a sense it's, it's like, it's really stateless in a way because they are pure functions, right? It is pure. You really cannot do anything. No joke. Yeah. And the part that I did not get by like, I'll go to Elm. I learned this thing. What's the syntax? What I did not get was this picture. Actually this picture and maybe later on this picture. Like that it comes in and then it goes everywhere. It returns something and it does. And I, I was also wondering why I picked up, I picked up react right for like maybe two, three years. It was like, yeah, actually funny. Why was I hand like routing is a thing. There's a red router version for version five routing is a thing. And state management is a thing. And then what, what's going on in Elm? Why did I not have to work? Think of that. So routing. Routing is nothing more than routing is nothing more than you have a function. You have a route. You first you will detect a type and you say page. Okay. And I said, okay, I have my homepage. And I have my user profile. For example, let's just do. Name string. For example. And what, what you need to do is you write a router function that receives a URL. And gives you a page. Or maybe page if you want, if you don't, you don't say that you better say I'm not found. Otherwise, if you. Now, let's say I just, I just buy a simple function or a, a URL, URL path. And I split it string split the path by all the flashes of, for example. Okay. Now I have, if it is flash. If it's nothing, right? Then you'll be home page. If it is user, I guess, and then some variable. Okay. Then this will be user profile. Name is. Which we have the language has the pattern matching. Right. And then everything else, everything else. So based on this, I have my rock. And I just have to get somewhere. Elm will be able to give me the URL like what's what's my current URL. So with this thing, I'll be like, okay, just now remember my, my, this file doesn't have a view. So remember that I have even here. Given the URL. Given URL is something, something, something to do. And now I just have to do case. What is my current page? Router of my given URL. And now I can do home page, if it's home page, then let me render the home page. User profile of, of who? Who? Then I render that page. If it's not found, I render the other page. So these are now all like home page profile of. Who.name was it? Not found. You won't do it here. You will be calling your own function. So this is your router. And not even because there is a, there is a library, but you don't have to use it. It's because. Oh, wow. Custom type is really powerful. And if you change your card username. Hey, things break. I love it. Yeah. Okay. Do you change the name to username? Yeah. Yeah. So I'll be focusing on this card a lot. It's not something that I really do in my past experience doing like this. Java, Rails, a goal. I don't focus so much as much as I should. I guess on my data type over here. I do. And because I can get so much mileage out of it. And I am not afraid to do it. You know what? This one, I see, you know, there'll be like other parts. And I may be, this is maybe, maybe not. Maybe it's a, maybe string. Maybe string, then this will be a list of user profiles, for example. Right. Let's say whatever. Then I'll just, I'll be happy to change this so that this is correct. This is like, yeah. Hell yeah. I feel that this is correctly defining what my application is trying to do. And then I don't worry. I'll just fix the errors. Just one by one. My test fail. But now is that I don't have the right test because the type inference is all catching for me. Right. It's catching all the different. Fielding areas. Yeah. And it's not sort of domain. It's not sort of domain first models and then everything else expands from there. Exactly. And then you, the investment you put into talking about this domain. Pays off in your code by holding them to a contract. That's pretty cool. Any other questions? Have you any? No question. Just clean super west. All right then. I think it's really a mind opening. Oh yeah. You have been born on the second flight. Yeah. Yeah. I found the good. Any questions? No other questions. Okay. So if there's still questions and ask me on Twitter. I'm. I'm true. Yeah. He's in teleport. Our telegram group as well. So if you've got any follow up questions. Yeah. More than welcome to throw any. Yeah.  Well, I prefer questions now. If you have any. I want to have. I want to ask you something. Yeah. Yeah. Yeah. No, but how imagine that you are working in a company, right? With with your teammates and whatever. And you try to explain all of these advantages. And you are struggling a bit, right? And eventually you convince them. And at some point you need to go to.  And you need to convince him that you want to go that drought. Right. And we know that that drought is not. What is trendy now. So yeah, which kind of arguments you can give to a non-technical person. Good to sell. This red pill. That, that discussion has. It's multifaceted. Right. Yeah. For one, one. Passed out of it. I don't even know where my slide. Passed out of it is to me is this one. They, first of all, first of all, I would want them to acknowledge that this is what they are trying to do. And that this is what they have to do to keep the ball somewhere. And if I don't have food gun. I'm not doing that. It's less. So maybe like trigger the cost mindset. Like, ah, you know, these are things that I do. And then I keep everybody in line. It's kind of, you know, easier to manage, right? Yeah. Then. So in this angle, I can, I think I can convince. But. Another part is this, this red pill I learned from Elm. It's not like monopoly on this. Other languages can. But I don't find many. Other languages. So the problem with picking Elm will be something that the manager has may not be comfortable with even if they're comfortable with this. Right. Even if you're comfortable with this, you'll be like, but the ecosystem is a bit weak. So you will have to weigh in on that. Okay. The ecosystem will be weak. Yes. But does it have what we need? And when it's missing, can we do something about it? Like MPM is like, I don't know whether he has a billion packages or not. How many are you using? How many dependencies? But you're struggling every day with those kind of problems and then you have to do this ball thing. Or you could have just, you know, return a good one. The ecosystem problem is harder for me. I feel because some people may or may not accept that it is viewed off as a risk. But this one is very straightforward. Maybe if you are talking about, hey, we are going to get some offshore developers ring a bell and then a bit like a, yeah, but if I give offshore developers the JavaScript code and then come back. And then you have to, you have to review it and be painful about it. Or you cannot do anything. It's easier to assess and keep it clean. So that cost cutting thing comes in, the ecosystem is a bit harder. I think the Rakuten post, which was somewhere here, no, no, no, no, no. Rakuten post does mention it. They use it for two years. They're happy with it. But then there are some downsides. They're talking about super long post, by the way. Yep. So the, so this will be things that just not as big. But this will be problems about Elm. I feel these are not problems about this tree red tail. Okay. Yeah. I want one, I know that, because I'm doing Elm in a, in a, even more unconventional way, because I'm using Elm on the server. And I'm also not the, the person who, who organized my code, like right off the bat, I can, I can organize my code in the perfect way. And then in the future, you'll be like, wow, I'm glad you thought of it doing this way. I really rely on this. This you cannot do anything thing, right. So what happened is my server time Elm had a, had a slow beat and I was like, big quiz like why, why is this so thing of it as your rails app. Or your goal and web app. And then he has a performance like on this call, something is going on. I couldn't figure out. I don't, I don't know why I wonder why. So what happened is that because it is, because it is like that only events in a return value. I don't know whether it hits you yet, Michael, that it means that your function can run by itself in any other environment. You just have to give this callback function some value. And then when it returns, you just look at the value. So what happened is that my, my server side Elm app, which is like, you can imagine your rails at your goal and server. When I pluck it out, I put it in Chrome browser to run. Given the scenario that made it slow, and I could use the Chrome debugger to like, oh, so this is going on. My entire app was pure. And I can put it in another place to check it out. And my code doesn't even know, doesn't even care. Nice. But it's not my, my foresight. It's not as if I'm so good that I can think of this. Hey, I'm being forced. It's just plain good architecture. And one thing to emphasize is also every language can do this. Your language, you can already do this. You have your callback function events in, you just do it like that. But what happens is this is that, you know, how to do in your, in your, in any other language. Because you can just do some other easier thing. I think that's it. Thank you. All right. Thank you. Thanks a lot. Thank you. Thank you. I will see you guys next time. Bye. Bye. Bye.


What's going on everyone Sam here with late in sports cards doing a cool mixer here for Donald w We've got one 22 tops chrome update series baseball five silver packs and 20 Father's Day packs. So let's start with the 20 Father's Day I'll count them out for you again really quick Donald 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 All right. Good luck here, buddy. I'm back with long rookie Devin Booker a bunch of refractor cards prism Roman Reigns and Jalen Durand rookie. How you doing? Terry Eason and Anthony Richardson to 199 nice one there. So Jake Hainer and Zion Williamson Marshall Meyer, Jalen Hertz, Shadon Sharp, Anthony Edwards, Ray Wyatt, Jackson Merrill to 99 on the red Nice one there. Joe Burrow and Jordan Addison rookie Roman Reigns, Jalen Durand, Donovan Mitchell, Ellie De La Cruz. Nice one there on the second half here Francisco Alvarez another Mack MacLung rookie Yeah, prism can be pretty crazy Brian prism can get freaking wild dude James Wood. That's a gold AJ Brown Uh, nine of ten. Nice one there. Grats. Uh, Donald There you go, buddy. Nice AJ Brown Anthony Richardson, Carl Anthony Towns Yeah, a prayer of getting called up will be huge. I think remarks. Paolo rookie Travis Kelsey, Ray Wyatt, Michael Meyer to 199 the new Oakland Raider downs and Yanis Joey B Jordan Addison rookie T-Law and Josh Downs Jason Tatum, Masataka Yoshida rookie That's father's day pack here. Nice price young rookie and a purple of Tyson Badgent that is eight of 25 Now my buddy was at that game AJ when I'm like lifelong friends. He was so pissed Uh, TC update now Corbin Burns, Purple Kevin Smith Schwabbert purple Wander rookie Peterson, Nick Allen, Purple rookie Purple Jeremy Pena true rookie. Nice one there Joe Ryan, MJ Melendez, Purple Joe Ryan Jayron, Palacio, Scholar urban purple Pena Purple MJ Melendez Jeremy Rand Drew Smiley purple And then Sawinsky, Purple Rich Hill And Adam Engle Jesse Winter, Purple Steven Kwan, Purple debut, Alec Thomas Connor Joe, Purple Andrew McCutcheon This family's all from Boston Yeah, yeah, family all is right Yeah Alejandro Kirk, Seth Nugo Royce Lewis, Jack Sawinsky, Purple Smith, Ray Maltapia, Purple Matt Olson, Purple Steven Kwan, Purple debut, Rookie Jeremy Pena, True Rookie Bobby Witt, True Rookie, Michael Lorenzo Now Thomas, Johan Duran Is that drinky purple?  Uh, Five Silverbacks Nice, Justin Fields to 199 Oh, that's his boy too That's awesome That's his boy Jalen Brown, very nice That's awesome Blue, Aaron Bradshaw to 50 And Russell Wilson I'm assuming, Tyler might be a bit behind I'm assuming, talking about the Orioles But yeah, if you're mentioning the Orioles For sure, Donovan Mitchell, Henden Hooker To 499 for the lines Orange, Derek Whitehead 199 and Fields again Last pack is red Lamello Ball to 99 For the Hornets Well as an Austin Eckler That is going to do it for your break there Donald, thanks again for the support buddy Get him right out to you, my man


Hi, I'm Karen Robledo and I'm a senior in SMG. I just did six miles. When I run, I feel like I'm on top of the world, like no one can stop me. The adrenaline rush just excites me. I enjoy running in the morning because it clears my head and puts me at ease. When I step on the treadmill, I make sure to turn on my airplane mode on my phone so I don't get any distractions.  In high school, I had more time on my hands. I also had more energy. I was in the cross-country team and the soccer team. When I first started to work out, I was only able to run about two miles, but now I can run up to six miles or so. I like listening to songs like Kanye West and Jennifer Lopez. When I finish my run, I do a couple of weeks and I stretch and do some apps.