April 13, 2021
2493
Brandon Smith
Lately I've been seeing lots of anecdotes from people trying to get into Rust
who get really hung up on strings (
&str,
String, and their relationship).
Beyond Rust's usual challenges around ownership, there can be an added layer of
frustration because strings are so
easy in the great majority of languages.
You just add them together, split them, whatever! They're primitives that you
can do whatever you want with. For someone who's only ever known this mental
model (which is to say, never worked much with C/C++), using strings in Rust
can be a rude awakening. They feel very complicated, have all these