Tips to help newcomers to "think" in rust

This isn’t a tutorial, but a tip that has helped me a lot today. In Architecture Suggestions for Idiomatic Rust, I was having difficulty “thinking” in rust and @KrishnaSannasi advise me to think in terms of “borrowing” instead of mutability.

I took that suggestion to heart and wrote out, in natural english, what my code was doing. I was sure to use the terms “borrow”, “lend,” “give ownership to,” and “take ownership of.” It was really enlightening. I normally just think about where an object is and don’t care about how or why its there.

Anyway, it’s helped me so I thought I’d pass it along.

Any other tips for newcomers?

4 Likes

To read more about this

https://limpet.net/mbrubeck/2019/02/07/rust-a-unique-perspective.html

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.