4 ms·
> Not really. I use unwrap and clone everywhere and I can do everything as if Rust were then a garbage collected language, and I can then test out different sol
by hannofcart 3y ago
> Not really. I use unwrap and clone everywhere and I can do everything as if Rust were then a garbage collected language, and I can then test out different solutions, hack my way through, just as I would in Go or Python.
This part of the comment deserves to be highlighted and mentioned more. I think this exactly the way to "hack something together quickly" in rust.
After that, incorporating correctness seems to be as simple as grepping with each unwrap and "dealing with it".
With the above approach, Rust is a great prototyping language as well.
- bryanlarsen 3y agoThe thing about clone and to a lesser extent unwrap is that 90% of the time, just leaving in the clone is fine. It might be suboptimal, but if it's not in the main loop, who cares? With unwrap, replacing the unwrap with an expect signals you've accepted that an unwrap is ok in that piece of code. I'd like a similar convention for clone.
- kaba0 3y agoIf that’s the case, then Scala and similar should also enter the question. That is at least an expressive language compared to Go, and if you don’t need rust’s performance it may be a good tradeoff.