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?


To read more about this

1 Like

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