How to become a Rust ninja? 🥷

That's a good point, but maybe it's not working very well with me, I prefer (it's just my method/approach) to study in structured way.
Anyway you're right, reading, analyzing real code is a good practical and effective way to improve knowledge of a language.
I was making some exercises on Codewars, but they are maybe more oriented in improving problem solving than learning advanced language features (as far as I saw).

Overusing traits is definitely a way people get in to trouble.

When it comes to game development, the truth is that games are a difficult type of project in Rust. I recommend this talk if you are interested in that topic.

7 Likes

I learned about most of the topics you list by reading posts on this forum (and eventually writing my own). I'm not sure how to turn that into a structured course of study, though.

6 Likes

Let me emphasize that. It’s insane how much more you can learn about the language by trying to answer other people’s questions.

13 Likes

Answering questions here is also how I learned a lot of what I know about Rust.

14 Likes

If I hit a specific area to deep-dive on, I often end up in the RFCs. They're not organized like a book and some later ones override earlier ones (which aren't consistently updated to point to the newer ones), so it is a more work. You also might have to go browse the PR and tracking issue to get the full picture, to boot. (In fact, always check the tracking issue to see if it's actually stable yet.) But sadly, there are a number of advanced topics where the only adequate documentation I'm aware of are the RFCs.

Another place, if there happens to be a post or series about it, is Niko's blog (Baby Steps). A lot of "big change" ideas start there, including ones that haven't landed yet but are expected to (Polonius, Chalk). Given when 1.0 came out (with it's backwards compatibility guarantees), most posts since 2015 should still be relevant. Even the earlier ones may be indications of Rust's future.

(Side note: Anyone know how to get a single list of posts out of the new format, like it used to be? An RSS URL maybe? Clicking through 20 pages excerpts is much less reference-happy.)

After that I typically spend some time writing toy programs in the playground, if applicable.


Here are a few links I've found fruitful. OK, a lot of links -- I decided I'd find this useful enough for myself that I just looked through the RFC list and Niko's blog for anything related to your list :sweat_smile:. The list is something you'd want to cherry pick for your current interest, not something to tackle on one go. Most advanced topics I have to revisit a few times, personally.

(Note: dyn Trait is relatively new, so in a lot of these you'll just see "trait object" and Trait. Also, in the older pre-1.0 ones, you may see Box<T> written as ~T.)

13 Likes

And just to jump on the boat: participating in this forum is also what led me to a lot of the topics above. For me the first level is finding something that works for someone's problem, the next level is finding a reference explaining why things work that way, and the further levels are actually internalizing and understanding the advanced-to-me topic. I also bookmark great posts by others for future reference or to circle back to when I'm interested in tackling a new topic.

Hope you stick around!

3 Likes

In my opinion, there is no substitute for writing a high volume of code.

  1. Type out all the examples in Introduction - Rust By Example

  2. Work on whatever you are passionate about, where some external goal will provide motivation to work through all the rustc compiler errors.

  3. Write lots of code. When you run into an issue you can't solve, reduce it to a minimal example and post here.

4 Likes

Yeah, you're right, the problem is that I am afraid to provide wrong or inexact answers, but you're right, trying to answer is a good exercise.

:heart_eyes: :dizzy_face: :exploding_head:

Thank you so much for your reply! That's gold! I will take lot of time to go through all those stuff, but I will give a try!

Again... Thank you!

1 Like

I intended to maintain links to some brilliantly clear and helpful posts here. Some in reply to my own questions, many not. Sadly somehow I did not do it.

Perhaps you could post your "best of" bookmarks here?

3 Likes

Sure. Many are recent, as I didn't start doing this as long ago as I now wish. Some are my own, which I keep not out of arrogance, but because they're basically my Cliffs notes. I'll try to give credit when they're based on other people's posts. There may be a repeat or two from above.

Anyway, here goes:

If others have lists, I'd be interested in seeing them too!

13 Likes

You can focus on questions that feel like you can answer them accurately, or you can clearly indicate that you aren't 100% certain yourself. Often it's the questions where you know the answer roughly, but need to dig just a little bit deeper to get things written down properly and consistently that improve your own understanding of things, too.

Answering questions can force you to do a more narrow and focused search online for relevant explanatory material or reference material yourself, sometimes you'll discover new sources of knowledge yourself this way, where someone's question only was the source of new search terms. (And sometimes, trying to answer a question may not lead you to an answer for that question but leads you to learn about a mostly unrelated, yet new or unfamiliar to you topic.)

If it's about digging up tutorials, even with a rough understanding of the topic, you can often judge the quality of tutorials / blog posts, etc. better than the Rust newcomer that's asking a question. Then you can link a good one you found. Or you can help because you at least know the proper keywords to search for. While reading / evaluating existing tutorials, you're inevitably deepening your own knowledge, too.

4 Likes

I have just read Common Rust lifetime misconceptions (from your suggestions list).

Kudos to the authors and to you for linking it here! :clap: :clap: :clap:

In my opinion articles like that should be inserted in the official Rust book, they are very precious and well made! I remember that in past survey lot of people asked for improvement of the learning curve, IMHO including such kind of clarification in the official documentation (maybe as appendix) could help a lot of people (like me :blush:). I don't know who is following documentation topics this day, I remember that @steveklabnik was involved in the official book, so he could be interested in this topic.

I think having the language's official guide endorse external work can be a bit hard politically, so they've chosen to stay out of it. That's why you'll hardly ever see crate recommendations in The Book or the standard library docs.

For example, we can't accept every article written about Rust so we need to curate the list, but then how do you set the standards? Who chooses what is "acceptable" and what isn't? What if the author works at a big tech company or the article is from a company's developer blog?

Instead, I'd probably add those resources to an unofficial list, maybe Awesome Rust.

I wonder if one can side step the curation / "politics" issue by having a rust-wiki-cookbook, basically a community created Vec<(Question, Vec<Solution>)> , where Solution are links to Rust-playground snippets.

Thus, instead of endorsing articles, it's just saying: these are valid problems, and here is a community donated list of solutions.

1 Like

What about Table of Contents - Rust Cookbook

1 Like

41 posts were split to a new topic: Using optional callbacks in Rust

The Rust Cookbook is fantastic; the only thing that can make it better, in this context, would be making it wiki-style. I would suspect wiki-style cookbook would (1) have a few more entries and (2) likely have new entries add daily. [Just imagine if every day, the most useful response on this forum was converted into a wiki/cookbook style q/a and added].

3 Likes

This is true but also it's complicated! For example, the first edition of the book had two major sections that were taken from community blog posts, namely @Manishearth's Wrapper Types in Rust: Choosing Your Guarantees - In Pursuit of Laziness (which was Choosing your Guarantees) and @BurntSushi's Error Handling in Rust - Andrew Gallant's Blog (which was Error Handling)

We could in theory do a similar thing for a post like this. But practically, these chapters were removed eventually, not because they're not awesome, but because they don't quite fit with the rest of the book: they're written by completely different authors as standalone texts, so that makes perfect sense!

We could adapt that text for the book, but that also has some big issues. Namely, the book is already very large. Adding even more stuff to it has some downsides, as well as upsides. There are tons and tons of things that go into learning Rust, one book cannot be everything to everyone.

So, @killkrt, I am glad you liked the article, it's a great one! But it is not going to be put into the book.

6 Likes