Francis Hwang has been writing programs in the Ruby language since back before barely anyone knew what it was. He co-founded the groundbreaking GoRuCo conference in New York City and is currently the CTO of Profitably, a financial analytics startup. Francis builds a scoring system for a fantasy sports league. Out of the six Play by Play courses we've filmed so far, he completed the entire task in the shortest amount of time. Yet he prides himself on using very few workflow or editor shortcuts. It's all about straight-ahead problem solving, clear thinking, and test-driven development.
Introduction [Autogenerated] it's peep code play by play. In this series, we sit down with experience developers to see how they work. There's no script and new curriculum. We give them a task and see how they go about solving it with their preferred tools, strategies and workflow. Francis ____ is used in mastered Ruby for many years. I first met him at Ruby Conference 2005 where he presented a file system mocking library that he had written. He's since gone on to start the groundbreaking Go Rouco conference in New York City and is currently the CTO of PROFITABLY, a Financial Data analytics service. We'll cover a lot of information in about an hour if the pause button or replace section if you find it confusing. Okay, so the project is, uh, this is actually the first time that I've first time that I've repeated a project and personally, I'm doing this because of the person I did it with yesterday. What? We haven't published it, so you haven't seen that so from people. It may be interesting to see how two people solved the same problem without having seen the other one did. So what? We're gonna build our _____ much as possible is a little fantasy Sports League are and specifically recently have been into bicycling and makes it a little easier. Basically, you have just a list of athletes were not going to care about teams or, you know, they're no positions or anything. It's just a list of athletes and then a list of races and the manager's fantasy managers will pick the top five placements for each race you know they're guests on. And then there will be a scoring system that will give points, so scoring is fairly simple. But that's that's That's the task. How would we do this in Ruby in the room, water world? One me, you know, make some kind of Web interface or something to do this. But initially, I'm just concerned about, like, the data model and in the kind of the logic of doing the scoring and in that kind of thing, How would you attack a project like that? Well, actually, you know, do you have any questions about You know, I think I may have questions about the specifics of scoring, so you know the specifics as we build it, but actually, these days when I start a new really project and I am sure some purest way this. But for me, it's basically like if I don't have a good reason to not make it over those product, make it a real project, even up there you go. You said your views and stuff make it. Making a weapon like a successful is not as important, but even just like having this world is all the active, active record generators and the migrations in the test. And that's pretty much a place like that. Just makes it fast. Well, cool. Yeah. There you go. So I guess I would start just doing rails. Call it. Why is this not so? I haven't after spending much time to familiarize myself with rules. Rails three, actually. Okay. And, Mike, are you two still runs to? So, Seo, are you there? We're like strangers in here, you know? It's not gonna start it. Get this out of the way for now. Oh, um, See, Doctor, uh, you didn't use our vm people raise about that for I've been starting to use our I've been playing around with a bit. Another laptop. I do like it's a far, but I just don't have it on this machine. I'm a little behind on that kind of stuff. Like I'm actually, Yeah, you know? Oh, I only started using it a couple weeks ago, and I think it's been after a year or something. Yeah, but what I've been seeing, I do really like it so far. So, um and of course, everyone I talked Thio head Thio Express Glee that Yes, J ed, it will be shown here, which I think people use a variety of tools and I don't know. Do you know anyone else we have a reason for? Do you know anyone else sees Jeong Ruby? I don't think it's a continuous. Everyone teases me about it, which is fun. Uh, but it's been around forever. And yeah, my general feeling about about it is that it does a lot of stuff. Okay, It doesn't do anything great, but it does you a lot of stuff, and I actually, the biggest thing about uh, text mate is it doesn't do split pain, which Oh, yeah, I can't. And every time I watch somebody else used text mate, especially on the big monitor, right? I feel like they spent all this time sliding When doesn't run my hand and I just I want So we'll do see what light for now, which is fine and sequel. That's great for the sort of thing. Generally, in any production based thing, I'm a big post press prison. But I'm so choice. What do we got? We got, I guess I guess one way to think about it is, you know, let's start thinking about what the use cases are to start with first Hughes case and build everything under it as we go. Okay. So what? So what? But what kind of what sort of thing do we want to store? What's the scenario or situation? See you making me do the work on. If I'm a manager, I would pick five the top five that I think will place in the upcoming Tour of Flanders. You need some more fine green than that? No, that's That's plenty, actually. So we've got mean taking out here this thing about entities with that managers and managers in fantasy sports leagues are kind of the users or whatever. Yeah, Yeah. Good managers have got teens. Forget teams. Okay. Okay, I mean, there is such a thing, but I don't think it's even managers, cyclists, tourists, right? Yeah. And then So you're saying that in a given tour, which is on a date in time, like the Tour de France? Sure, 2011 tutor Frantz given site is gonna place 1st 2nd 3rd Whatever. Yep. Right. And then before that happens, the manager is gonna basically bet or whatever. Yes, I'm gonna make a game out of guessing where they place. Okay, so and then after it's over, we see who actually was give people more people based on yet. So we're not gonna put these guys out of the first thing that last name, because, really, it's important, Manager, I will say, Well, soon we're not gonna worry about Log in right now. You can have that later if you want. Um, so we had those guys and then the Cyprus to tour the actual event. You could call it a placing or a result or something. It's a many too many join. What would I call it? I have kind of a reputation among people who work for me for picking something that is like, really precise metals are cane and not great. Longer up like overly clever is kind of a blind spot away. But, um placing standing see, if I knew more about sports in general would be easy for you to come with these words standing at the podium who, you know, ends up standing on the podium. But string about like how the result results when results are posted, like in a newspaper, say, like placing their standings or you're sending his first place. You're winners standing for now, which might be complete. He's gonna change, and then we're gonna make it many, many Troy D and second, and it's fairly important for well, do that in a second. And then so then there's also the manager is sort of guessing. Oh, you know what actually like that Is that just controlled the lead? Uh, it is he the whole word? Yeah, it's well, so in terminal on osx, there's a setting that you can say, How does it go? You go to keep born here. You say use options. Medic E Right on. Then you could do option, so Oh, mosey forward. One word being with you back, right? Okay. Option delete destroys the word option behind you. Option D destroys the world for you. Okay, So great. Or I use the escape equivalent. But it's nice having a down there is option escape Escape is basically the medic e. And I guess I never never escaped. And you just have to You can be president. So anyway, order right, it's important. Yeah. So now we will also make a pretty similar model between a manager and cyclists recalled standing guests standing Prediction. It's over, boast, but it's also more explanatory. This has have a manager Eddie in it. Thanks, Eddie. So we have five models we can slap on a bunch of pretty simplistic validations just to get started. Lamb. Well, okay, so you just opened, like, five files at once. Is that which E. J. And I went to the model directory? Yes. So then and you can just go on just shift. You can also do, like option looks even also, I think option or control, I think command, baby, you could do like Oh, discreet. He's okay. Yeah, And then you get five tabs with all those, right? Nice. So manager