Rust mentorship with Exercism


English (Auto-generated)

Hello everyone. It is his um today I'm gonna teach you guys about an awesome resource called Exorcism. It's a site that's similar to code challenge sites you might have used like code wars or was that one everybody uses for jobs. I forget people complain about it because of interviews, but I don't have to worry about interviews because I'm a freelancer. So exorcism is a little different though. And then instead of just doing coding challenges, you can actually get mentoring. You might see here, It says mentoring. Yeah, they offer that real people will come in and they'll say, hey, you know, I look at your code, here's what's wrong with it. You can ask them for specific things they should look at and you can mentor others. So if you're an intermediate rest developer and you want to get to that advanced level, you can take a look at what other people are doing in their code and say, hey, I could learn something from that. I think that's always good. You know, looking at people who are more junior than yourself and teaching them can really help you look for patterns or newbie type mistakes or things you might be doing in your own code that you wouldn't otherwise have noticed. So let's see how this works. So we have the screen up here, we can do it. You can actually do this on your editor like visual studio code or vim or whatever you use, but they have like a built in editor. If you're too lazy for that. In other words, if you're like me, but I'm still gonna edit the code over here. Just that you can see it in code cast more easily. Excuse me. So let's see what we got to do. I guess I should have read what the challenge was before opening it in the editor, reverse a string for example. Cool output luke. This is kind of like a classic little challenge to have to do. It's more just about showing you how exorcism works and what exorcism is all about because this really is an awesome resource. I mean if you're a code castor then you're probably the type of person who's looking for stuff that will help you learn that that goes with being a self taught person an autodidact. And this is definitely one of those resources. Okay. So it's going to give us a string a string slice specifically. So we're borrowing this string. Okay. That means we could probably try to change the string in place and even make it mutable if we wanted like moot, I think it has to be passed in that way or something. I don't know because we're not gonna solve it that way. So it really doesn't matter what we're gonna do is create a new string, some immutable and we're gonna call it Webster, it's going to be a new string. The reason it's mutable is I'm gonna add the characters in, but I'm gonna insert them each at the beginning as we go through them until we get to the end. That way the string comes out backwards. So I will say for char in and we'll take that original string called input and we'll turn it into an iterable of of characters. So now we have each character and basically we're gonna insert those in. We don't know how to do that. Don't worry because we definitely are going to return. I'm so used to uh my python ways of saying return. You don't have to do that in rest. It's optional, but we don't have to do okay. But we want to be cool. So we don't do it because being cool is what code is all about. So we can do this insert method or trade or whatever it's called in Rust on a string. And here we have a string called red string. So we'll say reb string. Uh insert, it'll take the index. We're going to insert it into the beginning and then the character and semicolons. All right. And I didn't save that whole time. So you couldn't see it any way outside of the little video. So might as well have just been here. But yeah, here's the little online editor thing they have for people like me who can't configure software on their computer. We hit run tests. The rust compiler inevitably complains. Oh, wow. We actually did it. Okay. And then we submit. And what do we get? Do? We get internet points, You bet we get internet points. And then it opens up other things we could do. So like when I first started out I think I had to do some Hello World challenge. And then you could do that. It says it's in progress even though we totally did it. Uh Mark is complete. There we go. Okay. And then you can show me more exercises and that one disappears. I think it goes somewhere. Apparently not here. But yeah, there it is. Reverse string. Published. Published. And yeah, I'm pretty sure if we were to look somewhere we could see that we got points. But the point is that it opens up other challenges. Some of them will be locked. I don't know if any of them are locked to me now and they've done a few challenges. I think they all become pretty much open but at some point something was locked. So yeah, you have to do a few of them, they have hard right? They have different levels that we don't have to waste your time doing easy stuff. I mean some of this isn't that bad in reality, like a linked list. That's pretty easy. Right? Even python before, even in c I mean that classic programming problem where you have to reverse a linked list and see I mean in rust, the link lists are like nightmares because making perfectly memory safe link lists, there's actually a really good rust learning resource, we'll probably use it one of these days since we're really focusing on showing you cool learning resources called Learning Rust with way too many linked lists, it's like a classic. You probably enjoy it if you like linked lists or if you like data structures, if you just like doing weird things. But yeah, I hope that was helpful. That's exorcism. That's what exorcism is all about. Thank you a lot for your time. I hope that was educational. Goodbye.
8 Views 1 Likes 0 Comments

Books are great, but sometimes learning requires a more personal element

Leave a comment (supports markdown format)