4 ms·
any suggestions for exercises that drill this in? I'm going through the linked list book but it's still not completely transparent for me.
by throwlaplace 7y ago
any suggestions for exercises that drill this in? I'm going through the linked list book but it's still not completely transparent for me.
- burntsushi 7y agoNot really. Pick a project and start building. At least, that's my learning style. Reading things like the linked list book is great, but eventually, you probably have to put it to practice in order to really learn it (like most things).
- steveklabnik 7y agoI would like to second everything you've said here, and add a few things: 1. If you are feeling stuck, please reach out on users.rust-lang.org or discord.gg/rust-lang. We're here to help! 2. If you're feeling really stuck, maybe take a break and come back to Rust in a few months. A number of people have given up on Rust in frustration, came back after a significant amount of time, and then said "why did I think that was so hard before?" 3. Don't worry about a few calls to clone when you're getting started; it's better to have a working program that does some extra copying than it is to not have a program at all. 4. Especially when starting out, you almost always want structs to own their data. Don't use references as struct members unless you're absolutely sure that's what you want. Advice #3 helps with this. 5. I think one of the biggest mindsets that can set you up for failure with Rust is "The compiler says no, how do I get it to do what I want anyway" instead of "The compiler says no, what is it telling me, and how can I work with it instead?" Especially if you come from an OO heavy background, you may need to change the patterns that you reach for initially. Yes, you can write any style in any language, but Rust pushes you towards its idioms much more strongly than other languages do.
- burntsushi 7y agoHah yes, this is a MUCH better answer. Thank you. :-)
- steveklabnik 7y agoNaw I think you hit the most important bits right up front :)
- CameronNemo 7y ago>discord.gg/rust-lang Why not plug the rust channel on Matrix?
- steveklabnik 7y agoI only plug: * Things that are run by the project * Things that I use I have no idea if the Matrix channel is any good or not, so I cannot recommend it.
- CameronNemo 7y agoFair enough. Hope you do get a chance to check out the Matrix channel! (#rust:mozilla.org)
- adamch 7y ago+1 to the Rust Discord being _really_ helpful. If you can provide an example on play.rust-lang.org, someone will definitely help you.
- aganame 7y agoThe Rust channels on Matrix and oftc irc are really helpful as well :) For drills, I recommend exercism.io in practice mode (mentor/student ratio is pretty bad). After working on your own solution for a while, then checking how the others solved it... priceless. Somebody almost always figured out an objectively better solution.
- hechang1997 7y agoI found the "Too Many LinkedList" tutorial is very helpful. Try to follow the tutorial by writing your own code.