An important “unblocker” for me when learning Rust after decades of other languages was internalizing that assignment is <i>destructive move</i> by default. Like many Rust intros, this sort of glides past that in the “ownership” section, but I felt like it should be a big red headline.<p>If you’re coming from C++ especially, where the move/copy situation is ridiculously confusing (IMO), but also from a simpler “reference by default” language like Java, this has profound impact on what’s intuitive in the language.<p>For the C++ comparison, this is a pretty good article: <a href="https://radekvit.medium.com/move-semantics-in-c-and-rust-the-case-for-destructive-moves-d816891c354b" rel="nofollow">https://radekvit.medium.com/move-semantics-in-c-and-rust-the...</a>
Nice blog post. Nonetheless, to a new learner like me, the hardest part of rust is not its syntax; it is the ownership management. Sometimes I easily know how to implement a task efficiently in other languages but I have to fight the compiler in rust. I either need to reorganize data structures, which takes effort, or to make a compromise by cloning objects, which affects performance. Note that I do agree with rust designers that it is better to make data dependencies explicit but learning to deal with them properly is nontrivial for me.
In my opinion this is the way _not_ to learn Rust. These syntaxes are not important at all, and doesn't introduce lifetimes (which is by far the most important part of the language for deciding whether to use it or not).<p>Any blog about learning Rust for beginners should just contain information that helps the reader decide _whether_ she should put in the time required for learning it, then refer to the great Rust Programming Language book that's really hard to surpass.<p>The reference is great as well, though personally I miss a part that formally defines the type system in its current form (there are some papers about lifetimes, but they are very hard to read).
It'd be nicer if there was some way of selection which language is shown on the left side. Expecting readers to understand both C++ and Kotlin and Java and Javascript will be a stretch for most.
> Inner functions. Rust also supports inner functions.
...<p>> Closures (lambdas). Rust supports closures (also called Lambdas, arrow functions or anonymous functions in other languages).<p>That's misguiding.<p>Closures are not lambdas. Lambdas are just syntax, but the whole point about closures is that they capture the enclosing environment (have access to variables where it's defined). Rust's documentation states just that. Closures may or may not be lambdas.<p>In above example of "Inner functions" (which is also a closure) that would be more clearly explained if the inner function used an outside variable. Not all languages can do that.
I keep saving these Rust resources for a near future... Am i the only one??<p>I really hope to start using Rust in 2023, probably for some kind of API gateway experimentation