I’m wary of learning new technologies simply because they are trendy. And I think you should be wary, too. It’s easy to get caught in a trend and wind up in a bind a few years later. You don’t want to join this group of programmers. For that reason, I generally put only enough effort into a new technology to understand what it is and what it might be useful for. Then, I wait until it takes hold. Rust is still pretty new, and hasn’t replaced any of the older systems-level programming giants like C and C++ yet. However, perceptions around this new language are changing, and in 2023, Rust made its way into the Linux kernel, which many saw as a solidification of its place as a good systems programming language. I saw this event as a signal to get ready – Rust is probably here to stay.
If that’s not a good enough reason to learn Rust, consider what you can do with it. Rust will likely be the premier language for Web Assembly applications and is already finding a home on the server side of many other web applications. It’s really fast, memory-safe, and has a reasonable syntax with quirks that aren’t too hard to swallow. If any of those things sound like something you’d like to dive into, try Rust. Here are the steps I’d suggest to grasp the language quickly.
When performance is measured, performance improves. And you can’t measure how much Rust you know unless you test yourself on it first. How can you test yourself on Rust? Use Rustlings.
Rustlings is a GitHub repository full of exercises in Rust that test your knowledge of the language. The exercises are primarily about fixing compilation errors, and they are designed to teach you the language. You can learn how to set up and run the Rustlings repository on GitHub. There are 90 exercises! You don’t have to do all of them at first. I recommend doing a few until you understand how much of the language you can easily pick up without any other instruction. Use the compiler errors to help you. The compiler errors in Rust are usually very helpful, so you might get further than you expect.
Read The Rust Book
The Rust book (also called “the book”) is the primary source for learning Rust. For the beginner Rustacean, it has all the content you need to get started with the language. I advise skimming through the book first, without even programming along. This will give you a good idea of what the language is like. Then, if you want to continue with your learning journey, read the book and program along with the examples. This will take significantly longer, so it’s a good idea first to get a basic understanding of the language before deciding to commit to a longer read-through.
Watch the Videos
If reading isn’t the best way for you to learn, have no fear—videos on Rust abound! My favorite videos for learning languages are from Derek Banas, who can teach you Rust in one no-nonsense video. I’d recommend doing the same with this video that you would with the book: watch the whole thing through once, and then the second time watch it while you code along. If you’re looking for more content adjacent to Rust, there are loads of other great content creators out there talking about the language. ThePrimeagen and No Boilerplate come to mind.
Do Rustlings Again
After you’ve read the book or watched the videos (or perhaps both), you should be ready to take on the exercises with the intent to complete them. If you can do all the exercises in Rustlings, you know Rust.
The true indicator of language proficiency is programming something useful with the language. So now is your chance to get creative and code something that sounds fun to you.
My go-to project for getting familiar with a new language is any kind of game. If that interests you, I recommend checking out the console-engine crate and using it to code a simple game that runs in the console. But Rust isn’t limited to console apps, you can also code for the web, an API, or a native app. Rust can do whatever you need it to. But beware that often the libraries that enable this flexibility require just as much time to learn as the language itself, and I think something simpler, like console-engine, is a good way to get an idea that shows your proficiency in Rust out the door faster.