News for hackers. Stuff that matters.
Re:Rust 1.62.0 by nicoburns on Thursday June 30, 2022 @02:18PM (#31936368)
Are all the other languages fairly mainstream ones? Most procedural/OOP languages are similar enough that if you’ve learnt one you’ve basically learnt them all. Rust is a just a bit different and requires actually learning something new.

For 90% of people I think the main hurdle is realising this.

Re:Rust 1.62.0 by srvmshr on Thursday June 30, 2022 @02:22PM (#31936428)
What is the best way to pick up Rust and its best practices as of today? References welcome (thanks in advance!)
Re:Rust 1.62.0 by ttfkam on Thursday June 30, 2022 @03:01PM (#31936990)
My advice is to avoid optimization like the plague while learning Rust. Don't worry about extra copying or optimizing lifetimes or any of it. Make all the "extra" structure and String copies.

Doing it the "basic" way is sooooooo much easier, which is important while learning. Nine times out of ten it will be fast/efficient enough anyway.

After you've got a handle on it with a few non-trivial programs under your belt, then start tightening up once you have the necessary context and familiarity.

Re:Rust 1.62.0 by jgerrish on Thursday June 30, 2022 @06:44PM (#31939652)
This is fairly good advice, but I've run into a few cases where codebases don't "optimize lifetimes" and you're left with static lifetimes everywhere. Which is ok for some use cases, but it's a core language concept. One that is confusing unless you work with it some.

While the Rust syntax around lifetimes can be confusing, The Rust Book does a decent guide describing what lifetimes are. Reading up on Modern C++ practices and language constructs actually helps with Rust too.

The rustdoc book doesn't have a lot of examples of the full markdown support for documenting your code unfortunately. Browsing through std helps.

Cargo rocks, and it's easy to spin up a new project. One thing I did was create a few new ones just for concepts that were difficult to me at first.

Re:Rust 1.62.0 by ArchOversight on Thursday June 30, 2022 @02:25PM (#31936489)
The Rust Programming Language book is absolutely fantastic: https://doc.rust-lang.org/book/index.html

It's a pretty quick read and gives you a good handle on Rust fairly quickly.

Re:Rust 1.62.0 by nu11ptr on Thursday June 30, 2022 @03:11PM (#31937137)
I found the O'reilly book, "Programming Rust" 2nd edition, to be the best book. It is long but thorough. "The book" might be a better starting point, but is less thorough I thought, and while it left me feeling more like "I got this", I didn't think it prepared me for "real world" Rust quite as well as the O'reilly book.
Re:Rust 1.62.0 by pizza234 on Thursday June 30, 2022 @02:52PM (#31936859)
I think this (education) is a lacking area in Rust.

You can read the reference book, and even a few other ones, but still not being able to have a sufficient/solid grasp of the language. I couldn't find good material past the beginner stage (I consider Rust for Rustaceans advanced).

My personal advice is to find some project you'd like to implement, and practice a lot, or contribute to small projects you like, without worrying about best practices.

There have been definitely many moments where I wanted to close the Rust chapter, and that's why I think it's more important than other languages to keep the motivation high, which I think is best achieved by working on projects.

Rustlings is nice but... not stimulating.

Re:Rust 1.62.0 by olalonde on Thursday June 30, 2022 @02:45PM (#31936760)
Re:Rust 1.62.0 by staticassertion on Thursday June 30, 2022 @09:07PM (#31940840)
Write some code, listen to the compiler's feedback, don't worry about "good" or "fast", just get things working.