Cleaning up `ref`, `&`, `*` confusion

That seems like a good thing. Other people were saying that it would lead to too much churn, so if it doesn't lead to that much churn, it makes that concern less serious.

For me the biggest value is in reducing how hard the language is to learn and understand when reading tutorials and the reference. In the reference page on patterns, the keyword ref appears 18 times, so it's not insignificant. Even if it's not used that much in practice, people learning Rust come across it and get confused by it.

People learning Rust would also get confused by *x in patterns. One huge benefit of a dedicated keyword ("ref") over adding yet-another meaning to * is that "ref" is trivial to google or otherwise search for. If I Google "rust ref", the first 8 results I get include 6 results about the ref pattern, and 2 about std::cell::Ref, so I conclude that it’s really really easy to find. Googling for "rust *" is impossible on the other hand. Searching for it in the docs is possible, but not everyone will think of trying that.

5 Likes

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