Hey rustaceans, I just started Rust and I don't know where to start. I am a 2nd year student in my college and I have previously done The basics of C language and C++ language. But now after covering their basics I Want to move on to rust and I don't know where to start. I have done the setup in vs code And that's pretty much it. I have no idea where to start and where to go next. I just learnt about this community forum and thought that maybe someone of you can help.
I'd say just start with "the book":
another book for people who are already familiar with C:
Hello!
In addition to @nerditation's post, here are two more resources you might find useful:
- Rust By Example – runnable examples that walk through key Rust concepts.
- Rustlings – a hands-on course with small exercises to reinforce the basics.
Welcome! ![]()
Regarding books, I strongly advise these two:
- Programming Rust by Jim Blandy, Jason Orendorff, Leonora F. S. Tindall. The most clear and didactic I've ever read, which covers the basics but also advanced topics (including asynchronous and concurrent programming).
- Effective Rust by David Drysdale. Full of good advices and clarifications for common difficulties in Rust. Maybe to read in parallel while learning, or to reinforce knowledge later.
There are other titles worth keeping in mind for later, like Rust for Rustaceans by Jon Gjengset (a bit hard to read before you're familiar enough with Rust), Rust Atomics and Locks by Mara Bos (more advanced notions on concurrency), etc.
To test or illustrate little problems and post them here, people often use the Playground.
Another site worth checking out is Learning Rust. Don't miss the Reference and other Rust websites. EDIT: And let's not forget Rust for C programmers.
Consider a small project (it doesn't matter what, but one that aligns with your vision for using Rust) and implement it, consulting the documentation and literature as needed. This is how I learned all my programming languages.
nice idea man. thanks!
The above resources are good references, but working on a project is the only way to truly learn in my experience. Be prepared for your first couple attempts to suck. Fortunately refactoring in Rust is fairly easy.
In addition to this forum the people in the (unofficial) Rust Matrix space (#rust-:matrix.org) can help out.
I think you need both, not only practice. Writing code is of course mandatory, unless you study the language for theoretical purpose, but it would be sad to learn everything by trial and error when people have written books and website to give you a boost. That's how we usually learn best: theory and application. Especially with a language with a steep curve as Rust.
What do you mean by refactoring? Sry i don't know the basic terms.
That's something you can easily search. For example: Code refactoring - Wikipedia
"refactoring" can involves many things. For example:
Let's say you find yourself writing the same code in two or more places in your program. Well maybe it would a good idea to put that code in a function and call it twice or more times. That will not make your program run any better but it makes it smaller, less to read, hopefully easier to understand. Importantly it means that if you ever have to change that code you only have to do it once, in that new little function, rather than multiple times scattered around your program.
There are many other forms of "refactoring" like:
When to put a bunch of related variables into a struct.
When to make functions that operate on those variables into methods (impl) on the struct,
When to put a bunch of structs and impls into a module.
And so on...
Refactoring is something of an art. With the aim of bringing some organisation to your program, making it easier to read and reason about, making it easier to change without error in the future.