r/rust • u/rustacean1337 • Nov 17 '22
What are Rust’s biggest weaknesses?
What would you say are Rust’s biggest weaknesses right now? And are they things that can be fixed in future versions do you think or is it something that could only be fixed by introducing a breaking change? Let’s say if you could create a Rust 2.0 and therefore not worry about backwards compatibility what would you do different.
220
Upvotes
View all comments
Show parent comment
2
u/[deleted] Nov 18 '22
Lifetimes can be avoided almost always. I think you're stuck in OOP land and having a hard time adjusting.
I felt I really had to rethink my first intuition for every pattern I wanted to implement in Rust at first. I started with a game framework / rendering engine, meaning I had to plan ahead. If you just think you can learn Rust by simply doing, you're going to have a bad time.
Anytime you'd have a lifetime in a field inside a struct, rethink everything. Make it Rc/Arc or Box it if you have to. Borrowing in Rust should be short term only.