Jonathan Foster


Learning Rust with rustlings

Last Updated: 2024-01-26 22:21:57 UTC

I used to think Rust was too hard for me to learn. Everyone talks about the learning curve and how slow you will be when you start using it. Many speak of frustrations with fighting the compiler. Language features, such as ownership and lifetimes can take a while to understand. Like many, I often work with languages that never make you think about memory. My first time jumping into Rust, I went right into the deep end. I wanted to rewrite a web service in Rust, but this threw a lot of the advanced, confusing syntax in my face. I didn’t even know the basics. I eventually went a different direction with the project. I let myself believe Rust wasn’t for me and not a tool I needed in my toolbox.

Fast-forward to 2023, the JavaScript tooling ecosystem seems to be exploding with rewrites in Rust. Once again my interest in Rust peaked. It had been a few years since I attempted to code anything with Rust. I decided that with more experience and maturity, I did have the ability to learn it. I dusted off my physical copy of The Rust Programming Language, and decided I would solve Advent of Code in Rust. I think I made it through two days of challenges before losing interest. I found it pretty boring and the open ended nature had me spinning my tires with a language I barely knew.

I still had this desire to learn Rust. Instead of falling into the YouTube tutorial wormhole, I decided to start rustlings. It is such an incredible resource for learning the language. You are guided through features of the language, starting with the basics and ramping up to more complex concepts. You can ask for hints during each exercise, but it is often a gentle nudge in the right direction and will point you to the applicable section of the Rust Book to learn more. This is such an effective way to learn and it is teaching you to read documentation. A skill that the industry does not promote enough. You can watch thousands of YouTube videos on a topic, but you won’t achieve your goal until you get hands-on experience.

You can learn Rust if you want to. Don’t let others discourage you. Be patient with yourself and try to remember the compiler is your friend. You can start right now.