←back to thread

451 points birdculture | 1 comments | | HN request time: 0s | source
Show context
ajross ◴[] No.43980170[source]
> Use String and clone() and unwrap generously; you can always refactor later

At that point you might as well be writing Java or Go or whatever though. GC runtimes tend actually to be significantly faster for this kind of code, since they can avoid all those copies by sharing the underlying resource. By the same logic, you can always refactor the performance-critical stuff via your FFI of choice.

replies(5): >>43980203 #>>43980432 #>>43980632 #>>43981812 #>>43981902 #
1. rafram ◴[] No.43980432[source]
Not to mention that even though you can always refactor later, will you really? It’s much easier not to.

In my experience, hobbyist Rust projects end up using unwrap and panic all over the place, and it’s a giant mess that nobody will ever refactor.