Swamptin

A Personal Blog

View on GitHub

Rust Learning Part 1

I’ve been learning the Rust language on and off for a few months now. I’ve made one little project in it, a ToDo app that runs in the commandline. It’s a fun little language to work in and I enjoy learning it. My close friend Colm sent me on a project that purports to be a great way to learn the language. This blog post is going to document my experience following that project.

100 Exercises to learn Rust

The project can be found here. The project has some handy little tools to help you track your progress. Just install the workshop-runner tool and run the wr command to see what the next test is. When you run the command it prints out a nice encouraging message and then either points you to the next problem, or shows you the error details to help you debug the issue.

The rather verbose error messages from Rust are very helpful for the most part. I do find that sometimes they can be a little intense, but if you take the time to sit with them you can usually see the solution clearly in front of you. It’s one of the best learning tools for learning the language.

Exercises 00 - 02 - Nothing to Calculator

The opening sections are very enjoyable and quick enough to get through. It introduces you to the potential layout of a rust file without forcing you to write it from scratch. Whether this is a good way to learn or not really depends on the student. I know I sometimes enjoy just writing out the full file and learning that way. But if you want to be introduced to concepts slowly and work up, that’s exactly what this poject seems to be doing.

The one exercise from this section that strikes me as very interesting is 2.5 which is about factorials. You’re tasked with writing a method that will return the factorial of any number using only what you’ve learned so far. What makes this such an interesting challenge is that at this point you haven’t learned anything about loops. This particular exercise caught my by surprise for it’s perceived complexity. If you’re taking this on, I hope you enjoy this one.

The first two chapters were really enjoyable and I felt like I accomplished a lot working my through them this evening. I would strongly recommend giving this a go if it’s something you’re on the fence about. It does tackle some seemingly complex concepts, (integer overflows and recursion appear early) for what is an intro to a language. But the written sections clearly explain what you need to know or where to go looking for your answers.

Verdict so far

I feel like this tool, similar to many others I’ve seen, is another “Rust for existing developers” solution. It’s really well written VMs seems to suit my learning style so far. But I don’t know if it’s a good solution for someone learning to choose from scratch. I benefited from at least having a rudimentary understanding of concepts.

Will I keep going with this? Yes. I hope to cover all 100 exercises. Who knows, maybe I’ll get through them in a timely manner too! I’ll keep writing about it either way. I like this language, I want to use it. I hope I’ve found a way to learn it that sticks. It’s definitely less intimidation that reading Rust By Example.

Home