Re:Thread Safety in C++ and Rust
by tptacek on Saturday December 18, 2021 @09:28PM
(#29610801)
&mut is kind of gross syntactically anyways; another thing that would have clarified this would have been to rename & to &shared, which has symmetry.
[ Parent
| on HN ]
Re:Thread Safety in C++ and Rust
by ReactiveJelly on Saturday December 18, 2021 @10:10PM
(#29610985)
Nah, I like having immutable syntax be shorter. It makes idiomatic code shorter than code that does a lot of mutating
Agreed! I also like that declaring a mutable binding is extra code beyond a regular binding rather than something the same (or shorter). At least for me, making things immutable by default and then only relaxing it when necessary leads to code that tends to be less buggy, and I suspect this might be true for others as well.
Rust is already an ugly language.
Having &shared plastered all over your code base would be ... suboptimal.
Not everything in a language needs to be 100% self descriptive.
I think the designers arrived at a good tradeoff.